Maintenance and Management

Technical Article

Replace Object Owner

  • Script

This SP is used to identify and replace the owner of the database objects. This SP will give display object id, object name, owner id, owner name and concatenate object + owner name with brackets. SP does change the owner for the following objects. SP should available in "master" database to execute in more than […]

You rated this post out of 5. Change rating

2005-12-06 (first published: )

316 reads

Technical Article

Grant EXECUTE permission to users

  • Script

This procedure will assist in granting execute rights to a database user to all the stored procedures in a database The parameters to this procedure are the databasename and the username to whom EXECUTE rights need to be given to The assumption here is that the user already has access rights to the database mentioned […]

You rated this post out of 5. Change rating

2005-05-05 (first published: )

214 reads

Technical Article

Update statistics in all database (sp_updatestats)

  • Script

This script permit executes the sp_updatestats in all databases at same time.First I create the stored procedure above in an admin database, for sample I create one database with ADMIN name where I put all administration objects create for me. You can create this sp in exist db, if you want.Now you can execute this […]

4.5 (2)

You rated this post out of 5. Change rating

2005-04-14 (first published: )

4,129 reads

Technical Article

Find maximum values for all "int" columns

  • Script

/******************************************************** "CheckAllInts" Find all columns in all user tables in a database defined as "int", and get the maximum value for the column. Uses a cursor and logs the results to a table. (One-time CREATE TABLE statement at top of script). Successive runs over an appropriate period of time would allow one to find how […]

You rated this post out of 5. Change rating

2005-04-11 (first published: )

266 reads

Technical Article

shrinking logs: how much data will be reclaimed

  • Script

This script will show you how much diskspace can be reclaimed by shrinking all the logfiles of userdatabases using a DBCC SHRINKFILE(2) command. Often the spacegain is much smaller then expected. SQL Shrinks logfiles the end of the file until it finds the active part of the logfile. (If the active part of the logfile […]

You rated this post out of 5. Change rating

2005-03-21 (first published: )

424 reads

Technical Article

Automated Profiler trace import

  • Script

This stored procedure was written to complement the automated profiler trace create procedure (should be here somewhere - check the scripts).Bascially, given the database (sample script to create the database included, but you may want to personalize it), this stored procedure will import the tracefile content into the table, which is indexed on expected search […]

You rated this post out of 5. Change rating

2005-10-03 (first published: )

358 reads

Technical Article

Automated Profiler trace Create

  • Script

This stored procedure is created to be invoked (in my case by SQL Server scheduled job), and will then create a tracefile to a specified file location (ensure that if this is NOT local, your SQL Server Agent runs on a domain account that has access to that drive. The Stored procedure will create files […]

You rated this post out of 5. Change rating

2005-03-16 (first published: )

431 reads

Technical Article

Set Extended Properties for Every Table

  • Script

Extended properties are a neat feature in SQL Server 2000 that let you set meta data for an individual object. This stored procedure is a baseline sproc that lets you set the properties of every object in a DB to a given value. For example, if you baseline your database at 1.5.0, you can set […]

You rated this post out of 5. Change rating

2005-03-02 (first published: )

194 reads

Technical Article

SQL Server Database File Sizes

  • Script

This script creates a SQL_Statistics table in the Mater Database and then scroll through the existing databases on the server and gathers the Servers Name, logical device name, the file name and the file size and writes it to the table alond with a date time stamp.We run it once a month to gather the […]

You rated this post out of 5. Change rating

2005-02-22 (first published: )

526 reads

Blogs

Top 8 Courses to Learn SQL for Data Science in 2024 & Beyond

By

In the realm of data science, SQL (Structured Query Language) reigns supreme. It's your...

Going to Cloud? Look at the Shared Responsibility Model

By

The bottom line here is this: the idea that a CSP takes care of...

How Long Will It Take to Learn SQL? The Truth Might Surprise You

By

In today's data-driven world, SQL (Structured Query Language) is a blazing-hot skill. It's your...

Read the latest Blogs

Forums

Restore dbs

By mtz676

The below code works for backup files only from local drives. When replaced with...

Fine-tune SQL for better performance

By don075

I have been asked to fine-tune the following SQL that was written by a...

Row-level security in SQL server

By dzukik0711

In this scenario, I seek assistance in implementing row-level permissions for a table named...

Visit the forum

Question of the Day

Initial Config of tempdb

What are the initial config sizes for the tempdb primary data files, secondary data files, and log files in SQL Server 2022?

See possible answers