Both Greg and I don't shy for typing CREATE TABLE statements. But, yes, for 255+ columns, it can be a bit daunting.
I assume that the Excel file has header row. Copy this row into a query window. Press Ctrl-H and click the .*
button to replace regular expressions. The enter \t
for Find and then for Replace enter nvarchar(200),\n
. Slap a CREATE TABLE #Temp around this.
Then run:
BULK INSERT #Temp FROM 'C:\temp\YourCSVfile.csv'
WITH (FORMAT = "CSV", FIELDTERMINATOR=",", FIRSTROW = 2)
Once you have the data in a table, you can check the columns and use ALTER TABLE ALTER COLUMN to change data types etc.
The advantage with using BULK INSERT is that it saves from you producing a format file.