Generate SQL Script from ASP.Net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Lozzi

    Generate SQL Script from ASP.Net

    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




  • ViewState

    #2
    Re: Generate SQL Script from ASP.Net

    Whats your need then
    "David Lozzi" <DavidLozzi@nos pam.nospam> escreveu na mensagem
    news:e7oShX7zFH A.3540@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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
    >
    >
    >
    >[/color]


    Comment

    • David Lozzi

      #3
      Re: Generate SQL Script from ASP.Net

      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



      "ViewState" <oakcool@ig.com .br> wrote in message
      news:%23dqPwj7z FHA.1264@tk2msf tngp13.phx.gbl. ..[color=blue]
      > Whats your need then
      > "David Lozzi" <DavidLozzi@nos pam.nospam> escreveu na mensagem
      > news:e7oShX7zFH A.3540@TK2MSFTN GP10.phx.gbl...[color=green]
      >> 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
      >>
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Trevor Benedict R

        #4
        Re: Generate SQL Script from ASP.Net

        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

        "David Lozzi" <DavidLozzi@nos pam.nospam> wrote in message
        news:e7oShX7zFH A.3540@TK2MSFTN GP10.phx.gbl...[color=blue]
        > 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
        >
        >
        >
        >[/color]


        Comment

        • ViewState

          #5
          Re: Generate SQL Script from ASP.Net

          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
          "David Lozzi" <DavidLozzi@nos pam.nospam> escreveu na mensagem
          news:%23okYxy7z FHA.2924@TK2MSF TNGP15.phx.gbl. ..[color=blue]
          > 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
          >
          >
          >
          > "ViewState" <oakcool@ig.com .br> wrote in message
          > news:%23dqPwj7z FHA.1264@tk2msf tngp13.phx.gbl. ..[color=green]
          >> Whats your need then
          >> "David Lozzi" <DavidLozzi@nos pam.nospam> escreveu na mensagem
          >> news:e7oShX7zFH A.3540@TK2MSFTN GP10.phx.gbl...[color=darkred]
          >>> 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
          >>>
          >>>
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Steven Cheng[MSFT]

            #6
            Re: Generate SQL Script from ASP.Net

            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.

            Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


            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" <DavidLozzi@nos pam.nospam>
            | References: <e7oShX7zFHA.35 40@TK2MSFTNGP10 .phx.gbl>
            <#dqPwj7zFHA.12 64@tk2msftngp13 .phx.gbl>
            | 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: <#okYxy7zFHA.29 24@TK2MSFTNGP15 .phx.gbl>
            | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
            | NNTP-Posting-Host: c-24-63-42-200.hsd1.ma.com cast.net 24.63.42.200
            | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
            | Xref: TK2MSFTNGXA01.p hx.gbl
            microsoft.publi c.dotnet.framew ork.aspnet:1310 20
            | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
            |
            |
            |
            | "ViewState" <oakcool@ig.com .br> wrote in message
            | news:%23dqPwj7z FHA.1264@tk2msf tngp13.phx.gbl. ..
            | > Whats your need then
            | > "David Lozzi" <DavidLozzi@nos pam.nospam> escreveu na mensagem
            | > news:e7oShX7zFH A.3540@TK2MSFTN GP10.phx.gbl...
            | >> 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
            | >>
            | >>
            | >>
            | >>
            | >
            | >
            |
            |
            |

            Comment

            Working...