Thanks a lot for your suggestions, i loaded the file into a staging table and then used a cursor to load into my final table. Below is the code:
DECLARE @_sqlcommand varchar(511) DECLARE my_cursor CURSOR FOR SELECT Script from dbo.stg OPEN my_cursor; -- Perform the first fetch. FETCH NEXT FROM my_cursor INTO @_sqlcommand; -- Check @@Fetch _STATUS to see if there are any more rows to fetch. WHILE @@Fetch _STATUS = 0 BEGIN exec sp_executesql @_sqlcommand -- This is executed as long as the previous fetch succeeds. FETCH NEXT FROM my_cursor INTO @_sqlcommand ; END CLOSE my_cursor; DEALLOCATE my_cursor