format formally case-insensitive code
delux
Posts: 14
We're moving from a case-insensitive to a case-sensitive SQL 2008 platform. We are not in control of the new platform and need a quick way to do a one-time update to not only keywords (which I know Refactor can already do), but also our own variables. We own Redgate Refactor, Prompt, Compare, and Backup but cannot find a way to auto-format our existing stored procs to match custom code to look like our declare variables.
Comments
Thanks,
David
Product Manager
Redgate Software
--original
DECLARE @Var AS INT
SET @var = 1234
SELECT @var = aCol FROM linkedServer.dbo.aTablename --actually looks like this in database LinkedServer.dbo.aTableName
EXEC dbo.aStoredProc --actually looks like this in database dbo.aStoredPROC
--auto-format
DECLARE @Var AS INT
SET @Var = 1234 --case corrected from @var to @Var
SELECT @var = aCol FROM linkedServer.dbo.aTablename --case corrected from linkedServer.dbo.aTablename to linkedServer.dbo.aTablename
EXEC dbo.aStoredPROC --case corrected from dbo.aStoredProc to dbo.aStoredPROC
--original
SELECT @var = aCol FROM linkedServer.dbo.aTablename --case corrected from linkedServer.dbo.aTablename to linkedServer.dbo.aTablename
--auto-format
SELECT @Var = aCol FROM LinkedServer.dbo.aTableName --case corrected from linkedServer.dbo.aTablename to LinkedServer.dbo.aTableName
David
Product Manager
Redgate Software
I can log this as a feature request. I'd really like to wait until others have expressed their need for this use case as it's not something that has cropped up much before. If it does, we'll certainly consider it.
I'd have though you could do something with a perl script that achieves this in the meantime.
David
Product Manager
Redgate Software