Maintenance and Management

Technical Article

Generate Delete Stored Procedure

  • Script

This procedure will generate a delete stored procedure against a provided table and column name in your database.  It will search for foriegn key constraints and create a delete statement for each one found in the database.  The procedure has three parameters:@table_name nvarchar(128) = the name of the source table@column_name nvarchar(128) = the name of […]

You rated this post out of 5. Change rating

2002-04-22

272 reads

Technical Article

Script to list all user and roles

  • Script

This script list all the users defined for each database on the server, it give the database name, the login name and the role defined.Its use full to have quick view of witch users are dbo on witch databaseEnsure that you have the result in grid in query analyzer, and just cut and paste the […]

1 (1)

You rated this post out of 5. Change rating

2002-04-18

947 reads

Technical Article

Script Generator for Triggers

  • Script

This Stored Procedure creates the script of all existing triggersOptionally it creates the script to drop the triggers too.Triggers may belong to different owners. This procedure takes care of it.In SQLServer Enterprise Manager there is a facility to generate scripts forTables, Views, Stored Procedures etc.But it won't generate script for triggers unless we include the […]

5 (6)

You rated this post out of 5. Change rating

2002-03-27

2,689 reads

Technical Article

Detect the Amount of Wasted Data Space in a Table for 2000

  • Script

SP_WASTED_SPACE will run through each column in your database and print a report of all the character columns. It will then print a report with :* The maximum length that a column is storing* The average length of data stored in each column* The amount of wasted space in each column* Hints on how to […]

You rated this post out of 5. Change rating

2002-03-14

1,123 reads

Blogs

T-SQL Tuesday #180: Good enough is perfect Roundup

By

This month, I prompted bloggers to discuss whether good enough is perfect. Thank you to all...

Using SQL Compare with Read-only Access

By

Recently a customer asked if SQL Compare and SQL Data Compare can be used...

Off to Live 360

By

I am off to Live 360 today, on my last trip of the year....

Read the latest Blogs

Forums

Microsoft Recommendations for Update Stats?

By Brandie Tarvin

I have an application team that is insisting on daily (and for some, weekly)...

how can i tell if our db2 driver is ms or ibm or other?

By stan

i see this in the definition of a linked server on our wh sql...

normal role member to be able to view list of other role members in his DB

By Senad

Is this even possible ? Tried with grant but to no avail. [sys].[database_role_members] and...

Visit the forum

Question of the Day

A Strange Result

What does this code return in SSMS 20 from SQL Server 2019?

select '|' + CHAR(0)+'abc' + '|';

See possible answers