Last active
May 18, 2017 21:48
-
-
Save sbealer/8663a0cbc896ade44ce55ea1ef844aa1 to your computer and use it in GitHub Desktop.
Import csv into SQL Server without need of format file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO [YOURLINKEDSERVER].[YOURDB].[DBO].YOURTABLE | |
SELECT | |
* | |
,cast('2017-05-20' as date) | |
FROM OPENROWSET('MSDASQL' | |
, 'Driver={Microsoft Access Text Driver (*.txt, *.csv)}; | |
DBQ=C:\first_directory\second_directory\' | |
, 'select * from "your_file.csv"') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment