3 bits found in SQL


0
Posted by albydarned 5 months ago
Credit: https://blog.sqlauthority.com/2016/06/07/sql-server-much-free-space-database/
SELECT
   SUBSTRING(a.FILENAME, 1, 1) Drive,
   [FILE_SIZE_MB] = convert(decimal(12, 2), round(a.size...
MORE

1
Posted by albydarned 8 months ago
As you may know, COUNT(*) if often very slow on large tables. With this query I have been able to que...
SELECT SUM (row_count)
FROM sys.dm_db_partition_stats
WHERE object_id=OBJECT_ID('TableName')   
AND (...
MORE

0
Posted by albydarned 9 months ago
Useful snippet for converting millisecond timestamp to date in MS SQL Server
DECLARE @UTC BIGINT
SET @UTC = 1348203320997 

-- This is a comment

SELECT DATEADD(MILLISECOND, @UTC...
MORE