Click here to Skip to main content
11,710,472 members (83,326 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 21-Feb-13 23:57pm
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 Sergey Alexandrovich Kryukov 549
1 OriginalGriff 255
2 Peter Leow 154
3 Maciej Los 120
4 Abhinav S 120
0 Maciej Los 95
1 Richard MacCutchan 90
2 Abhinav S 90
3 OriginalGriff 80
4 Member 4653839 50


Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | 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