create a physical table?

M

mainspring

Can I create a physical table or database from a Visio .vsd model? Can I
select one of the tables in the model and then have Visio create a physical
table for me?
 
C

Cookville

By referencing ADODB objects, you can send any SQL command to any database
and do anything that the database can handle (or will allow you to do). With
the proper permissions, you can send "DROP databasename;"

create an ADODB.Connection object and connect to the database server (you
can use ODBC DSN)
create an ADODB.Command object and set the SQL command (set ActiveConnection
= the Connection)
execute the Command (set ActiveConnection = the Connection) or create an
ADODB.Recordset object and set the recordset = the result of the
Command.Execute
or just Recordset.Open "sql statement"

For the Northwind Customers table in SQL Server:

CREATE TABLE [Customers] (
[CustomerID] [nchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[CompanyName] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
,
[ContactName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ContactTitle] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Address] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[City] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Region] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PostalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Country] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Phone] [nvarchar] (24) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Fax] [nvarchar] (24) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED
(
[CustomerID]
) ON [PRIMARY]
) ON [PRIMARY]
GO

mel
 

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