|
Replies:
2
-
Pages:
1
-
Last Post:
Apr 26, 2012 6:28 AM
by: Alexander.Maximov
|
|
|
Posts:
760
Registered:
3/16/09
|
|
|
|
Toad-SS 5.7 (any versions)
Posted:
Apr 12, 2012 6:22 PM
|
|
|
|
|
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]
|
|
|
Posts:
167
Registered:
2/17/10
|
|
|
|
Re: Toad-SS 5.7 (any versions)
Posted:
Apr 12, 2012 9:06 PM
in response to: hfreeman
|
|
|
|
|
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
|
|
Posts:
794
Registered:
6/16/10
|
|
|
|
Re: Toad-SS 5.7 (any versions)
Posted:
Apr 26, 2012 6:28 AM
in response to: DarrenM
|
|
|
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)
|
|