A time may come when you will need to alter your database to use a different collation. You can do this by using the following snippet: USE master; GO ALTER DATABASE [DatabaseName] COLLATE SQL_Latin1_General_CP1_CI_AS ; GO –Verify the collation setting. SELECT name, collation_name FROM sys.databases WHERE name = N'[DatabaseName]'; GO When you execute the above snippet you may come across the following error: This…
db
To get a rough view of how many rows, total, used and unused space each table has, in a sql server database you can run the following query: USE {Database_Name}; GO SELECT t.Name AS TableName, s.Name AS SchemaName, p.Rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) – SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM sys.tables…