I am trying to import a zip code file into my SQL database. The file that I am importing is of type .txt to a zip code table that I have already created within the database. The T-SQL statements below should import the data to the table, but if you look at the error message below I do not have permission to run BULK INSERT. BULK INSERT ZipCode FROM "C:\temp\zipcodes.txt" WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO The error that I am receiving is: Msg 4834, Level 16, State 4, Line 7 You do not have permission to use the bulk load statement. I'm thinking that I may need to be logged in as the sa for this statement to work is this correct? If so can someone walk me through the steps to connect with management studio as a sa user. Thanks Shawn
You can't use BULK INSERT. Most shared hosts don't allow those kinds of operations for performance and/or security reasons.
Thank for the feedback Hank. Do you have any ideas on how to upload a text file to a SQL table without using BULK INSERT?
You could try SQLBulkCopy: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy(VS.90).aspx
I was able to accomplish this table import to your SQL database by using the example you published back in Aug 2009 within the Site Programming, Development and Design forum: "Publishing your SQL 2008 database to the Winhost SQL 2008 Server" Thanks