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.

generate ddl .....

6 posts in General Discussion Last posting was on 2008-03-25 09:45:14.0Z
Andreas Gerats Posted on 2008-03-17 14:56:06.0Z
Sender: 6304.47de82cc.1804289383@sybase.com
From: Andreas Gerats
Newsgroups: sybase.public.workspace.general
Subject: generate ddl .....
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47de8686.6366.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Mar 2008 06:56:06 -0800
X-Trace: forums-1-dub 1205765766 10.22.241.41 (17 Mar 2008 06:56:06 -0800)
X-Original-Trace: 17 Mar 2008 06:56:06 -0800, 10.22.241.41
Lines: 27
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:633
Article PK: 1088306

Hi,

I try to build up a script to drop and recreate all tables
within a database (deploying a new structure), so I am
generating a script for dropping and recreating tables
within Workspace:

--> Enterprise Explorer --> DB-Name --> dbo --> rightclick
on Folder Tables --> Generate DDL ...

I selected CREATE statements, DROP statements and Grant
privilege statements under 'Generate Options' and selected
all under 'Generate objects' on screen 'Generate DDL' (PK
constraints, FK, Indexes ...).

After saving the script I try to run it, but obviously only
drop table scripts were generated and so script fails e.g.
with the error message: "Cannot drop table 'test_table'
because it still has referential integrity constraints."

What do I have to do to create drop statements for all
constraints (pk, fk ...) too?

I have marked all relevant check boxes as far as I can see.

Thx and regards
Andreas


Daniel Huang Posted on 2008-03-19 01:22:10.0Z
Reply-To: "Daniel Huang" <lihuang@sybase.com>
From: "Daniel Huang" <lihuang@sybase.com>
Newsgroups: sybase.public.workspace.general
References: <47de8686.6366.1681692777@sybase.com>
Subject: Re: generate ddl .....
Lines: 40
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e06ac2$1@forums-1-dub>
Date: 18 Mar 2008 17:22:10 -0800
X-Trace: forums-1-dub 1205889730 10.22.241.152 (18 Mar 2008 17:22:10 -0800)
X-Original-Trace: 18 Mar 2008 17:22:10 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:637
Article PK: 1088312

Hi, Andreas:

Could you provide the detailed SQL scripts for those tables including
'test_table'. We will look into it.
Thanks.

Daniel Huang

<Andreas Gerats> wrote in message
news:47de8686.6366.1681692777@sybase.com...
> Hi,
>
> I try to build up a script to drop and recreate all tables
> within a database (deploying a new structure), so I am
> generating a script for dropping and recreating tables
> within Workspace:
>
> --> Enterprise Explorer --> DB-Name --> dbo --> rightclick
> on Folder Tables --> Generate DDL ...
>
> I selected CREATE statements, DROP statements and Grant
> privilege statements under 'Generate Options' and selected
> all under 'Generate objects' on screen 'Generate DDL' (PK
> constraints, FK, Indexes ...).
>
> After saving the script I try to run it, but obviously only
> drop table scripts were generated and so script fails e.g.
> with the error message: "Cannot drop table 'test_table'
> because it still has referential integrity constraints."
>
> What do I have to do to create drop statements for all
> constraints (pk, fk ...) too?
>
> I have marked all relevant check boxes as far as I can see.
>
> Thx and regards
> Andreas


Andreas Gerats Posted on 2008-03-19 09:21:19.0Z
Sender: 6304.47de82cc.1804289383@sybase.com
From: Andreas Gerats
Newsgroups: sybase.public.workspace.general
Subject: Re: generate ddl .....
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47e0db0f.186c.1681692777@sybase.com>
References: <47e06ac2$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 19 Mar 2008 01:21:19 -0800
X-Trace: forums-1-dub 1205918479 10.22.241.41 (19 Mar 2008 01:21:19 -0800)
X-Original-Trace: 19 Mar 2008 01:21:19 -0800, 10.22.241.41
Lines: 59
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:639
Article PK: 1088315

Hi Daniel,

thx a lot for looking into this issue. Can you please
provide me an email-adress where I can send the script too
since this will be business relevant code and I may ask you
to handle the content strictly confident.

In the meantime I found another issue. In Enterprise
Explorer:
On clicking 'Generate ddl ...' on the database itself and
choosing create as well as drop statements on the next
screen leads to a script with only create statements and no
drop statements at all.

Thx and regards
Andreas

> Hi, Andreas:
>
> Could you provide the detailed SQL scripts for those
> tables including 'test_table'. We will look into it.
> Thanks.
>
> Daniel Huang
>
>
> <Andreas Gerats> wrote in message
> news:47de8686.6366.1681692777@sybase.com...
> > Hi,
> >
> > I try to build up a script to drop and recreate all
> > tables within a database (deploying a new structure), so
> > I am generating a script for dropping and recreating
> > tables within Workspace:
> >
> > --> Enterprise Explorer --> DB-Name --> dbo -->
> > rightclick on Folder Tables --> Generate DDL ...
> >
> > I selected CREATE statements, DROP statements and Grant
> > privilege statements under 'Generate Options' and
> > selected all under 'Generate objects' on screen
> > 'Generate DDL' (PK constraints, FK, Indexes ...).
> >
> > After saving the script I try to run it, but obviously
> > only drop table scripts were generated and so script
> > fails e.g. with the error message: "Cannot drop table
> > 'test_table' because it still has referential integrity
> constraints." >
> > What do I have to do to create drop statements for all
> > constraints (pk, fk ...) too?
> >
> > I have marked all relevant check boxes as far as I can
> see. >
> > Thx and regards
> > Andreas
>
>


Andreas Gerats Posted on 2008-03-19 09:26:29.0Z
Sender: 6304.47de82cc.1804289383@sybase.com
From: Andreas Gerats
Newsgroups: sybase.public.workspace.general
Subject: Re: generate ddl .....
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47e0dc45.1885.1681692777@sybase.com>
References: <47e06ac2$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 19 Mar 2008 01:26:29 -0800
X-Trace: forums-1-dub 1205918789 10.22.241.41 (19 Mar 2008 01:26:29 -0800)
X-Original-Trace: 19 Mar 2008 01:26:29 -0800, 10.22.241.41
Lines: 53
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:641
Article PK: 1088317

Hi Daniel,

and one more issue:

On saving the script to file into my given folder structure,
WorkSpace is creating a folder named Database but I never
mentioned to create this folder. I guess this should not be
the case, I always will have to copy the created file to its
correct location.

Thx and best regards
Andreas

> Hi, Andreas:
>
> Could you provide the detailed SQL scripts for those
> tables including 'test_table'. We will look into it.
> Thanks.
>
> Daniel Huang
>
>
> <Andreas Gerats> wrote in message
> news:47de8686.6366.1681692777@sybase.com...
> > Hi,
> >
> > I try to build up a script to drop and recreate all
> > tables within a database (deploying a new structure), so
> > I am generating a script for dropping and recreating
> > tables within Workspace:
> >
> > --> Enterprise Explorer --> DB-Name --> dbo -->
> > rightclick on Folder Tables --> Generate DDL ...
> >
> > I selected CREATE statements, DROP statements and Grant
> > privilege statements under 'Generate Options' and
> > selected all under 'Generate objects' on screen
> > 'Generate DDL' (PK constraints, FK, Indexes ...).
> >
> > After saving the script I try to run it, but obviously
> > only drop table scripts were generated and so script
> > fails e.g. with the error message: "Cannot drop table
> > 'test_table' because it still has referential integrity
> constraints." >
> > What do I have to do to create drop statements for all
> > constraints (pk, fk ...) too?
> >
> > I have marked all relevant check boxes as far as I can
> see. >
> > Thx and regards
> > Andreas
>
>


Daniel Huang Posted on 2008-03-21 05:36:03.0Z
Reply-To: "Daniel Huang" <lihuang@sybase.com>
From: "Daniel Huang" <lihuang@sybase.com>
Newsgroups: sybase.public.workspace.general
References: <47e06ac2$1@forums-1-dub> <47e0dc45.1885.1681692777@sybase.com>
Subject: Re: generate ddl .....
Lines: 84
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e34943$1@forums-1-dub>
Date: 20 Mar 2008 21:36:03 -0800
X-Trace: forums-1-dub 1206077763 10.22.241.152 (20 Mar 2008 21:36:03 -0800)
X-Original-Trace: 20 Mar 2008 21:36:03 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:649
Article PK: 1088329

Hi, Andreas:

Please send mail to lihuang@sybase.com and I will keep the script strictly
confident.

'Generate DDL' on the database will generate all objects on this database.
If 'DROP statements' option is checked, 'drop database' will be generated,
but it is not necessary to generate 'drop' for other objects, like table,
proc now that that database is already dropped.

If you don't want to generate 'Database' folder, please uncheck 'Generate
full hierarchy' on the last wizard page.


--
Thanks and regards,

Daniel Huang

Sybase Software (China) Co., Ltd
Room 1202-1203, Building One,
Zhangjiang Semiconductor Industry Park
3000 Longdong Avenue
Pudong, Shanghai 201203
Email: lihuang@sybase.com

<Andreas Gerats> wrote in message
news:47e0dc45.1885.1681692777@sybase.com...
> Hi Daniel,
>
> and one more issue:
>
> On saving the script to file into my given folder structure,
> WorkSpace is creating a folder named Database but I never
> mentioned to create this folder. I guess this should not be
> the case, I always will have to copy the created file to its
> correct location.
>
> Thx and best regards
> Andreas
>
>> Hi, Andreas:
>>
>> Could you provide the detailed SQL scripts for those
>> tables including 'test_table'. We will look into it.
>> Thanks.
>>
>> Daniel Huang
>>
>>
>> <Andreas Gerats> wrote in message
>> news:47de8686.6366.1681692777@sybase.com...
>> > Hi,
>> >
>> > I try to build up a script to drop and recreate all
>> > tables within a database (deploying a new structure), so
>> > I am generating a script for dropping and recreating
>> > tables within Workspace:
>> >
>> > --> Enterprise Explorer --> DB-Name --> dbo -->
>> > rightclick on Folder Tables --> Generate DDL ...
>> >
>> > I selected CREATE statements, DROP statements and Grant
>> > privilege statements under 'Generate Options' and
>> > selected all under 'Generate objects' on screen
>> > 'Generate DDL' (PK constraints, FK, Indexes ...).
>> >
>> > After saving the script I try to run it, but obviously
>> > only drop table scripts were generated and so script
>> > fails e.g. with the error message: "Cannot drop table
>> > 'test_table' because it still has referential integrity
>> constraints." >
>> > What do I have to do to create drop statements for all
>> > constraints (pk, fk ...) too?
>> >
>> > I have marked all relevant check boxes as far as I can
>> see. >
>> > Thx and regards
>> > Andreas
>>
>>