Need SQL script

Posted on 2005-03-25
Medium Priority
Last Modified: 2010-04-23
I have to rebuild my tables empty (+/- 100,MSDE) on another site, using a script but I don't want to type them all out using T-SQL statement (CREATE TABLE etc), is there an easy way to do this ?


Question by:Strategus
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 25

Accepted Solution

RonaldBiemans earned 1840 total points
ID: 13629908
you can let VB.net create the  script for you.


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objDMO As SQLDMO.SQLServer
        objDMO = New SQLDMO.SQLServer
        objDMO.loginsecure = True

        Dim objDB As SQLDMO.Databases
        objDB = objDMO.Databases

        Dim oTable As SQLDMO.Table
        For Each oTable In objDB.Item("YOURDATABASENAME").Tables
                TextBox1.Text += oTable.Script
    End Sub

this will make the CREATE TABLE Scripts for you.

you must reference the SQLDMO com object , (choose add reference, com tab, then locate SQLDMO)


Author Comment

ID: 13629925
I'll give it a try

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question