List all the fields of a table with its properties + PK
This script returns a list of all the fields of a table with it properties, primary keys and user defined types.
2020-01-21 (first published: 2014-04-30)
1,680 reads
This script returns a list of all the fields of a table with it properties, primary keys and user defined types.
2020-01-21 (first published: 2014-04-30)
1,680 reads
Dropping database in RDS follows different method than dropping the database in local SQL Server. Below is the command to DROP the database in Amazon RDS EXECUTE msdb.dbo.rds_drop_database N'demodb' GO However when the SQL Server is configured with Multi-zone mirroring, then you need to set the partner to OFF and drop all active connections and […]
2020-01-17
3,181 reads
2019-12-20 (first published: 2019-12-10)
2,032 reads
T-SQL script to purge all the tables including foreign key references. The script has been made smart enough to use TRUNCATE wherever there is no foreign key reference and to use DELETE wherever there is foreign key reference.
2019-12-10
2,421 reads
An alternative for Microsoft's STRING_SPLIT function that will work on SQL Server 2012 and higher.
2019-12-05 (first published: 2019-02-28)
24,416 reads
This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node. The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression.
2019-11-25 (first published: 2019-11-24)
703 reads
I am teaching a database class at Queens College. The project entails the truncation of all of the data and loading new data into the existing database "BIClass" from a single of the flattened data. One of the tasks of the project was to add these three additional columns to each of the tables (AlterTableAddColumnsUserAuthorizationKeyAndTwoTimeStamps): […]
2019-11-18 (first published: 2019-11-10)
977 reads
This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node. The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression.
2019-11-12 (first published: 2019-11-08)
1,946 reads
T-SQL query to return the latest available database backup chain (Full, Differential and Log) of individual databases along with their backup size and compressed size.
2019-11-08 (first published: 2019-10-30)
3,205 reads
A diagnostic tool for identifying Performance features of active SQL Queries. It collects performance detail from DMVs for queries with executing requests and is designed to demonstrate and quantify Query Shaping optimisation techniques by: quantifying query workload and throughput characteristics providing behavioural descriptors of potential performance inhibitors - refer column ThrottlePotential The ThrottlePotential column is […]
2019-11-07
4,004 reads
A couple of weeks ago, a developer came to me and wanted to know...
By SQLPals
Database Property LastGoodCheckDbTime to Get the Last Successful DBCC CHECKDB on a Database As one...
When you develop data pipelines in Microsoft Fabric (the Azure Data Factory equivalent in...
Comments posted to this topic are about the item Baseball Everywhere
I am working on a small test script on SQL server 2022 using python...
Upgrade to SQL2019 from 2012 Query is taking time, Need Query Optimization steps and...
I want to use the ADD SENSITIVITY CLASSIFICATION DDL to mark some columns in my SQL Server 2022 database as PII. Can I use this code?
ADD SENSITIVITY CLASSIFICATION TO dbo.sales.price, dbo.sales.discount WITH ( LABEL = 'Highly Confidential', INFORMATION_TYPE = 'Financial', RANK = 'INTERNAL ONLY' );See possible answers