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
 SQL Server Development (2000)
 OPENQUERY

Author  Topic 

PETEJ
Starting Member

8 Posts

Posted - 2001-03-27 : 06:51:18
Hi, I'm struggling with OPENQUERY to pass a declared parameter into the WHERE clause of the Passthrough Query ? I have tried the usual routes of ''' + myVar + ''''), adding & removing ''s ,etc but I keep getting 'incorrect Syntax' errors. Is what I'm attempting to do possible, if so, any pointers ? Code sample below.

- Thanks


Select * from OPENQUERY(MYSVR, 'SELECT MCD_ADD1,MCD_ADD2 FROM dbo.CC_MCD WHERE MCD_DOB = ''' + @DOB + '''')




   

- Advertisement -