Retrieving Table Structure

Retrieving Table Structure

Post by Jef » Wed, 14 Jul 1999 04:00:00



Hello,

I am writing a program in Visual Basic, and I need to run some kind of
a script via ODBC. I want SQLServer to tell me the table structure.
Can this be done?

I basically want returned the script which you can run in Enterprise
Manager. I will be using the returned data to build a Create Table
clause. I will not know the table structure before hand, so I need
something SQLServer to return something like:

CREATE TABLE Customer (
        CustID varchar (255) NOT NULL ,
        FName varchar (40) NOT NULL ,
        MName varchar (40) NULL ,
        LName varchar (40) NOT NULL ,
        Title varchar (5) NOT NULL ,
        Email varchar (30) NULL ,
        Address varchar (255) NOT NULL
              )

Thanks in advance for any help!!

Jeff

 
 
 

Retrieving Table Structure

Post by DPSatHy » Wed, 14 Jul 1999 04:00:00


You need to SQL-DMO. See other related discussions below...


> Hello,

> I am writing a program in Visual Basic, and I need to run some kind of
> a script via ODBC. I want SQLServer to tell me the table structure.
> Can this be done?

> I basically want returned the script which you can run in Enterprise
> Manager. I will be using the returned data to build a Create Table
> clause. I will not know the table structure before hand, so I need
> something SQLServer to return something like:

> CREATE TABLE Customer (
> CustID varchar (255) NOT NULL ,
> FName varchar (40) NOT NULL ,
> MName varchar (40) NULL ,
> LName varchar (40) NOT NULL ,
> Title varchar (5) NOT NULL ,
> Email varchar (30) NULL ,
> Address varchar (255) NOT NULL
>               )

> Thanks in advance for any help!!

> Jeff



 
 
 

Retrieving Table Structure

Post by ganes.. » Thu, 15 Jul 1999 04:00:00


In the enterprise manager there is a menu item called "Generate script"
which will return the script for creation of the table



> You need to SQL-DMO. See other related discussions below...



> > Hello,

> > I am writing a program in Visual Basic, and I need to run some kind
of
> > a script via ODBC. I want SQLServer to tell me the table structure.
> > Can this be done?

> > I basically want returned the script which you can run in Enterprise
> > Manager. I will be using the returned data to build a Create Table
> > clause. I will not know the table structure before hand, so I need
> > something SQLServer to return something like:

> > CREATE TABLE Customer (
> > CustID varchar (255) NOT NULL ,
> > FName varchar (40) NOT NULL ,
> > MName varchar (40) NULL ,
> > LName varchar (40) NOT NULL ,
> > Title varchar (5) NOT NULL ,
> > Email varchar (30) NULL ,
> > Address varchar (255) NOT NULL
> >               )

> > Thanks in advance for any help!!

> > Jeff


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
 
 
 

1. retrieving table structure

Hello,

I am writing a program in Visual Basic, and I need to run some kind of
a script via ODBC. I want SQLServer to tell me the table structure.
Can this be done?

I basically want returned the script which you can run in Enterprise
Manager. I will be using the returned data to build a Create Table
clause. I will not know the table structure before hand, so I need
something SQLServer to return something like:

CREATE TABLE Customer (
        CustID varchar (255) NOT NULL ,
        FName varchar (40) NOT NULL ,
        MName varchar (40) NULL ,
        LName varchar (40) NOT NULL ,
        Title varchar (5) NOT NULL ,
        Email varchar (30) NULL ,
        Address varchar (255) NOT NULL
              )

Thanks in advance for any help!!

Jeff

2. HELP with VB4 and ODBC!

3. How To Retrieve Fields Structure of a Table

4. Copying records

5. How to retrieve a table fields structure...

6. Database Outputing a Text File on Server?

7. Programmatically retrieving a "Table Layout/Structure"

8. Is there a FAQ for using graphs through OPAL ?

9. How to programmatically retrieve hierarchy structure

10. Retrieve Cube Structure

11. Retrieving tree structure

12. Retrieving a Tree-structure Record

13. HELP: Store & Retrieve Data Structure mySQL