Viewing 5 posts - 1 through 5 (of 5 total)
Heres the stored proc I created to do generic dynamic openquery selects...
CREATE PROCEDURE [dbo].[LinkedServerQuery]
(
@LinkedServerName varchar(50),
@sql varchar(max)
)
AS
BEGIN
DECLARE @LinkedSQL varchar(max)
SET @LinkedSQL = 'SELECT * FROM OPENQUERY(' + @LinkedServerName + ','''+...
July 8, 2010 at 4:54 am
What happens if you add to the end...
where products_id = a.products_id
July 8, 2010 at 2:40 am
Nice one. That approach worked well against my linked server. I'll create a function to do the same but will probably escape out those single quotes with another character. They...
July 8, 2010 at 2:24 am
If that works, thats even simpler than my solution. I'm sure I tried similar before I went down the extended stored proc route but failed miserably. Will give it a...
July 8, 2010 at 1:22 am
A late reply but I have done this recently. The problem is that you can only use static strings in openquery, not one that has been dynamically built up.
I got...
July 8, 2010 at 1:00 am
Viewing 5 posts - 1 through 5 (of 5 total)