Click here to Skip to main content
11,408,708 members (63,752 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 22-Feb-13 0:57am
Comments
phil.o at 22-Feb-13 6:10am
   
What is the type of the GroupId column ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

HI,

Change your code to like the following:

CREATE PROCEDURE dbo.StaffPayment_ddl_Groupname
 
AS
BEGIN
        select * from Groups  where  GroupId <> '7'
 
END


Thanks
  Permalink  
Comments
Member 9511889 at 22-Feb-13 6:28am
   
thanks..
sisirp88 at 22-Feb-13 6:43am
   
yw
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hello

Use the Not In for query.
Like

select * from Groups where GroupId NOT IN ('7')
  Permalink  
Comments
Member 9511889 at 22-Feb-13 6:28am
   
thanks..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi ,

Try like this also

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

Smile | :) Smile | :) Smile | :)

Regards,
GVPrabu
  Permalink  
Comments
Member 9511889 at 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)

  Print Answers RSS
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 284
2 Maciej Los 155
3 Peter Leow 140
4 PIEBALDconsult 130
0 Sergey Alexandrovich Kryukov 8,626
1 OriginalGriff 6,855
2 Maciej Los 3,322
3 Abhinav S 3,238
4 Peter Leow 3,034


Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100