Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Batch file to create DDL for database

4 posts in Windows NT Last posting was on 1998-02-05 13:31:42.0Z
Karl Martino Posted on 1998-01-23 16:01:59.0Z
Message-ID: <34C8BEF7.B8966CE6@aol.com>
Date: Fri, 23 Jan 1998 11:01:59 -0500
From: Karl Martino <kmartino1@aol.com>
X-Mailer: Mozilla 4.04 [en] (WinNT; I)
MIME-Version: 1.0
Subject: Batch file to create DDL for database
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 6
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5272
Article PK: 1081350

Hello,
I'm writing a batch file to create the DDL for my server. How would I
go about
doing this. defncopy documentation seems to state it only works for an
object at a time.
Thanks!
Karl Martino
kmartino1@aol.com


Gollnhofer Gabor Posted on 1998-02-05 13:31:42.0Z
Message-ID: <34D9BF3E.4C1A@axis.hu>
Date: Thu, 05 Feb 1998 14:31:42 +0100
From: Gollnhofer Gabor <gaborg@axis.hu>
Reply-To: gaborg@axis.hu
Organization: Axis Ltd.
X-Mailer: Mozilla 3.01 (WinNT; I)
MIME-Version: 1.0
Subject: Re: Batch file to create DDL for database
References: <34C8BEF7.B8966CE6@aol.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 16
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5235
Article PK: 1081314


Karl Martino wrote:
>
> Hello,
> I'm writing a batch file to create the DDL for my server. How would I
> go about
> doing this. defncopy documentation seems to state it only works for an
> object at a time.
> Thanks!
> Karl Martino
> kmartino1@aol.com

You can try something like this:

isql -U<user> -P<passwd> -oddlgen.bat
use <database>
go
select 'defncopy -U<user> -P<passwd> out '+name+'.ddl '+name+' '
from sysobjects
where type in ('U','P','TR') -- table, proc, trigger
and name not like 'sys%'
go

Then check/edit the output file.

Regards,

Gabor Gollnhofer


Eoin Woods Posted on 1998-01-26 09:37:01.0Z
Message-ID: <34CC593D.736F571B@sybase.com>
Date: Mon, 26 Jan 1998 09:37:01 +0000
From: Eoin Woods <eoin.woods@sybase.com>
X-Mailer: Mozilla 4.04 [en] (WinNT; I)
MIME-Version: 1.0
Subject: Re: Batch file to create DDL for database
References: <34C8BEF7.B8966CE6@aol.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 19
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5269
Article PK: 1081346


Karl Martino wrote:
>
> Hello,
> I'm writing a batch file to create the DDL for my server. How would I
> go about
> doing this. defncopy documentation seems to state it only works for an
> object at a time.

There is no SQL command to dump all of the DDL for a database.

The ways of doing it include:

1. Use a CASE tool (like PowerDesigner) to extract the DDL for the
database

2. Use a stored procedure library like Ed Barlow's to do it for you
from ISQL (see http://www.tiac.net/users/sqltech/)

Eoin.
--
Eoin Woods, NT Development, ASE Engineering, Sybase Inc.
Sybase (UK), Crown Lane, Maidenhead, Berkshire, SL6 8QZ
Tel: +44-1628-597215 Fax: +44-1628-597000
Email: Eoin.Woods@sybase.com


Reinoud van Leeuwen Posted on 1998-01-26 09:39:08.0Z
Message-ID: <34CC59BB.29E2@sybase.com>
Date: Mon, 26 Jan 1998 10:39:08 +0100
From: Reinoud van Leeuwen <reinoud@sybase.com>
Organization: Sybase Inc.
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
To: Karl Martino <kmartino1@aol.com>
Subject: Re: Batch file to create DDL for database
References: <34C8BEF7.B8966CE6@aol.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 14
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5268
Article PK: 1081347


Karl Martino wrote:
>
> Hello,
> I'm writing a batch file to create the DDL for my server. How would I
> go about
> doing this. defncopy documentation seems to state it only works for an
> object at a time.
> Thanks!
> Karl Martino
> kmartino1@aol.com

You might want to take a look at RevSQL (a freeware tool). You can find
it at http://www/sqlworkshop.com
This tool has a Windows NT client that enebles you to do it in one
statement

Reinoud van Leeuwen
Sybase Professional Services Maarssen / The Netherlands