In SQL Server, you can use the ROWCOUNT_BIG() system function to return the number of rows affected by the last T-SQL statement.
It works exactly the same as @@ROWCOUNT, except that ROWCOUNT_BIG() returns its result as a bigint.
In SQL Server, you can use the ROWCOUNT_BIG() system function to return the number of rows affected by the last T-SQL statement.
It works exactly the same as @@ROWCOUNT, except that ROWCOUNT_BIG() returns its result as a bigint.
In SQL Server, you can use the SET SHOWPLAN_ALL statement to return the query plan for a given T-SQL statement. The query plan displays detailed information about how the statement is executed, as well as estimates of the resource requirements for the statements.
In SQL Server, you can use the SET SHOWPLAN_TEXT statement to return the query plan for a T-SQL statement. This contains detailed information about how the statement is executed.
I’ve written quite a number of tutorials for using Database Mail, and I’ve created this article to list them all in one place.
I first included these links at the bottom of How to Send Emails from SQL Server (T-SQL), but I thought it might be helpful to move them to their own article as a quick-reference.
In SQL Server, the T-SQL CASE expression is a scalar expression that returns a value based on conditional logic. It evaluates a list of conditions and returns a value, based on the outcome of those conditions..
In some ways, the SQL Server CASE expression is similar to IF...ELSE. However, CASE allows you to check for multiple conditions, whereas IF...ELSE doesn’t.
If you’re using OPENJSON(), but you’re trying to remember how to select an inner fragment from the JSON document, read on.
Here’s a quick tutorial that demonstrates how to check or change the compatibility level of a database using the SQL Server Management Studio (SSMS) graphical user interface (GUI).
If you want to see how to do it in T-SQL, see How to Change the Compatibility Level of a Database using T-SQL.
When you create a profile in Database Mail, you have the option of making it a private profile or a public profile.
You also have the option of setting it as the default profile.
Here, I demonstrate how to change the priority of a Database Mail account within a profile in SQL Server using the SQL Server Management Studio (SSMS) graphical user interface.
If you want to see how to do it using T-SQL, see Change the Sequence Number of an Account in Database Mail (T-SQL).
The priority and the sequence number are the same thing (when you change it with T-SQL you use the @sequence_number parameter).
Here, I demonstrate how to remove a Database Mail account from a Database Mail profile in SQL Server using the SQL Server Management Studio (SSMS) graphical user interface.
If you want to see how to do it using T-SQL, see Remove a Database Mail Account from a Profile (T-SQL).