Import csv data into SQL Server Express

I am developing an asp.net mvc application. I have a very large dataset in a CSV file that I want to import into a SQL Server Express database.

What is the easiest way to solve this problem? Ideally, I just want to import data, and the table will be created automatically with specific columns and data.

+4
source share
2 answers

Mark is right, just download RTM Microsoft SQL Server 2008 R2 - Management Studio Express and import the data

+3
source

I know this is an old thread, but I figured out how to do it by accident. From the full version of SQL 2008 R2, I created a script from a database table using a wizzard script and writing data using a script. All you have to do is add several columns to the table, for example, insert the table name, etc. All this wizard creates a CSV file using commas and N for the escape character. see an example here. hope this helps someone ... btw save it as a .sql file and open it in the query window and execute it!

USE [databaseName] GO /****** Object: Table [dbo].[DrNames] Script Date: 02/06/2014 22:44:44 ******/ SET IDENTITY_INSERT [dbo].[DrNames] ON INSERT [dbo].[DrNames] ([ID], [DrName], [PreFix], [EmailAddress]) VALUES (1, N'test1 Dr Name', N'Psy.D.', N' TestDrNAme1@DrPlace.com ') INSERT [dbo].[DrNames] ([ID], [DrName], [PreFix], [EmailAddress]) VALUES (2, N'test2 Dr Name', N'Psy.D.', N' TestDrNAme2@DrPlace.com ') INSERT [dbo].[DrNames] ([ID], [DrName], [PreFix], [EmailAddress]) VALUES (3, N'test3 Dr Name', N'Ph.D.', N' TestDrNAme3@DrPlace.com ') INSERT [dbo].[DrNames] ([ID], [DrName], [PreFix], [EmailAddress]) VALUES (4, N'test4 Dr Name', N'MD', N' TestDrNAme4@DrPlace.com ') 
0
source

Source: https://habr.com/ru/post/1397857/


All Articles