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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 multi part identifier

Author  Topic 

koolnkool
Starting Member

9 Posts

Posted - 2009-10-09 : 06:21:33
how to send multipart identifier like xyz@gmail.com to sql query.

i have constructed a query in c# like this:

sring query = "select * from x where x,id = xyz@gmil.com"

but when i used to run it,it is throwing the error,
multipart identifier "xyz@gmail.com" could not boubd

why?

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-10-09 : 06:26:15
Use single quotes around the value:
sring query = "select * from x where x.id = 'xyz@gmil.com'"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-09 : 06:54:35
Better you use parameter instead

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -