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...]
How to Find All References to an Object in a SQL Server Database
You can use the following scripts to find all affected objects that make any references to your search term. You can either use sql_modules or syscomments to accomplish this purpose. Generally, they should give you the same results, but from time to time, I found that they may give you slightly different results and I haven't had the chance to look closer how big the difference is. Just to keep … [Read more...]
- 1
- 2
- 3
- …
- 5
- Next Page »