Du kan inte parametrisera OPENROWSET (eller OPERNQUERY etc). Endast konstanter.
Declare @Var = 'C:\myPC.file';
Declare @SQL varchar(1000);
SET @SQL = 'SELECT * FROM OPENROWSET(BULK ''' + @Var + ''', SINGLE_BLOB)';
EXEC (@sql)
Du kan inte parametrisera OPENROWSET (eller OPERNQUERY etc). Endast konstanter.
Declare @Var = 'C:\myPC.file';
Declare @SQL varchar(1000);
SET @SQL = 'SELECT * FROM OPENROWSET(BULK ''' + @Var + ''', SINGLE_BLOB)';
EXEC (@sql)