SQL Server - Quick way to find the rowcount in a table.
By [)ia6l0 iii
Use the Sysindexes table to find the number of rows in a table.
SELECT rows FROM databaseName..sysindexes WHERE id = OBJECT_ID ('databaseName..tableName') AND indid < 2
This is extremely useful function when you want to display number of characters depending on some column value.
Find if a table has a Clustered Index using the Information_Shcema tables.
Varchar can store non-Unicode character data where as nvarchar can store Unicode character data.
You can use the DBCC INDEXDEFRAG command to defrag the indexes on a table. It is a faster approach versus Rebuilding indexes.
Also note that, DBCC INDEXDEFRAG commands are replaced with the ALTER INDEX command in versions starting from SQL SERVER 2005
There is no workaround to change the datatype of a Timestamp column. You will have to drop the column and recreate it.
The compound operator in SQL Server 2008 offers the simpler syntax which all developers looked for.
SQL Server - Quick way to find the rowcount in a table. (2085 Views)