Tuesday, March 20, 2012

Open Query

Kudos to y'all!!! In the syntax...

SELECT * FROM OPENQUERY (linked server name, 'SQL Syntax')

...I'm having problems with the " ' " symbol. The SQL Syntax inside the OPENQUERY has a condition in the WHERE clause that has to be enclosed in apostophes. If it's a numeric value, I think that it doesn't need to be enclosed in apostrophes. But because the values are letters, it has to be enclosed in apostrophes. is there any way to work around this problem? I'm fetching data from an Oracle linked server by the way......I'm having problems with the " ' " symbol. ...

try enclosing the single quote in ' and '

like '''

hope this helps|||'select * from <table_name> where <column_name> = ''<string value>'' '|||try with 4 singlequotes on 2 sides,it works
pavan.

No comments:

Post a Comment