I am looking for a stored procedure code that will open a text file, read in several thousand lines, and add the code to a table in the database. Is there a simple way to implement this in T-SQL?
I would recommend looking at using SSIS. It's designed to do this sort of thing (especially if you need to do it on a regular basis).
Here is a good link that goes over reading a text file and inserting into the DB.