Does Visio support sp_bindrule and sp_binddefault?

K

ksturgeon

Let me aplogize for cross posting as I had intially placed this in the "Visio
General Questions" forum but no one has responded. Since my question regards
data modeling I thought that I might have better luck getting a response here.

I've reverse engineered a database using Visio for Enterprise Architects
(2003) and see that instead of using sp_bindrule or sp_binddefault it
actually attempts to create the rule or default on every colum to which it
should be bound. For instance, the following script was generated by Visio...

----------------------------------------------------
create table "FeedTransaction" (
"ID" int identity not null,
"BatchID" char(9) not null,
"TransactionID" char(9) not null,
"StatusCode" char(1) not null,
"SystemTime" char(16) not null,
"EmailProcessed" char(1) default CREATE DEFAULT df_No AS 'N' not null,
"WelcomeProcessed" char(1) default CREATE DEFAULT df_No AS 'N' not null
)
ON 'FileGroup_FeedAndCheck'

go

alter table "FeedTransaction"
add constraint "pk_FeedTransaction" primary key clustered ("ID")

go
----------------------------------------------------

Similar code that was output from an ERwin Data Modeler follows...

----------------------------------------------------
CREATE TABLE FeedTransaction (
ID int IDENTITY,
BatchID char(9) NOT NULL,
TransactionID char(9) NOT NULL,
StatusCode char(1) NOT NULL,
SystemTime char(16) NOT NULL,
EmailProcessed char(1) NOT NULL,
WelcomeProcessed char(1) NOT NULL
)
ON "FileGroup_FeedAndCheck"
go


ALTER TABLE FeedTransaction
ADD CONSTRAINT pk_FeedTransaction PRIMARY KEY (ID)
go

exec sp_bindefault df_No, 'FeedTransaction.EmailProcessed'
exec sp_bindefault df_No, 'FeedTransaction.WelcomeProcessed'
go
----------------------------------------------------

Clearly the DDL output from Visio fails to run. Is there a way to configure
Visio to generate appropriate create statements for rules and defaults and
then bind them to the appropriate columns?

Thank you for your help.
 

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