Scripts

Technical Article

Find All Code with Rollback Tran but No Begin Tran

This simple script identifies all objects which have a rollback transaction statement without a requisite begin transaction statement. If a rollback statement is issued without a begin statement, then the code will generate an error. Triggers are not included in the list since they can have a rollback without a begin. This script can be […]

You rated this post out of 5. Change rating

2006-01-09 (first published: )

341 reads

Technical Article

Script To Get the Report Execution log, ex. timetaken .

this script lists the report Execution History ex: timetaken to render, retreive data, number of records retreived and their size etc.. in descending order of its execution timeReports the ReportName, its Path , TimeTaken to execute the report, retreive the data, render the report, total count of rows returned and the total data returned in […]

5 (1)

You rated this post out of 5. Change rating

2006-01-06 (first published: )

229 reads

Technical Article

Scripting extended properties

I use these to manage the addition and removal of extended properties on all tables and columns in my company's dbs.Rather than writing complicated joins or calling functions every time, I use views on sysobjects and INFORMATION_SCHEMA tables. I tried to make these scripts as flexible as possible so you can reuse them in procedures, […]

5 (1)

You rated this post out of 5. Change rating

2006-01-05 (first published: )

1,231 reads

Technical Article

List user's permissions

With this script you can see the permissions that every user-defined role and every user without a dbrole has.The list could get very large and hard to manage, but it helped me to build the roles of an app that didn't had any role defined.Hope it'll be usefull to someone

2 (1)

You rated this post out of 5. Change rating

2006-01-02 (first published: )

705 reads

Technical Article

Change column collations back to database default

This script will create a single-line ALTER TABLE statement for each column in any table to change the collation to match the 'database default'. This is best accomplished in the Query Analyzer -- simply run the script, select all the records, and paste them into a new window to run them.

You rated this post out of 5. Change rating

2005-12-29 (first published: )

2,093 reads

Technical Article

Number of words within a phrase function

Most word count functions/procedures are based on some form of looping methods. If the table is large or there is a need to count the words in a number of columns, this can become quite an exercise. This function, based on a mathematical model, will work much faster and more efficient in counting the words […]

You rated this post out of 5. Change rating

2005-12-28 (first published: )

271 reads

Technical Article

sp_gen_checksum_selects

Compile in master. Set your QA output to text. When run from the db of interest it generates checksum select statements for each user table in the db composed of the PK columns and a checksum for all columns excluding text, ntext, image and sql-variant. There are no parameters. Modify for your own use. Save […]

You rated this post out of 5. Change rating

2005-12-19 (first published: )

178 reads

Technical Article

Script To Compute Checksum Of The Text Field

It is a known fact, that checksum function can not be applied to text, ntext and image fields. But sometimes it is necessary to compare whether a value in a text field has changed (although it is not guaranteed that checksum generates a unique value, but it still could be used as a good estimator). […]

You rated this post out of 5. Change rating

2005-12-16 (first published: )

1,125 reads

Blogs

Spark Connect Dotnet November 2024 Where are we?

By

All Spark Connect Posts Introduction There have been quite a few changes in the last...

A New Word: Ochisia

By

ochisia – n. the fear that the role you once occupied in someone’s life...

Create a Numbers Table in Power Query

By

This is a quick blog post, mainly so I have the code available if...

Read the latest Blogs

Forums

Issue with DBMail

By richardmgreen1

Hi all   We've got 3 servers with the same setup for dbmail. They...

Counting values with hysteresis in Report Builder

By UltraFan47

Hi, I have a set of data (for instance sine wave) and I need...

Export Data-tier Application vs Generate Script: Why Does SQL Server Have Both?

By Ivan

Hey everyone, SQL Server has two mechanisms for deploying and moving a database to...

Visit the forum

Question of the Day

What's the Ceiling?

What do I get as the results from this code?

SELECT CEILING (999.999), CEILING (-999.999);

See possible answers