This is my code:
Set @ID = '11'
Set @Dest = C:\data.xls
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0; Database=@Destination ;',
'Select tab1,tab2 FROM [Sheet1$]')
select tab1,tab2 from dbo.mytable
where ID = @ID
)
I need to pass this @Dest, @ID
dynamically since I have multiple files to load.
Iam getting error when I do this
Is this Possible..?
Thanks for your help...!!