robsuttonjr
MIS
I am using the openquery function in query analyzer. I have a working query that I would like to use a variable in. I have tried using standard aprroaches but I can't figure out how to get it to work. I tried passing @ variables like in stored procedures. So the question is once I say olap_server, it expects a string but I can't figure how to do variable substitution. Tried " lll" +@Variable etc. Here is a snipet of my code:
SELECT * FROM OPENQUERY(olap_server, @Start]+ [@ItemId]+ ', [Items].[Item Sku] ) }...etc
SELECT * FROM OPENQUERY(olap_server, @Start]+ [@ItemId]+ ', [Items].[Item Sku] ) }...etc