Wednesday, August 24, 2011

Import the Data from Excel Sheet to SQL server table



1) Fisrt I created Table in SQL

create table com(fname varchar(20),lname varchar(20))

2) I created Excel Sheet with name com.xls

3)given data below

4)i executed below script

INSERT INTO com ( fname, lname )

SELECT *

FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

'Excel 8.0;Database=C:\Documents and Settings\All Users\Documents\com.xls',

'SELECT * FROM [Sheet1$]')

Tested
======

1 comment:

  1. 1)If we change the service accounts password,will it effects the logshipping?
    2)Can I set up log shipping between servers in multiple domains?
    3)steps to failover the logshipped database?
    4)can we truncate,shrink the log file in logshipping?
    5)how will you check the logshipping status?
    6)can we setup the logshipping using local account?
    7)wht happens when we add a .mdf or .ldf file(primary database)?

    ReplyDelete