469,307 Members | 1,796 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

Incorrect syntax near the keyword 'current' ?

gopgally
I am new for sql server so please help me....


Expand|Select|Wrap|Line Numbers
  1. select barcode,current, rec retail, sellPrice from products
  2.  
Aug 10 '10 #1
4 5310
gpl
152 100+
The column 'rec retail' has a space in, the parser does not recognise this so shows the error.

Try this
Expand|Select|Wrap|Line Numbers
  1. select barcode,current, [rec retail], sellPrice from products 
Aug 10 '10 #2
NeoPa
32,173 Expert Mod 16PB
That is another problem. The error message you are getting (Please post it in the body of the question in future) indicates that Current is a reserved word (Keyword) and should not generally be reused as a field name. If you have a table with it then you should use the following syntax :
Expand|Select|Wrap|Line Numbers
  1. SELECT [BarCode]
  2.      , [Current]
  3.      , [Rec Retail]
  4.      , [SellPrice]
  5. FROM   [Products]
Welcome to Bytes!
Aug 10 '10 #3
Hi
Thank you for your code and idea...
code worked perfectly
Aug 10 '10 #4
NeoPa
32,173 Expert Mod 16PB
We're very pleased to have helped I'm sure :)
Aug 11 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jeff Magouirk | last post: by
11 posts views Thread by Mark Findlay | last post: by
2 posts views Thread by ielmrani via SQLMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.