The most common way to view the code of a stored procedure in SSMS is doing a right-click on the stored procedure and select Script Stored Procedure as and select CREATE To. But this is not practical when you have several stored procedures to look at. Another way to do it by using a script: You might want to set the Results to Text for easy copy and paste for further … [Read more...]
How to Find a String in SQL Server Stored Procedures
This is just quick tip found from this link and is actually good to use as a starting point: Further Reading How to Find All References to an Object in a SQL Server Database How to Search for a String in All Tables in a Database How to find a specific text string in a SQL Server Stored Procedure, Function, View or Trigger How to Find a Column Name in SQL Server Database How to Get … [Read more...]
How to Search for a String in All Tables in a Database
If you want to look where a string is in all tables in a database, how do you do that? Here's a very helpful SQL to run: Further Reading How to Get Names of All Tables in SQL Server How to Find a Column Name in SQL Server Database Search all tables, all columns for a specific value SQL Server How to Find a String in SQL Server Stored Procedures … [Read more...]
Format SQL Using Redgate SQL Prompt
As a follow-up of the post String Literals as Column Aliases are Deprecated, this one feature from Redgate's SQL Prompt is quite handy to correct any existing SQL scripts quickly. Using the SQL from How to Find All References to an Object in a SQL Server Database as an example, here's what we originally have: Pay attention to the object name within the single quotes as a column … [Read more...]
String Literals as Column Aliases are Deprecated
Something that's still found in SQL scripts in enterprise environment, even with newly written scripts is the use of string literals as column aliases. Although this feature has been deprecated since 2012, old habits die hard. So what's the right way to write it? You can either use alias without a whitespace or use a double quote character. Either of these examples below is … [Read more...]
- 1
- 2
- 3
- …
- 5
- Next Page »