November 26, 2018 at 9:28 am
WHT DOES THIS--
select top 1 a.* into #t
from openrowset('SQLNCLI', 'Server=localhost;Trusted_Connection=yes;','SET NOCOUNT ON;SET FMTONLY OFF; RESTORE HEADERONLY FROM DISK = N''C:\Stage.bak''') AS a;
CAUSE THIS ERROR--
Msg 11527, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1 [Batch Start Line 39]
The metadata could not be determined because statement 'RESTORE HEADERONLY FROM DISK = N'C:\Stage.bak'' does not support metadata discovery.
AND WHAT IS NEEDED TO MAKE THAT STATEMENT WORK ?
November 26, 2018 at 9:39 am
Why are you using OPENROWSET to do this and not issuing the commands directly?
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
November 26, 2018 at 2:34 pm
Phil Parkin - Monday, November 26, 2018 9:39 AMWhy are you using OPENROWSET to do this and not issuing the commands directly?
Heh... probably because he doesn't want to take the time to figure out how to define a properly defined target table.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2018 at 2:35 pm
Budd - Monday, November 26, 2018 9:28 AMWHT DOES THIS--
select top 1 a.* into #t
from openrowset('SQLNCLI', 'Server=localhost;Trusted_Connection=yes;','SET NOCOUNT ON;SET FMTONLY OFF; RESTORE HEADERONLY FROM DISK = N''C:\Stage.bak''') AS a;CAUSE THIS ERROR--
Msg 11527, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1 [Batch Start Line 39]
The metadata could not be determined because statement 'RESTORE HEADERONLY FROM DISK = N'C:\Stage.bak'' does not support metadata discovery.AND WHAT IS NEEDED TO MAKE THAT STATEMENT WORK ?
It won't work. I've tried the same thing in the past. You'll need to properly define a target table and then use INSERT/EXEC.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply