July 16, 2008 at 5:22 am
Hi,
I have text file having 2000 rows. These rows may start with 'Msg' or 'Bulk' values. This is the error output file from sql.
I want to read this and insert rows starting with 'Msg' into a table in sql.
I am trying this in sql only. Bulk insert will not work for this scenario, since we can't check the row starting value.
Please suggest ur ideas if anyone faced this.
Thanks,
Peer Md.
July 16, 2008 at 6:03 am
One method is to use the OPENROWSET command to read the data and then filter the records out of this query. Another alternative that you don't seem to want is to use BULK LOAD to load all of the records into a table and then process the data out of the "stage" table to fetch the desired records. You might also want to consider creating an SSIS package to import your data.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy