Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have large amont of data in excel sheet .i want to insert that data in sql database.
excel sheet contain 1000 records .
i write code for it.
what data type i choose in sql to allow all type of data like spaces,special character ,numbers, and characters
Posted
Comments
Shemeer NS 1-Jul-12 11:23am    
you wanted to save the excel file in database or all the values in tabular format ?
Ritu khatri 1-Jul-12 12:39pm    
yes
Shemeer NS 1-Jul-12 13:12pm    
I have added a solution, mark it as solution if it resolved your issue
Herman<T>.Instance 1-Jul-12 11:34am    
why don't you use the SSMS import wizard?
Ritu khatri 1-Jul-12 12:40pm    
what is this i dont know about it.

If you need a fast way, you can use SqlBulkCopy its fast and I believe it will solve your purpose. Check out the article for SqlBulkCopy over here[^].
 
Share this answer
 
First thing you need to create a table for the excel data to import

If you are not sure about the data then create columns with data type as
SQL
VARCHAR(MAX)
or else the choose the appropriate data types as per the Value in the excel cell.

you can import this data using DTS Package for SQL Server 2000 or SSIS for SQL Server 2005 and above or else you can create a macro in excel file that will insert the data to the table and also you can do this in c# also..

You can refer SSIS
DTS
 
Share this answer
 
please see this discussion: import MS Excel to datatable[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900