Perform Qualify Object Name on a bulk set objects
wstyp
Posts: 2 New member
Is there is a way to take an existing set of sprocs or views and run a Qualify Object Names operation without having to open each file in SSMS?
I want to be able to apply best practices in bulk. I have approximately 40 databases to do this on and doing it manually is extremely time consuming.
I want to be able to apply best practices in bulk. I have approximately 40 databases to do this on and doing it manually is extremely time consuming.
Tagged:
Answers
Thanks for reaching out to us regarding this.
Unfortunately this isn't currently possible. Quality Object Names is used to qualify object names in the current open query window only.
I appreciate that this would be useful functionality for you and so it would be worth logging a feature request for this on our SQL Prompt User Voice page: https://redgate.uservoice.com/forums/94413-sql-prompt. This was our development team will have visibility of it, and other customers can vote for it.
Dan Jary | Redgate Software
Have you visited our Help Center?
It not being there makes using SQL compare between a database that had object names qualified and one that didn't very difficult. SQL compare sees every change made by Qualify Object Names as a difference and there's no bulk way to normalize these changes across databases. I had hoped that saving a scripts folder, bulk formatting that, then comparing the two scripts folders would be the solution but found that this doesn't work because Qualify Object Names isn't used.
The only option I'm aware of is tedious. Open the SQL files in SSMS, then Bulk Actions > Format All Tabs. I have too many files to open all of them at once, so I'd have to open some, process them, then move files into a processed folder. Rinse and repeat.
Edit: Bulk Actions > Format All Tabs doesn't work either since it uses the same bulk formatting that omits Qualify Object Names. I had to use SQL Prompt > Format SQL, on, every, single, bloody tab. Seriously!?
Is there no other way to solve this problem?