Creating Unique Constraints

Unique constraint on a column to prevent duplicate entry on a column. Using SQL Server Management Studio In Object Explorer, right-click the table to which you want to add a unique constraint, and click Design. On the Table Designer menu, click Indexes/Keys. In the Indexes/Keys dialog box, click Add. In the grid under General, click Type and choose Unique Key from the drop-down list box to the right... » read more

TSQL: Replicas Database

Query to return info about replicas. Query to return a list of Primary Replicas databases. Query to return a list of Non-Primary Replicas databases.

TSQL String Split

Examples A. Split comma-separated value string Parse a comma-separated list of values and return all non-empty tokens. STRING_SPLIT will return empty string if there is nothing between separator. Condition RTRIM(value) <> ” will remove empty tokens. B. Split comma-separated value string in a column Product table has a column with comma-separate list of tags shown... » read more