Hi I have bulk of data in excel sheet i should enter that data into sql database the problem is in sql database i have data before only before inserting the data is should check and enter and the excel sheet data should go for three different tables how to that please help me
Create a working table to import the data to, then split the data to the three tables as appropriate.
You can also use BULK INSERT OR OPENROWSET, something like this:
USE YourDatabase Go sp_configure 'show advanced options', 1 GO RECONFIGURE GO sp_configure 'Ad Hoc Distributed Queries', 1 GO RECONFIGURE
SELECT * INTO tblImport FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml;HDR=YES;Database=C:\testdata.xlsx;', 'SELECT * FROM [Sheet1$]')