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.
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.
In SQL Server, you can use the ALTER PARTITION FUNCTION to merge two partitions into one partition.
To do this, use the MERGE RANGE argument, while providing the boundary value of the partition to drop.
This operation drops the partition and merges any values that exist in the partition into a remaining partition.
If you have a partitioned table or index in SQL Server, but you need more partitions, you can add a partition to the partition function using the ALTER PARTITION FUNCTION statement with the SPLIT RANGE argument.
When you do this, you split an existing partition into two.
In SQL Server, error message 116 occurs when you try to select multiple columns in a subquery without introducing it with the EXISTS operator.
You’ll get error 7710 if you try to split a partition in SQL Server, but you haven’t specified a “next used” filegroup.
If you’ve installed SQL Server on your Red Hat machine, you’ll need some tools to connect to it and run queries, etc.
The sqlcmd and bcp utilities are a couple of good options for helping you perform the most common tasks.