Hi,
I am new to T-SQL and I am trying to use "declare" in a stored procedure. I am getting a syntax error not sure why, any help appreciated. Here's the code :-
ALTER PROCEDURE [dbo].[TOTALCOUNT]
@StartDate DateTime,
@EndDate DateTime
AS
BEGIN
SET NOCOUNT ON;
DEclare @TOTALPEOPLE int...
'[' was a typo. pls ignore.
Query: SELECT COUNT(D1.*) AS [Col1] FROM Database1 AS D1
INNER JOIN Database2 AS D2 ON D1.CoL1 = D2.CoL1
Same error.
thank you.
Here's the modified query minus the '[' bracket
Query: SELECT COUNT(D1.*) AS [Col1] FROM Database1 AS D1
INNER JOIN Database2 AS D2 ON D1.CoL1 = D2.CoL1
Hi,
I am trying to do the following query and I get a Syntax error
Query: SELECT COUNT[D1.*) AS [Col1] FROM Database1 AS D1
INNER JOIN Database2 AS D2 ON D1.CoL1 = D2.CoL1
Error: incorrect syntax near '*'
What am I missing.
Thank you.
Can I use "IF" in a Select stmt e.g.
SELECT Db1.Value1, IF (Db1.Value2 != 'good','bad','ok') FROM Database1 as Db1
I am getting a syntax error on IF
any help appreciated.
Hi,
I need to move a SQL server 2005 database nearly 9 GB to another machine on a different domain.
What is the best way to do this ?
I tried taking a backup then do a restore on the new machine and it failed with an "Access denied error".
thanks for your help.
I am new to t-SQL and was looking for some help.
Is there a way to display a "space" or Null value in a column when no data is returned for a query.
E.g. If I run the query below
SELECT EMPNAME, EMPMIDDLE Where EMPName='bob'
When I run this query and if there is no Empname as 'bob' then at...
Can anybody tell me what is the best way to change the attribute value on a particualar node in a axml file ?
Thank you.
<Vehicle>
<Cars>
<Hybirds id='Toyota' cost='2500'>Available</Hybrids>
<Hybrids id='Honda' cost='3500'>Available</Hybrids>
</Cars>
I want to change the value for cost where...
Hi,
I am new to TSQL and have a problem with temp tables
CREATE TABLE #TCOUNT( PASSED INT, FAILED INT )
INSERT INTO #TCOUNT(PASSED,FAILED)
VALUES (SELECT count(ID) FROM ExamResults er
WHERE (er.[lastresult] = @mark1)
AND ( er.[curresult] = @mark3 or er.curresult= @mark4 or er.[curresult]...
Has anybody used C# to register for Windows device events?
I am trying to capture "CMP_WaitNoPendingInstallEvents" is there a way to do this in in C#.
Any help appreciated.
I have a similar problem I am trying to return an integer
<CODE>
ALTER PROC [dbo].[sp_CheckIDExists]
(
@id varchar(30),
@RETURNVALUE int OUTPUT
)
AS
If (@id) Is NULL return 1
If EXISTS(SELECT ID FROM dbo.v_CI_DRIVERINFO WHERE ID= @id)
@RETURNVALUE = 0
Else
@RETURNVALUE = 1
return...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.