July 28, 2014 at 8:51 pm
Comments posted to this topic are about the item Drop Any Object if it exists
July 29, 2014 at 5:25 am
You might want to consider adding support for:
1) sysname/nvarchar input
2) fully qualified names
Some good items that don't seem supported for testing:
1) item in another database
2) something with max synonym name length.
3) temp table with space in the name, or fully qualified temp table names
4) temporary stored procedure, or function
5) indexes
6) sql injection (your input is used right now as part of raw sql) eg: #a;
7) are you expecting to use this for columns?
8) drop command fallthrough - seems to run drop even if it does not exist. eg input: [some item that won't exist]
Just a few thoughts,
John
July 29, 2014 at 7:31 pm
The list of object types catered for is somewhat limited - object type have the following additional values:
AF = Aggregate function (CLR)
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
FS = Assembly (CLR) scalar-function
FT = Assembly (CLR) table-valued functionIF = In-lined table-function
IT - Internal table
L = Log
PC = Assembly (CLR) stored-procedure
R = Rule
RF = Replication filter stored procedure
S = System table
SN = Synonym
SQ = Service queue
TA = Assembly (CLR) DML trigger
TF = Table function
TT = Table type
X = Extended stored procedure
July 31, 2014 at 9:01 am
Ok, I'm just an advanced user, not a dba and I don't have a need for many functions, but I really like this one.
I've created the function on a database where I have appropriate permissions, but I've noticed a behavior I did not expecct.
When trying to delete more than one temp table, I have to separate the uses of the function by 'go'. It's not enough to use a semi-colon.
Do you know why this is? Is there a way to make this work wihtout inserting 'go' between uses?
Failing that, can the function be modified to allow dropping multiple tables at once?
Thanks for submitting this.
July 31, 2014 at 10:12 pm
Yeah that's the only pain with it because it doing a DDL it has to be the only statement in the execute set
Other than that I use it before every object create for scripts etc.
Hope that helps
July 31, 2014 at 10:13 pm
Wrote this some time ago - > 5 years ago.
Happy for you to update, though it does the main important ones.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply