Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
CREATE PROCEDURE dbo.StaffPayment_ddl_Groupname
	
AS
		select * from Groups  where  GroupId IS NOT '7'

	RETURN


this will give me error : Incorrect Syntax near '7'
what is problem..
Posted
Comments
phil.o 22-Feb-13 6:10am    
What is the type of the GroupId column ?

HI,

Change your code to like the following:

SQL
CREATE PROCEDURE dbo.StaffPayment_ddl_Groupname

AS
BEGIN
        select * from Groups  where  GroupId <> '7'

END



Thanks
 
Share this answer
 
Comments
Member 9511889 22-Feb-13 6:28am    
thanks..
[no name] 22-Feb-13 6:43am    
yw
Hello

Use the Not In for query.
Like

select * from Groups where GroupId NOT IN ('7')
 
Share this answer
 
Comments
Member 9511889 22-Feb-13 6:28am    
thanks..
Hi ,

Try like this also

SQL
CREATE PROCEDURE dbo.StaffPayment_ddl_Groupname
AS
BEGIN
        SELECT * FROM Groups  WHERE  GroupId NOT IN ('7')
END


:-) :-) :-)

Regards,
GVPrabu
 
Share this answer
 
Comments
Member 9511889 22-Feb-13 6:28am    
thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900