SemperFiDownUnda
Instructor
I've got a Sybase 12.5 server linked to our SQLServer 2000 and need to pass slightly dynamic queries to that server
Problem is that OPENQUERY(linkedServer,'query')
doesn't let me concatinate string for the 'query'
ie I can't do
[COLOR=#80000]
[/color]
OPENQUERY doesn't even like having this
[COLOR=#80000]
[/color]
I'm missing something because I'm almost positive I've done this before but senility is setting in.....SQLSister HELP ME!
Hope I've been helpful,
Wayne Francis
If you want to get the best response to a question, please check out FAQ222-2244 first
Problem is that OPENQUERY(linkedServer,'query')
doesn't let me concatinate string for the 'query'
ie I can't do
[COLOR=#80000]
Code:
SELECT *
FROM OPENQUERY(Sybase001,'SELECT FirstName, LastName FROM blah WHERE StartDate = ''' + CONVERT(CHAR(11),@StartDate,106) + ''' AND EndDate IS NULL')
OPENQUERY doesn't even like having this
[COLOR=#80000]
Code:
DECLARE @sSQL VARCHAR(4000)
SELECT @sSQL = 'SELECT FirstName, LastName FROM blah WHERE StartDate = ''' + CONVERT(CHAR(11),@StartDate,106) + ''' AND EndDate IS NULL'
SELECT * FROM OPENQUERY(Sybase001,@sSQL)
I'm missing something because I'm almost positive I've done this before but senility is setting in.....SQLSister HELP ME!
Hope I've been helpful,
Wayne Francis
If you want to get the best response to a question, please check out FAQ222-2244 first