This guide provides a list of common SQL commands to help you quickly verify the status and content of your database. You can execute these commands instantly using the T-SQL Console in your control panel.
Use this query to retrieve a list of all user-created tables in your database.
SELECT Name FROM sys.tables ORDER BY Name
Use this stored procedure to see the current size of your database and the space used by data and logs. This is useful for monitoring your hosting plan limits.
EXEC sp_spaceused
Use this query to quickly see how many records are in each table. This is an excellent way to verify that your data was imported successfully after a migration.
SELECT t.name AS TableName, p.rows AS RowCount
FROM sys.tables t
JOIN sys.partitions p ON t.object_id = p.object_id
WHERE p.index_id IN (0,1)
ORDER BY t.name
Use this to confirm the specific version and edition of the SQL Server your database is hosted on.
SELECT @@VERSION
Replace YourTableName with the actual name of a table to view the first 10 rows of data.
SELECT TOP 10 * FROM YourTableName