Kunal RanpuraAug 9, 20191 min readFind Size of all Databases in SQL Instance in GBSELECT distinct d.name AS 'Database', SUM(m.size * 8/1024000) OVER (PARTITION BY d.name) AS 'Database Total Size GB' FROM sys.master_files mINNER JOIN sys.databases d ONd.database_id = m.database_id;
SELECT distinct d.name AS 'Database', SUM(m.size * 8/1024000) OVER (PARTITION BY d.name) AS 'Database Total Size GB' FROM sys.master_files mINNER JOIN sys.databases d ONd.database_id = m.database_id;
SQL Server Profiler Trace--Import multiple trace file in sql Table. --All the rollover files will be automatically imported --provide number tracefile to capture...
Find All Primary Key in SQL Serverselect schema_name(tab.schema_id) as [schema_name], pk.[name] as pk_name, substring(column_names, 1, len(column_names)-1) as [columns],...
SQL Server find Database User Permission--Execute the following script against the User Database where you need to find DB User permission. DECLARE @sql VARCHAR(2048) ,@sort INT...
コメント