Prev: Connection string at asp.net app for data mirroring
Next: SQL: Spelling out numbers to words for month
From: Heather on 11 Mar 2010 13:59 hello! here is my problem. I have built a dynamic string called @filepath as char50 i need to place it in: SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', @filePath, 'SELECT * FROM [Sheet1$]') does any one know the correct syntax??? for passing a parameter here
From: Plamen Ratchev on 11 Mar 2010 14:25 OPENROWSET does not accept variables as arguments. You have to use dynamic SQL to build your query (append the @filePath) and execute. -- Plamen Ratchev http://www.SQLStudio.com
From: Heather on 11 Mar 2010 16:56 On Mar 11, 1:25 pm, Plamen Ratchev <Pla...(a)SQLStudio.com> wrote: > OPENROWSET does not accept variables as arguments. You have to use dynamic SQL to build your query (append the > @filePath) and execute. > > -- > Plamen Ratchevhttp://www.SQLStudio.com thank you!! i wanted to avoid dynamic sql..sigh... Can i execute a dynamic sql statment within a stored procedure?
From: Plamen Ratchev on 11 Mar 2010 17:11
Heather wrote: > Can i execute a dynamic sql statment within a stored procedure? Yes. -- Plamen Ratchev http://www.SQLStudio.com |