DB Information

Get tempdb version store space usage by database

Returns a table that displays total space in tempdb used by version store records for each database. sys.dm_tran_version_store_space_usage is efficient and not expensive to run, as it does not navigate through individual version store records, and returns aggregated version store space consumed in tempdb per database. Get TempDB files count Himanshu Patel SQL Server Consultant developer & …

Get tempdb version store space usage by database Read More »

Find all comments in SQL server for all kind of objects

This script return record if we used comment using extended properties. Objects and Columns Indexes Parameters Schemas Database XML Schema Collections Database Files Data Spaces USER Partition function Remote service binding Route Service Contract Message type Plan guide Assembly Certificate Need to be change class tinyint Identifies the class of item on which the property …

Find all comments in SQL server for all kind of objects Read More »

Foreign Key scripts

We need to have ready scripts when we need to clean all data with reseed identities. Please make changes in this as per your requirements. Drop temp table Create temp table with Foreign Key (FK) values Generate foreign key drop scripts from temp table Generate foreign key scripts from temp table. Other References: