Thursday, 17 May 2012

How to import an excel file into sqlserver 2008 using sql Query

Enable the following Configuration Feather -
sp_configure 'show advanced options', 1
reconfigure
sp_configure 'Ad Hoc Distributed Queries', 1
reconfigure 
--Query---
INSERT INTO [testkamal] ([no] ,[name])
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\kamal\test1.xls', 'select * from [Sheet1$]')

Table Partitioning in SQL Server

  Table Partitioning in SQL Server – Step by Step Partitioning in SQL Server task is divided into four steps: Create a File Group Add Files ...