Got a complex SELECT query, from which I would like to insert all rows into a table variable, but T-SQL doesn\'t allow it.
Along the same lines, you c
OK, Now with enough effort i am able to insert into @table using the below :
INSERT @TempWithheldTable SELECT
a.SuspendedReason, a.SuspendedNotes, a.SuspendedBy , a.ReasonCode FROM OPENROWSET( BULK 'C:\DataBases\WithHeld.csv', FORMATFILE = N'C:\DataBases\Format.txt',
ERRORFILE=N'C:\Temp\MovieLensRatings.txt' ) AS a;
The main thing here is selecting columns to insert .