Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Generating scripts from a frontend app

Author  Topic 

cidr
Posting Yak Master

207 Posts

Posted - 2009-07-08 : 04:45:04
Hi there,

I've recently been asked to allow users to generate a sql script from a frontend app developed in vb. the script has to export the results into an excel spread sheet so they can analyse.

there are no parameters, just a script that has to generate.

Is there anyone who could help me with this or point me in the write direction on how this may be possible?

Many thanks

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-08 : 04:56:12
How are they generating the script? Is it by selecting fields from dropdowns and then you write the script depending on their answers?

Is it that they are actually typing the SQL into a text box?

Without more information, it is not easy to help.
Go to Top of Page

cidr
Posting Yak Master

207 Posts

Posted - 2009-07-08 : 06:09:02
Thanks for the reply RickD

The scripts are already made up. They only have to be run and exported to Excel. So, the SQL script file would some way have to be opened, generated and exported to Excel.

Could this be possible with SSIS? or similar?

This would probably have to be done from a front end app, called by a command button?

What do you think... any ideas?

Thanks
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-08 : 06:45:47
Yeah, this is pretty normal. You will need an ado connection object, there is a thread on this site about exporting to excel, do a search of the forums.

Your best bet may be to run the query into a recordset and output that to excel from vb as you will have more control.

I thought you meant that the scripts would be dynamically written by the users...
Go to Top of Page

cidr
Posting Yak Master

207 Posts

Posted - 2009-07-08 : 06:58:13
Thanks again,

will this method be a complete automation (i.e. it will run the stored script from wherever it is?)

cheers
Go to Top of Page
   

- Advertisement -