Use "WITH RESULT SETS" to predefine the returned data set:
SELECT *
FROM OPENROWSET ('SQLOLEDB','SERVER=(MySQLServer);TRUSTED_CONNECTION=YES;',
'EXEC USP_MyStoredProcedure
WITH RESULT SETS
(
(
FirstName VARCHAR(60) NULL,
LastName VARCHAR(60) NULL,
Title VARCHAR(35) NULL,
Department VARCHAR(31) NULL,
Age INT NULL
)
)')
No comments:
Post a Comment