Geeks With Blogs
Woodbase Godot - Blender - .Net - C# - Game Development SQL All things related to database work ;-)
Renaming columns - and location them in stored procedures
I had to rename in a column in my database - let's call it Customer.CellPhone. Now 'CellPhone' needs to be 'Mobile'. Not to hard using the build-in SP:use WebShopEXEC sp_rename 'Customer.CellPhone', 'Mobile'goBut what if I used 'CellPhone' in a SP? Then it would fail now... But that's when I found this solution.create proc spFindWordsInSP@word nvarchar(100)asBEGINSELECT ROUTINE_NAME, ROUTINE_DEFINITIONFROM INFORMATION_SCHEMA.ROUTINES... ROUTINE_DEFINITION LIKE '%'+@word+'%'AND ROUTINE_TYPE='PROCEDURE'ORDER ......

Posted On Tuesday, August 21, 2012 8:27 AM

Copyright © woodbase | Powered by: