In SQL Server, you can use the sysmail_help_profile_sp
stored procedure on the msdb
database to retrieve a list of all Database Mail profiles.
You can also return profile info based on the profile name or ID.
Continue readingIn SQL Server, you can use the sysmail_help_profile_sp
stored procedure on the msdb
database to retrieve a list of all Database Mail profiles.
You can also return profile info based on the profile name or ID.
Continue readingIn SQL Server, you can use the sysmail_help_principalprofile_sp
stored procedure on the msdb
database to retrieve a list of all associations between Database Mail accounts and database principals.
You can also return account info based on the principal name/ID or the profile name/ID.
Continue readingIn SQL Server, you can use the sysmail_help_account_sp
stored procedure on the msdb
database to retrieve a list of all Database Mail accounts.
You can also return account info based on its account name or ID.
Continue readingYou might be familiar with the ALL
option in SQL Server. Perhaps you’ve used it along with the UNION
operator to include any duplicates that might be returned in the result set.
But did you know that ALL
can also be used in two other contexts?
ALL
can be used in the following three contexts:
SELECT
clause.UNION
clause.Examples of each of these contexts follows.
Continue readingIn SQL Server, the ALL
operator can be used with a subquery to compare a scalar value with a single-column set of values returned by the subquery.
It’s also true that the SELECT
clause and UNION
operator both accept an ALL
argument, although this usage has a different purpose (allows duplicates in the result set).
Below are examples of using the ALL
operator with a subquery.
In SQL Server, the ANSI_NULLS
setting allows you to specify how NULL
values are treated in queries.
More specifically, it allows you to specify ISO compliant behaviour of the Equal To (=
) and Not Equal To (<>
) comparison operators when they are used with NULL
values.
SQL Server has an ANSI_NULLS
setting that determines how NULL
values are evaluated when compared to another value with the Equals (=
) and Not Equal To (<>
) comparison operators.
While it’s true that you can change the ANSI_NULLS
setting at the session level (using SET ANSI_NULLS
), each database also has its own ANSI_NULLS
setting.
You can check your database to see whether its ANSI_NULLS
setting is ON
or OFF
.
To do this with T-SQL, you can either use the sys.databases
catalog view or the DATABASEPROPERTYEX()
function.
In SQL Server, you can use the sysmail_help_status_sp
stored procedure on the msdb
database to check the status of the Database Mail queues.
If you use Database Mail in SQL Server, you can use the sysmail_sentitems
view to return a list of all emails that Database Mail has sent.
If you use Database Mail in SQL Server, you can use the sysmail_allitems
view to check the status of all emails that Database Mail has processed.