Alexandre Simões
asked on
OPENROWSET and EXEC...
Hi, I'm using SQL SERVER 2005...
is it possible to use OPENROWSET with a EXEC command?
Something like:
SELECT *
FROM OPENROWSET('SQLOLEDB','loc alhost';'s a';'P@ssw0 rd',
'sp_executeSQL N''MyDataBase..sp_GetMyDat a 2008, null, 4'' ') TblA
Strangely enough (or not) this doesn't work :)
Is it possible to make it work?
Thanks,
Alex
is it possible to use OPENROWSET with a EXEC command?
Something like:
SELECT *
FROM OPENROWSET('SQLOLEDB','loc
'sp_executeSQL N''MyDataBase..sp_GetMyDat
Strangely enough (or not) this doesn't work :)
Is it possible to make it work?
Thanks,
Alex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just happened across this, and thought you might like to see how :
select * from openrowset('SQLNCLI', 'Server=MY_SVR_NAME;Truste d_Connecti on=yes;',' EXEC MY_DB_NAME..USP_MY_SP null,null,null,null') a
Now, it will fail unless the stored procedure does have a predefined (ie at create sp time) list of columns. It is quite "sensitive" (read fussy).
select * from openrowset('SQLNCLI', 'Server=MY_SVR_NAME;Truste
Now, it will fail unless the stored procedure does have a predefined (ie at create sp time) list of columns. It is quite "sensitive" (read fussy).
ASKER
We ended using a different approach at the business level so ended up not needing this.
I'm accepting it as it could be a cause.
Thanks,
Alex