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 2000 Forums
 Transact-SQL (2000)
 Error in select statement

Author  Topic 

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-02-15 : 13:45:39
Hi All,

I am using this select statement as a part of a stored procedure.

SELECT distinct dbo.Inquiries.InquiryID, dbo.Inquiries.InquiryDate, dbo.ACCOUNTS.[NAME], dbo.[AccountItems].[Model], dbo.[Account Items].[ID], dbo.Customers.ContactFirstName+" "+dbo.Customers.ContactLastName as CustomerName, dbo.Customers.PhoneNumber, dbo.Inquiries.[Inquiry Method]

From .....remaining query

An error is coming on running this procedure as
Invalid column name ' '.

It is coming in the Select statement
I am not able to find out the cause.
Can anyone please help me in this?
thanks

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-02-15 : 13:56:04
Change this:
+" "+
to
+' '+



CODO ERGO SUM
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-02-15 : 13:59:39
Thanks.
It is working now.
Can you please tel me, what is the concept in changing " " to ' '

Thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-15 : 14:17:17
To avoid the error!

If you want to use double quotes, then you need to use the QUOTED_IDENTIFIER option.

Tara Kizer
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-02-15 : 14:32:46
Thanks
Go to Top of Page
   

- Advertisement -