Browse by Tags

Replication FAQ series - Which columns are published in snapshot or transactional or merge publications in this database?
Published 11 December 7 6:48 PM | SSQA.net
Here is script you can find which columns are published in the replication that is using either snapshot or transactional or merge publications. --For snapshot or transactional publications select object_name(object_id) as tran_published_table, name as...
Getting table name from column name
Published 15 September 7 7:23 AM | SSQA.net
If you know the name of one column you want to find from which table that is originated, to retrieve the table name you can use following TSQL: SELECT CASE (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS AS c2 WHERE c2.TABLE_NAME = c1.TABLE_NAME AND...
TSQL to find all triggers in a database including their count
Published 23 August 7 3:28 AM | SSQA.net
For SQL Server 2000 version: SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S2.deltrig = s1.id THEN 'Delete' WHEN S2.instrig = s1.id THEN 'Insert' WHEN S2.updtrig = s1.id THEN 'Update' END 'TriggerType' ,...
TSQL to generate blocking scenario for testing
Published 27 July 7 2:44 AM | SSQA.net
Most of the times you have observed to identify the blocking and how to resolve them. How about you need a script to generate a blocking scenario within your queries, this is to identify the blocker script is working or not. Also will help to test whether...
TSQL to return (display) all tables row count in database - think about performance
Published 16 July 7 4:5 AM | SSQA.net
In the forums and newsgroups this is a very common question that how to get all the tables rowcount or to get optimum values. You may be aware using SELECT COUNT(*) statement, but be aware it will make full table scan to return the rowcount and think...