Re: SQL Server and IDS
Posted in 2006
select @sql="some dynamic query with parameters" exec sql example using openquery: select @sql = 'select * from openquery(<linked server>, ''SELECT col1, col2, col3, ...... FROM tabname WHERE col1 = "' + @<somevariable> + '"'')' /* insert into a temp table with results from the remote command */ INSERT INTO #temptable EXEC sp_executesql @sql You could substitute the openquery with a four part naming convention and execute the @sql variable. Four part naming is generally slower than openquery but I only believe on the connecting side. "Keith Simmons" <smiley73@googlem ail.com> To Sent by: informix-list@iiug.org informix-list-bou cc nces@iiug.org Subject SQL Server and IDS 09/28/2006 10:02 AM My application programmers have a requirement to run parametised queries from SQL Server/Access against an IDS 9.4 engine on AIX. Using IBM ODBC drivers isn't working as SQL Server seems to insist on pulling entire tables back and filtering itself. openquery() is not an option as its queries cannot be parametised or built 'on the fly'. Anyone encountered a similar problem? How did you reslove it, any product known that handles this type of connection more gracefully allowing IDS to do its work and just return the results of a query? Keith _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list