April 22, 2009 at 8:57 am
I have an obsolete Stored procedure, and I would like to put some comments in it for future reference, but I can because of "Ambiguous Column Names" errors. I don't want to fix it since it's not being used, but I would like to modify it. Can it be done ? Hack into system tables somehow ?? (not so easy in 2005)
April 22, 2009 at 9:30 am
Can't you just comment everything in the body of the proc?
April 22, 2009 at 9:43 am
I could do that. But I wanted to leave the code as original as possible.
April 22, 2009 at 3:06 pm
You should not leave the code just "as original as possible".
Either fix it to be runable code again (returning the same results as original) or drop it. If needed, you could script out the proc for future use. I can see no valid reason to keep a non-working procedure in the system.
To fix it:
Normally, those errors show up if the columns referenced in SELECT or WHERE clauses are not qualified (e.g. Col1 instead of Table1.Col1) and two or more tables have columns with those (identical) names.
April 22, 2009 at 10:28 pm
Why not to keep it as a seperate file on OS. If the SP is unusable, it should not be in the database.
April 23, 2009 at 1:39 am
homebrew01 (4/22/2009)
I have an obsolete Stored procedure, and I would like to put some comments in it for future reference, but I can because of "Ambiguous Column Names" errors. I don't want to fix it since it's not being used, but I would like to modify it. Can it be done ?
No.
Hack into system tables somehow ?? (not so easy in 2005)
Only if you're willing to risk a corrupt and unusable database.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 23, 2009 at 6:17 am
Since the code is unusable, I don't see the point of keeping it intact. Comment it out. That will leave it in place if you really must.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply