Archivo por meses: febrero 2023

How to assign permissions by schema in SQL Server

To assign permissions to a schema in SQL Server, you must first create a security role and assign permissions to the role. Then, assign the role to the desired user or group of users. Here is an example of code to assign SELECT permissions to a «test_schema» schema: sqlCopy code– Create a security role CREATE… Leer más »

SQL Duplicates Count Query for two or more columns

This query uses a commonly used query (CTE) to group the results and count duplicates in the zip_to_fips table. The first part of the query, the CTE, selects the columns «fips», «cnty_name» and adds an additional column «DuplicateCount» that uses the ROW_NUMBER() function to assign a unique number to each row that has equal values… Leer más »