Answer: Many approaches are available to import data into SQL Server. Main approaches are:
1) Import and Export Data Wizard
1.1. Import and Export Wizard tool which comes with SQL Server
1.2. Right-click on Database name --> Tasks --> Import Data option --> follow wizard
2) Using T-SQL script:
2.1. BULK INSERT
2.2. bcp command
3) Hands-on approach
Direct approach from Excel: Place data(records) in the excel and generate INSERT statements by using CONCATENATE() function in excel then run the script in SSMS
Ex: You can use CONCATENATE for the function
=CONCATENATE("INSERT INTO table VALUES(",A1,",",B1,")")
4) Using SSIS tasks
NOTE: Mostly I will use 3rd approach for master data INSERT script generation
Asked In: Many Interviews |
Alert Moderator