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
 General SQL Server Forums
 New to SQL Server Programming
 Help with Count and Raiserror

Author  Topic 

aikman
Starting Member

22 Posts

Posted - 2012-03-13 : 09:08:51
Hi,

Im new to sql transacting, and want some help.

Im trying to count one colum and if it's 2000 or less rows I would like to get an error. this is my code that doesn't work:

SELECT COUNT(*)as t from GUID
if (t is <= 2000)

Raiserror ('test',16,1)

thanks
hakan

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-13 : 09:12:32
[code]
if (select count(*) from GUID) <= 2000
begin
Raiserror('test',16,1)
end
[/code]


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

aikman
Starting Member

22 Posts

Posted - 2012-03-13 : 09:15:22
thank you very much
Go to Top of Page
   

- Advertisement -