Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Sunday, March 25, 2012

can I export view result to excel ?

Good morning all,

I created a view that selects the rows of the records from a table that matches where condition.
I need to export the records to excel so I could send it out...
what is the best way to do?
Please tell me detail, I don't know much about SQL 2000, still learning.

Thank you,
YanorooUse the DTS wizard (import and export data in start menu->Microsoft SQL server).

The wizard will ask you the information needed in order to complete the operation. Select the MS-Excel driver as a destination (as well as the output filename), choose the first options (export tables an views) and select your view in particular.

Shouldn't be too hard.|||yes, I was able to do that!
Thank you!

Can I disable all exporting formats but Excel worksheets?

Hi, there

Some of the reports I am generating have tens of columns so the management decides to use Excel files only.

Is there any way that for a single report (not the whole project) I can disable printing and most of the exporting options (including PDF, HTML, TXT ...) and only leave the xls files available?

Thanks a lot.

Heng

Hi hengm,

Here is a useful site http://www.exceluser.com/index.htm

sql

Thursday, March 22, 2012

Can I disable all exporting formats but Excel spreadsheets?

Hi, there

Some of the reports I am generating have tens of columns so the management decides to use Excel files only.

Is there any way that for a single report (not the whole project) I can disable printing and most of the exporting options (including PDF, HTML, TXT ...) and only leave the xls files available?

Thanks a lot.

Heng

Hi hengm,

Here is a useful site http://www.exceluser.com/index.htm

Tuesday, March 20, 2012

Can I copy a DTS Package?

The scenario:
9 db tables populated by 9 Excel Import Files via DTS.
Will I need to create a DTS package for each import? Columns are identical in all 9 - the only thing different is the destination table name and source file name.

I've had to map over 80 columns using DTS and don't want to do it for each instance!

Any help would be appreciated..1. Rightclick the DTS-package in Enterprise Manager
2. Choose "design package"
3. Make the changes you want
4. Go to menuitem "Package" and choose "Save as"
5. You now have a copy of your DTS-package|||Nice one! Cheers.|||This is not the best way -
Dude - create a table in the destination db called tblFileSource that has:
ID, SourceFile, DestinationTable, importDate

Define FileSource and DestinationTable as Global Variables in the package.
Then, the first step of you package use a Execute SQL task that will set you global Varaiables to the result of

select top 1 SourceFile, DestinationTable
from tblFileSource
where importDate is null


Then, use a Dynamic Properties Task to change the source and destination in the Data Transformation Step.

Then, after the Transformation, do another Execute SQL Task (on Success):


Update tblFileSource
Set importDate = getDate()
where SourceFile = ?

Where the ? is the global Variable FileSource.

Isn't this a more professional method - comes in handy when the number of files increases.

Sunday, March 11, 2012

can excel view drill throughs in a pivot table

I'm building pivot tables in Excel 2000 based on data cubes from SQL 2000
Analysis Services. Is there anyway to view the drill down from the data
fields in a Excel pivot table? I try doubleclicking in a data field cell
and get a message saying that I can only get detail from rows or columns.
****************************************
*********
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.noreply.yahoo.com
Please remove "noreply" before replying.
****************************************
*********Oh, the message you are receiving is because you are clicking on a cell and
Excel does not have native drillthrough capabilities. A good example of
modifying Excel (via VBA) to have drillthrough capabilities can be found at:
http://www.windowsitpro.com/SQLServ...0382/40382.html
HTH!
Denny Lee
<dennyglee_at_hotmail_dot_com>
Blog at:: http://spaces.msn.com/members/denster/
"Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
news:%23WCO5Op9FHA.808@.TK2MSFTNGP09.phx.gbl...
> I'm building pivot tables in Excel 2000 based on data cubes from SQL 2000
> Analysis Services. Is there anyway to view the drill down from the data
> fields in a Excel pivot table? I try doubleclicking in a data field cell
> and get a message saying that I can only get detail from rows or columns.
>
> --
> ****************************************
*********
> Andy S.
> MCSE NT/2000, MCDBA SQL 7/2000
> andymcdba1@.noreply.yahoo.com
> Please remove "noreply" before replying.
> ****************************************
*********
>

can excel view drill throughs in a pivot table

I'm building pivot tables in Excel 2000 based on data cubes from SQL 2000
Analysis Services. Is there anyway to view the drill down from the data
fields in a Excel pivot table? I try doubleclicking in a data field cell
and get a message saying that I can only get detail from rows or columns.

*************************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.noreply.yahoo.com
Please remove "noreply" before replying.
*************************************************
Oh, the message you are receiving is because you are clicking on a cell and
Excel does not have native drillthrough capabilities. A good example of
modifying Excel (via VBA) to have drillthrough capabilities can be found at:
http://www.windowsitpro.com/SQLServe...382/40382.html
HTH!
Denny Lee
<dennyglee_at_hotmail_dot_com>
Blog at:: http://spaces.msn.com/members/denster/
"Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
news:%23WCO5Op9FHA.808@.TK2MSFTNGP09.phx.gbl...
> I'm building pivot tables in Excel 2000 based on data cubes from SQL 2000
> Analysis Services. Is there anyway to view the drill down from the data
> fields in a Excel pivot table? I try doubleclicking in a data field cell
> and get a message saying that I can only get detail from rows or columns.
>
> --
> *************************************************
> Andy S.
> MCSE NT/2000, MCDBA SQL 7/2000
> andymcdba1@.noreply.yahoo.com
> Please remove "noreply" before replying.
> *************************************************
>

Wednesday, March 7, 2012

Can connect in VB but not VBA!

Hello,
We are experiencing a frustrating problem where we can connect to an interna
l
SQL Server via any application EXCEPT Office apps (Excel, Word, etc.) using
VBA. The error is:
[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or a
ccess
denied.
We're using very elementary code, that succeeds in VB programs, for example,
but fails in Excel VBA. The code is:
on error resume next
Dim conn As ADODB.Connection
Dim strw As String
Set conn = New ADODB.Connection
strw = "Provider=sqloledb;User ID=the_user;Password=the_password;" & _
"Data Source=192.168.0.8;Initial Catalog=the_catalog;Network
Library=DBMSSOCN;"
' errors out here
conn.Open strw
If Err.Number = 0 Then
MsgBox "seems alright."
Else
MsgBox "error: " & Err.Description
End If
conn.close
set conn = nothing
We're stumped. We've never heard of any ADODB VB code, that works perfectly
fine in a VB application, that suddenly stops working when ported to Excel
VBA. We've tried specifying the port, changing the Network Library, etc., as
well...all sorts of things.
Help!I would guess there is still some difference some way in how
you are connecting in VB apps and how you are connecting in
VBA - especially if you always connect fine from VB to the
same server from the same PC and using the exact same code
in VBA to the same server from the same PC does not work.
And of course this would imply that the VB app and the VBA
app have the exact same references in the exact same order.
It's doesn't sound like it's really a SQL Server issue but
you could investigate the possibilities listed in this
article:
Potential causes of the "SQL Server does not exist or access
denied" error message
http://support.microsoft.com/?id=328306
-Sue
On Thu, 07 Sep 2006 05:30:26 GMT, "brianUE" <u26284@.uwe>
wrote:

>Hello,
>We are experiencing a frustrating problem where we can connect to an intern
al
>SQL Server via any application EXCEPT Office apps (Excel, Word, etc.) using
>VBA. The error is:
> [DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist
or access
>denied.
>We're using very elementary code, that succeeds in VB programs, for example
,
>but fails in Excel VBA. The code is:
> on error resume next
> Dim conn As ADODB.Connection
> Dim strw As String
> Set conn = New ADODB.Connection
> strw = "Provider=sqloledb;User ID=the_user;Password=the_password;" & _
> "Data Source=192.168.0.8;Initial Catalog=the_catalog;Network
>Library=DBMSSOCN;"
> ' errors out here
> conn.Open strw
> If Err.Number = 0 Then
> MsgBox "seems alright."
> Else
> MsgBox "error: " & Err.Description
> End If
> conn.close
> set conn = nothing
> We're stumped. We've never heard of any ADODB VB code, that works perfect
ly
>fine in a VB application, that suddenly stops working when ported to Excel
>VBA. We've tried specifying the port, changing the Network Library, etc., a
s
>well...all sorts of things.
>Help!

Friday, February 24, 2012

Can an SQL Server stored procedure write output to an excel formated file?

Hi,
To clarify the previous post.
I would like to write a stored procedure that a client can call. The
stored procedure will then output its result in an excel file.
Thanks,
chariaYou have things a little reversed. You should have the stored procedure
return the data. How you call the report will determine how it is rendered
(HTML, CSV, PDF, Excel etc). When integrating reports you can use URL
integration or webservices. Neither of which would be that easy from a
stored procedure.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<cpeters5@.gmail.com> wrote in message
news:1120582350.023702.281780@.g43g2000cwa.googlegroups.com...
> Hi,
> To clarify the previous post.
> I would like to write a stored procedure that a client can call. The
> stored procedure will then output its result in an excel file.
> Thanks,
> charia
>

Sunday, February 19, 2012

Can a stored procedure open excel and call a macro? or vice versa

I googled it but found nothing.
I've seen where excel can call a stored procedure to return a record set but
what if my stored procedure returns several record sets, how does excel
handle that?
Thanks1. Within SQL Server you can call xp_cmdshell, to OPEN excel file
2. Enabling xp_cmdshell has some drawbacks (SQL Injection,
Security...), watch out for that
3. Macro is a Part of Excel, which runs when you open the excel file so
I doubt SQL has anything to do with that
4. Opening excel file will happen @. server rather than client, might
need to look for that
5. Once Excel is OPEN SQL has no reference pointer to excel file, its
like I opened the file & I'm done
HTH
PP
Mike wrote:
> I googled it but found nothing.
> I've seen where excel can call a stored procedure to return a record set b
ut
> what if my stored procedure returns several record sets, how does excel
> handle that?
> Thanks

Can a stored procedure open excel and call a macro? or vice versa

I googled it but found nothing.
I've seen where excel can call a stored procedure to return a record set but
what if my stored procedure returns several record sets, how does excel
handle that?
Thanks1. Within SQL Server you can call xp_cmdshell, to OPEN excel file
2. Enabling xp_cmdshell has some drawbacks (SQL Injection,
Security...), watch out for that
3. Macro is a Part of Excel, which runs when you open the excel file so
I doubt SQL has anything to do with that
4. Opening excel file will happen @. server rather than client, might
need to look for that
5. Once Excel is OPEN SQL has no reference pointer to excel file, its
like I opened the file & I'm done :)
HTH
PP
Mike wrote:
> I googled it but found nothing.
> I've seen where excel can call a stored procedure to return a record set but
> what if my stored procedure returns several record sets, how does excel
> handle that?
> Thanks