troubleshooting Question

count

Avatar of shilpi2
shilpi2 asked on
Microsoft AccessMicrosoft SQL Server
3 Comments1 Solution391 ViewsLast Modified:
hi experts,

I am trying to count the rows in a table and assign the count to a variable.
I am getting an error in this case.
says that:

Server: Msg 170, Level 15, State 1, Procedure IDX_Daily_Security_Dollars_Earned_Calc_Strategy, Line 98
Line 98: Incorrect syntax near '@a'.

declare @a int
SELECT COUNT(StartDate) into @a FROM #TEMP_All_Dates 
if @a=1
begin
insert into #TEMP_All_Dates(StartDate) values (null)
end
ASKER CERTIFIED SOLUTION
sventhan

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros