Generate SQL Script from ASP.Net

D

David Lozzi

Hello,

I'd like to create the SQL script for any given table, view or proc in my
database, through ASP.Net using VB. I'm building a module library and
providing this code on the fly would ease my pain a lot.

To clarify, I'm looking for the same functionality that would you receive
when you select Generate SQL Script... in Enterprise Manager on an object.
I'm sure there's a proc that creates this output file, however I have no
idea which one it is.

Thanks!!
 
D

David Lozzi

To create the output, not necessarily the files, just the output of the
Generate SQL Script programatically from ASP.Net, not the SQL's Enterprise
Manager. I would like to just specify a table name and have it script it....
 
T

Trevor Benedict R

It's called SQLDMO. Google for it or let us know. Someone would be able to
help you with generating the script. This is a COM Object through. But you
can still use it,

Regards,

Trevor Benedict R
MCSD
 
V

ViewState

You can look at the system tables for info on name of table and columns.
Like you define your database in one combobox.
then go to another one to pick the table name.
and listbox to pick the columns then you concatenate all the info u selected
in one sql string.
I just cant remember the system tables you have to query to get the info I
just told.
But I think you can find it in the Books Online SQL help
 
S

Steven Cheng[MSFT]

Hi David,

Regarding on your requirement, I think Trevor 's suggestion on using the
SQLDMO components is the one you need. SQLDMO is the components which helps
to finish many tasks in SQLServer database management. In fact the
SQLserver 's enterprise manager is just built on this components. Also,
since the SQLDMO is COM based, we need to call them through COM interop in
..net application.

http://msdn.microsoft.com/msdnmag/issues/01/05/sqldmo/default.aspx

You can find more detailed referrence on SQLDMO in the sqlserver book
online.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "David Lozzi" <[email protected]>
| References: <[email protected]>
<#[email protected]>
| Subject: Re: Generate SQL Script from ASP.Net
| Date: Thu, 13 Oct 2005 02:09:31 -0400
| Lines: 41
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: c-24-63-42-200.hsd1.ma.comcast.net 24.63.42.200
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:131020
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| To create the output, not necessarily the files, just the output of the
| Generate SQL Script programatically from ASP.Net, not the SQL's
Enterprise
| Manager. I would like to just specify a table name and have it script
it....
|
| --
| David Lozzi
| Web Applications Developer
| dlozzi@(remove-this)delphi-ts.com
|
|
|
| | > Whats your need then
| > "David Lozzi" <[email protected]> escreveu na mensagem
| > | >> Hello,
| >>
| >> I'd like to create the SQL script for any given table, view or proc in
my
| >> database, through ASP.Net using VB. I'm building a module library and
| >> providing this code on the fly would ease my pain a lot.
| >>
| >> To clarify, I'm looking for the same functionality that would you
receive
| >> when you select Generate SQL Script... in Enterprise Manager on an
| >> object. I'm sure there's a proc that creates this output file, however
I
| >> have no idea which one it is.
| >>
| >> Thanks!!
| >>
| >> --
| >> David Lozzi
| >> Web Applications Developer
| >> dlozzi@(remove-this)delphi-ts.com
| >>
| >>
| >>
| >>
| >
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top