Scripts

Technical Article

Script Table Data to Insert Statements

This script will create a series of insert statements for a given table. It does not support every single data type in every way and has some limitations. If you add any enhancements, please send them to me at bbyrd@intellithought.com so I can update it here. Update (28 Feb 2005): Added support/Fixed bug with smalldatetime […]

4.25 (8)

You rated this post out of 5. Change rating

2006-01-11 (first published: )

4,925 reads

Technical Article

User-Defined string Functions Transact-SQL

GETWORDCOUNT, GETWORDNUM, AT, RAT, OCCURS,CHRTRAN, STRFILTER, PADC, PADR, PADL, PROPER, RCHARINDEX etc. AT, PADL, PADR, CHRTRAN, PROPER are similar to functions Oracle PL/SQL INSTR, LPAD, RPAD, TRANSLATE, INITCAP. In my humble opinion, it will be convinient to apply such functions for writing of stored procedures and User-Defined Functions on Transact-SQL. Please, download the file http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,27115

You rated this post out of 5. Change rating

2006-01-10 (first published: )

1,536 reads

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: )

230 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: )

708 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,144 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: )

272 reads

Blogs

Azure SQL offerings

By

There are three Azure SQL products with so many different deployment options, service tiers,...

T-SQL Tuesday #183 Roundup

By

I hosted this month’s T-SQL Tuesday party with my invitation asking about tracking permissions....

A Little Brainstorming with an AI

By

I was asked to do some a little thinking and brainstorming recently. Rather than...

Read the latest Blogs

Forums

MEMORYBROKER_FOR_RESERVE experience

By tony28

Hi, Does anyone have experience with MEMORYBROKER_FOR_RESERVE ? when suddenly there is somehow constantly...

Moving Database Files

By Ahr Aitch

I just learned that my database was created on my C:\ drive in the...

Migrate MSSQL to MYSQL - Different Servers

By cajun_sql

I am needing to migrate a MSSQL db to MySQL, on a different server...

Visit the forum

Question of the Day

Mixed Backups

I have a complex database with a few filegroups and files. Can I run a backup command like this? (assume file/filegroup names are valid).

BACKUP DATABASE [complex]
    FILE = N'thirdone'
 ,  FILE = N'thirdtwo'
 ,  FILEGROUP = N'second' 
 TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL16.SQL2022\MSSQL\Backup\complex.bak' 
 WITH NOFORMAT, NOINIT,  NAME = N'complex-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

See possible answers