|
|
SQL Server Excel Workbench
Last post 11-18-2011, 3:11 AM by swapnajeet. 131 replies.
-
12-12-2007, 5:52 AM |
-
uriol17
-
-
-
Joined on 12-12-2007
-
-
-
-
|
Problems with spExecute_ADODB_SQL
Hi,
I have a problem using spExecute_ADODB_SQL. I don´t have problems creating the excel file and insert into with values. But when I try to insert into with a select of a sql table like this
spExecute_ADODB_SQL @DDL='insert into Excel(code,Description) SELECT Code,Description FROM Table', @DataSource ='c:\excel.xls'
the programs returns me an error because the database is open or the object is only read.
I don´t understand whats happen because with value I can write in the excel file
Sorry for my bad english and thanks for all.
|
|
-
12-19-2007, 11:26 PM |
|
|
Hi, I am new to T-SQL. How can i have two sheets with different data in the same workbook created at 'C:\MyPubDatabase.xls'. I need to have different sets of records in that?
|
|
-
12-20-2007, 10:27 AM |
-
-
01-09-2008, 12:42 PM |
|
|
I cannot read from the spreadsheet - whether I link the spreadsheet as a linked server or not I get the same error:
Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error. Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
|
|
-
01-23-2008, 3:54 PM |
-
02-11-2008, 3:46 PM |
|
|
Sending the file as an attachment from within the proc.
Hello, As the many previous posts declared... This is an awesome article. Thanks for posting it. I have many automated routines on multiple servers that currently use ActiveX scripts to write to the .xls files. I will be migrating to this as time permits. I have one question for you though. I was unable to email the file from the same sp that builds the .xls. The file is not unlocked until the sp completes. It was easy enough to combat this by creating a 2nd proc to use as an additional step in the job, but I'd sure like to know how to release the file and mail it from the same proc. Any input would be much appreciated. Thanks again! Bob.
...this shows the basic mail sql I'm using. if @cnt > 0 BEGIN EXEC msdb.dbo.sp_send_dbmail @profile_Name = N'default', @recipients= @distList, @body= @bodyText, @subject = @SubjectText, @file_attachments = 'C:\Mail.Files\ServiceCalls.xls' END
|
|
-
02-13-2008, 5:43 AM |
|
|
Hi Terrie,
I encountered the same problem. If your column count is 26 then 26 % 26 = 0 which nets an empty string from the alphabet.
I got around this by creating a small function to build the cell reference. In it it checks for column numbers that are evenly divided by 26 and sets the value to 'Z'.
|
|
-
02-13-2008, 5:48 AM |
|
|
At one point during testing I received an error that caused my test procedure to fail.
Now when I run it sp_OACreate returns the error "Server execution failed" when trying to create the excel.application object. Could it be because the object already exists? If so, how do I delete the object? I figure that I could call sp_OADestroy, but I don't know the object's ID.
Any ideas?
Thanks!
|
|
-
02-13-2008, 7:22 AM |
|
|
At one point during testing I received an error that caused my test procedure to fail.
Now when I run it sp_OACreate returns the error "Server execution failed" when trying to create the excel.application object. Could it be because the object already exists? If so, how do I delete the object? I figure that I could call sp_OADestroy, but I don't know the object's ID.
Any ideas?
Thanks!
|
|
-
02-13-2008, 7:22 AM |
|
|
At one point during testing I received an error that caused my test procedure to fail.
Now when I run it sp_OACreate returns the error "Server execution failed" when trying to create the excel.application object. Could it be because the object already exists? If so, how do I delete the object? I figure that I could call sp_OADestroy, but I don't know the object's ID.
Any ideas?
Thanks!
|
|
-
02-20-2008, 10:53 AM |
|
|
I have 25 columns in my excel which is the second row in the excel. I have merged column comprising of 3-4 columns so like wise 7 columns as the 1st row. How can I suggest SSIS that 2ns row in the header or column names? Also is there any way using SSIS that I can refer to specific cell in the excel?
|
|
-
02-25-2008, 3:34 PM |
|
|
Hello, Too much of a good stuff here but you know we are all hungry for more. This one --you could drop it again! spExecute_ADODB_SQL @DDL='drop table CambridgePubs', @DataSource ='c:\CambridgePubs.xls' Does not seem to work, I get error. I want to remove the excel tab from the workbook then I can re-create it. Doing it this way let me keep the rest of the workbook intact and populate the tab I re-create from cell A2. I can create the tab, I cannot just delete it. Is that possible?
|
|
-
02-25-2008, 4:01 PM |
|
|
Hello, Too much of a good stuff here but you know we are all hungry for more. This one --you could drop it again! spExecute_ADODB_SQL @DDL='drop table CambridgePubs', @DataSource ='c:\CambridgePubs.xls' Does not seem to work, I get error. I want to remove the excel tab from the workbook then I can re-create it. Doing it this way let me keep the rest of the workbook intact and populate the tab I re-create from cell A2. I can create the tab, I cannot just delete it. Is that possible?
|
|
-
02-26-2008, 12:17 PM |
|
|
Hello, Too much of a good stuff here but you know we are all hungry for more. This one --you could drop it again! spExecute_ADODB_SQL @DDL='drop table CambridgePubs', @DataSource ='c:\CambridgePubs.xls' Does not seem to work, I get error. I want to remove the excel tab from the workbook then I can re-create it. Doing it this way let me keep the rest of the workbook intact and populate the tab I re-create from cell A2. I can create the tab, I cannot just delete it. Is that possible?
|
|
Page 5 of 9 (132 items)
... 5 ...
|
|