Forums » Toad for SQL Server Beta

Thread: Toad-SS 5.7 (any versions)


Permlink Replies: 2 - Pages: 1 - Last Post: Apr 26, 2012 6:28 AM by: Alexander.Maximov
hfreeman

Posts: 760
Registered: 3/16/09
Toad-SS 5.7 (any versions)
Posted: Apr 12, 2012 6:22 PM
  Click to reply to this thread Reply
Attachment image001.gif (1.1 K)
Attachment image002.jpg (1.3 K)
Attachment image003.png (18.2 K)
Attachment image004.png (35.2 K)
Attachment image005.png (20.8 K)





Please consider changing the syntax for both Generate SQL Creation Script and
Current Generate SQL Drop script so as to include the dropping of the all the
in-the-way-constraints, before the actual drop command.

Because you really cannot drop a table if the constraints are active on a table
so the current drop syntax in Toad-SS has and continues to be of marginal and
invalid value.

Lastly, please remove all the fully qualified database name from the Drop
statement for it is too dangerous use. Please use a ‘USE command’ to
control the drop database location. This later item has been reported as a bug
in Toad-SS 5.6 … See more details below my signature.

Current Generate SQL Creation Script where all the script options are set !

Current Generate SQL Drop script

/****** Object: Table [APP].[LuServiceLocations] Script Date: 4/12/2012 8:45:36
PM ******/

USE [GCMA_DEV] ;

GO

IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID (
N'[APP].[LuServiceLocations]' ) AND type in ( N'U' ))

BEGIN

DROP TABLE [GCMA_DEV].[ APP] . [LuServiceLocations] ;

END

GO

SET ANSI_NULLS ON;

GO

SET QUOTED_IDENTIFIER ON;

GO

CREATE TABLE [APP] . [LuServiceLocations] (

[ServiceLocationID] int IDENTITY ( 1 , 1 ) NOT NULL ,

[ServiceLocationCity] varchar( 100 ) NULL ,

[ServiceLocationCounty] varchar( 100 ) NULL ,

[ServiceLocationZip] varchar( 20 ) NULL ,

[CreateDate] datetime NULL DEFAULT ( getdate ()),

[LastUpdateDate] datetime NULL ,

CONSTRAINT [PK_LuServiceLocations_ServiceLocationID]

PRIMARY KEY CLUSTERED ( [ServiceLocationID] ASC )

WITH ( PAD_INDEX = OFF ,

FILLFACTOR = 90 ,

IGNORE_DUP_KEY = OFF ,

STATISTICS_NORECOMPUTE = OFF ,

ALLOW_ROW_LOCKS = ON ,

ALLOW_PAGE_LOCKS = ON ,

DATA_COMPRESSION = NONE )

ON [PRIMARY]

)

ON [PRIMARY] ;

GO

DROP TABLE [GCMA_DEV].[ APP] . [LuServiceLocations] ;

Hank Freeman

Senior SQL Server DBA/Data & Systems Architect

hfreeman@aglresources.com

AGL RESOURCES INC.

TEN PEACHTREE PL NE

ATLANTA, GA 30309

hfreeman@msn.com - Personal

678-414-0090 my cell Primary

hank.freeman50 via Skype

Suggested proper syntax for dropping and re-creating the table.

Suggested Proper syntax for Drop syntax

USE [GCMA_DEV] ;

GO

IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID (
N'[APP].[LuServiceLocations]' ) AND type in ( N'U' ))

BEGIN

ALTER TABLE [APP] . [LuServiceProviderLocations]

DROP CONSTRAINT [FK__LuService__Servi__5ECC629A];

ALTER TABLE [APP] . [LuServiceLocations]

DROP CONSTRAINT [PK_LuServiceLocations_ServiceLocationID];

drop TABLE [APP] . [LuServiceLocations]

END

GO

SET ANSI_NULLS ON;

GO

SET QUOTED_IDENTIFIER ON;

GO

CREATE TABLE [APP] . [LuServiceLocations] (

[ServiceLocationID] int IDENTITY ( 1 , 1 ) NOT NULL ,

[ServiceLocationCity] varchar( 100 ) NULL ,

[ServiceLocationCounty] varchar( 100 ) NULL ,

[ServiceLocationZip] varchar( 20 ) NULL ,

[CreateDate] datetime NULL DEFAULT ( getdate ()),

[LastUpdateDate] datetime NULL ,

CONSTRAINT [PK_LuServiceLocations_ServiceLocationID]

PRIMARY KEY CLUSTERED ( [ServiceLocationID] ASC )

WITH ( PAD_INDEX = OFF ,

FILLFACTOR = 90 ,

IGNORE_DUP_KEY = OFF ,

STATISTICS_NORECOMPUTE = OFF ,

ALLOW_ROW_LOCKS = ON ,

ALLOW_PAGE_LOCKS = ON ,

DATA_COMPRESSION = NONE )

ON [PRIMARY]

)

ON [PRIMARY] ;

GO

USE [GCMA_DEV];

GO

ALTER TABLE [APP] . [LuServiceProviderLocations]

DROP CONSTRAINT [FK__LuService__Servi__5ECC629A]

GO

ALTER TABLE [APP] . [LuServiceLocations]

DROP CONSTRAINT [PK_LuServiceLocations_ServiceLocationID]

GO

drop TABLE [APP] . [LuServiceLocations]




DarrenM


Posts: 167
Registered: 2/17/10
Re: Toad-SS 5.7 (any versions)
Posted: Apr 12, 2012 9:06 PM   in response to: hfreeman
  Click to reply to this thread Reply
Attachment image001.gif (1.1 K)
Attachment image003.png (18.2 K)
Attachment image004.png (35.2 K)
Attachment image005.png (20.8 K)





I'd like to second these requests? I don't even try to use these features in
Toad because of these things mentioned below.


Darren




Darren
Alexander.Maximov

Posts: 794
Registered: 6/16/10
Re: Toad-SS 5.7 (any versions)
Posted: Apr 26, 2012 6:28 AM   in response to: DarrenM
  Click to reply to this thread Reply

Thanks for your input. We already have it in our backlog for the next release.

Alex

Alexander Maximov, DELL
Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums