Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OPENROWSET and the WHERE clause

Status
Not open for further replies.

JulesDBQ

Programmer
Apr 17, 2003
22
US
What type of quotes should I used around my where clause? I am getting an invalid column name when I use single quotes - I know it is because of hte quotes around the select statment...but I am not sure what to do. Please advise...Thanks.

SELECT a.*
FROM OPENROWSET('SQLOLEDB','warehouse.oas.psu.edu';'test';'TestFree',
'SELECT lname, fname from people where lname ='smith'(..blah blah..blah) AS a
 
Generally that depends on server/RDBMS OPENROWSET() is referring to. And that is... another SQL Server? Then replace al 's with ''s.

------
[small]<this is sig>
select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')
</this is sig>[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top