In SQL Server, you can use the following T-SQL queries to return a hierarchical list of trigger event types.
These examples query the sys.trigger_event_types
view, which returns a row for each event or event group on which a trigger can fire.
In SQL Server, you can use the following T-SQL queries to return a hierarchical list of trigger event types.
These examples query the sys.trigger_event_types
view, which returns a row for each event or event group on which a trigger can fire.
In SQL Server, you can use sys.trigger_event_types
to return all events or event groups on which a trigger can fire.
In SQL Server, you can use the CRYPT_GEN_RANDOM()
function to return a cryptographic, randomly-generated number. The number is generated by the Cryptographic Application Programming Interface (CAPI).
CAPI is a Microsoft Windows platform specific application programming interface included with Microsoft Windows operating systems that provides services to enable developers to secure Windows-based applications using cryptography.
The CRYPT_GEN_RANDOM()
function accepts two arguments: the length (required), and a seed (optional).
The return value is varbinary(8000).
This article presents four ways to return a list of user-defined views in a SQL Server database.
If you want to see only system views, or both user-defined and system views, see Difference Between sys.views, sys.system_views, & sys.all_views in SQL Server.
If you prefer to administer your SQL Server databases by running T-SQL queries, instead of using the GUI, here are two options for listing all triggers in the current database.
This article presents two ways to return a list of user-defined functions in a SQL Server database.
In SQL Server, you can use the SQL_VARIANT_PROPERTY()
function to return base data type information from a sql_variant value.
The function accepts two arguments: the sql_variant value, and the property for which information is to be provided.
In SQL Server, if you try to drop an object that doesn’t exist, you’ll get an error. If you don’t want to get an error, you’ll need to add some extra code to check for the existence of the object.
Prior to SQL Server 2016, you needed to add an IF
statement that queried the relevant system objects to find out whether or not the object existed.
From SQL Server 2016, you can now use a new, cleaner method to check if an object exists. We’ll call it DROP IF EXISTS
(otherwise known as “DIE”).
When using SQL Server, you can use the sys.dm_os_host_info
system dynamic management view to return the operating system that SQL Server is running on.
This view includes a column called host_platform
which contains the type of operating system: Windows or Linux
In SQL Server environments, two of the many string functions at our disposal are LEFT()
and SUBSTRING()
.
These functions do a similar thing, but there are differences. This article looks at some of the main differences between these functions.