Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SP Syntax

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2006-09-11 : 13:58:49
I have the following:

CREATE proc rs_sicsummary
@state varchar(50),
@month int

as

SELECT TOP 10 SicID, SicDescription AS [SIC Category], COUNT(*) AS [Total # Account with Sicid], SUM([Account Market Value])
AS [Account Total Market Value], monthend
FROM SnapsRaw
WHERE (Branchstate = @state) AND (SicID <> '00') AND (SicID <> '99') AND monthend = @month
GROUP BY SicID, SicDescription, MonthEnd
ORDER BY [Account Total Market Value] DESC
GO

when i run the following:

exec RS_sicsummary 'Arizona' '20060801'

i get

Line 1: Incorrect syntax near '20060801'.

new to writing SP's please bare with me

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-09-11 : 14:01:57
you are missing a <comma> between your input parameters when you exec the procedure

Be One with the Optimizer
TG
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2006-09-11 : 14:02:49
YOU DA MAN TG, I SUPPOSE IF I READ SOME DOCS I WOULD OF CAUGHT THAT>
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-09-11 : 14:06:28

What a refreshing change to have someone post all the necessary information to solve a problem.

>>I SUPPOSE IF I READ SOME DOCS I WOULD OF CAUGHT THAT
Books Online...the other white meat

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -