Click here to Skip to main content
15,888,157 members
Home / Discussions / Database
   

Database

 
AnswerRe: Top 5 Records Pin
Ashfield21-May-08 4:41
Ashfield21-May-08 4:41 
QuestionRow Terminator not working: Pin
Shahzad.Aslam21-May-08 3:06
Shahzad.Aslam21-May-08 3:06 
AnswerRe: Row Terminator not working: Pin
Ashfield21-May-08 4:36
Ashfield21-May-08 4:36 
GeneralRe: Row Terminator not working: Pin
Shahzad.Aslam21-May-08 4:40
Shahzad.Aslam21-May-08 4:40 
GeneralRe: Row Terminator not working: Pin
Ashfield21-May-08 21:19
Ashfield21-May-08 21:19 
GeneralRe: Row Terminator not working: Pin
Shahzad.Aslam21-May-08 21:41
Shahzad.Aslam21-May-08 21:41 
GeneralRe: Row Terminator not working: Pin
Ashfield21-May-08 22:28
Ashfield21-May-08 22:28 
QuestionSql Stored Procedure Pin
senthilsstil20-May-08 23:58
senthilsstil20-May-08 23:58 
Hi Friends,
I am updating and inserting excel datas from sql stored procedure

alter PROCEDURE SP_ExcelMan @File_Name as varchar(50) = ''
AS
BEGIN
SET NOCOUNT ON

DECLARE @Cmd varchar(1000)
DECLARE @fn varchar(500)
DECLARE @provider varchar(100)
DECLARE @ExcelString varchar(100)

-- New File Name to be created
IF @File_Name = ''
Select @fn = 'D:\Test.xls'
ELSE
Select @fn = 'D:\' + @File_Name + '.xls'

-- FileCopy command string formation
SELECT @Cmd = 'Copy D:\Template.xls ' + @fn

-- FielCopy command execution through Shell Command
EXEC MASTER..XP_CMDSHELL @cmd, NO_OUTPUT

-- Mentioning the OLEDB Rpovider and excel destination filename
set @provider = 'Provider=Microsoft.Jet.OLEDB.4.0'
set @ExcelString = 'Excel 8.0;HDR=Yes;Database=' + @fn

-- Executing the OPENROWSET Command for copying the select contents to Excel sheet.
exec('insert into OPENrowset(''' + @provider + ''',''' + @ExcelString + ''',''SELECT FirstName,LastName,Phone,Address,City,State,Zip FROM [Sheet1$]'')
select au_fname as FirstName,au_lname as LastName,phone,address,city,State,Zip from authors')

exec('insert into OPENrowset(''' + @provider + ''',''' + @ExcelString + ''',''SELECT StoreId, OrderNo, OrderDate, Quantity FROM [Sheet2$]'')
select stor_id as StoreId,Ord_Num as OrderNo,Ord_Date as OrderDate,qty as Quantity from sales')

SET NOCOUNT OFF
END

But i am getting the error
Could not locate registry entry for OLE DB provider 'Provider=Microsoft.Jet.OLEDB.4.0'.
OLE DB error trace [Non-interface error: Provider not registered.].

Please help me to clear the error

Thanks in Advance
Questionhow to retrive the value of the sp output through execute immediate Pin
lakshmichawala20-May-08 23:08
lakshmichawala20-May-08 23:08 
Questionsql query Pin
Unknown Ajanabi20-May-08 23:02
Unknown Ajanabi20-May-08 23:02 
AnswerRe: sql query Pin
Colin Angus Mackay21-May-08 1:01
Colin Angus Mackay21-May-08 1:01 
AnswerRe: sql query Pin
Michael Potter21-May-08 10:23
Michael Potter21-May-08 10:23 
Questionproblem with SQLparameter? Pin
Mr.Kode20-May-08 22:20
Mr.Kode20-May-08 22:20 
AnswerRe: problem with SQLparameter? Pin
Unknown Ajanabi20-May-08 23:17
Unknown Ajanabi20-May-08 23:17 
GeneralRe: problem with SQLparameter? Pin
Mr.Kode20-May-08 23:20
Mr.Kode20-May-08 23:20 
GeneralRe: problem with SQLparameter? Pin
Unknown Ajanabi20-May-08 23:50
Unknown Ajanabi20-May-08 23:50 
AnswerCP Ignore Pin
leckey21-May-08 3:20
leckey21-May-08 3:20 
Questiondistinct? Pin
laserbaronen20-May-08 21:40
laserbaronen20-May-08 21:40 
AnswerRe: distinct? Pin
Blue_Boy20-May-08 22:47
Blue_Boy20-May-08 22:47 
QuestionRe: distinct? Pin
laserbaronen20-May-08 22:51
laserbaronen20-May-08 22:51 
AnswerRe: distinct? Pin
Blue_Boy20-May-08 22:53
Blue_Boy20-May-08 22:53 
GeneralRe: distinct? Pin
laserbaronen20-May-08 23:02
laserbaronen20-May-08 23:02 
GeneralRe: distinct? Pin
Blue_Boy20-May-08 23:19
Blue_Boy20-May-08 23:19 
GeneralRe: distinct? Pin
laserbaronen20-May-08 23:31
laserbaronen20-May-08 23:31 
GeneralRe: distinct? Pin
Blue_Boy20-May-08 23:32
Blue_Boy20-May-08 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.