|
Posted by Erland Sommarskog on 01/09/07 22:37
(cabrenner@optonline.net) writes:
> INSERT INTO tbl_ups_eInvoice_tmpData Select GFF.*
> FROM OPENROWSET(
> 'Microsoft.Jet.OLEDB.4.0',
> ' + @strConnect + ';'admin';'',
> 'Select * FROM tbl_ups_eInvoice_tmpData'
> ) as GFF
>
> Set @btSuccess = 1
>
> END
>
> Does OPENROWSET not allow a variable to be used?
No. Either you have to use dynamic SQL, or define a linked server on the
fly. The former is probably simpler. Look at
http://www.sommarskog.se/dynamic_sql.html#OPENQUERY for a similar example
on how to deal with the nested strings.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|