Scripts

Technical Article

Generate "CREATE...FOR ATTACH" stmt. dynamically

In instances where you have over 16 data files, or you need to move data files to a new location when you are moving a database you must use a CREATE...FOR ATTACH statement.  This script will generate the CREATE...FOR ATTACH statement dynamically given a database name.  It will take into consideration the file sizes, growths […]

You rated this post out of 5. Change rating

2003-05-07

221 reads

Technical Article

Restrict simultaneous access to resources

This set of procedures allow you to control simultaneous access to any resource you are using. It mimics the behaviour of a Semaphore in programming.A typical problem where you need this, is when you have a computational intensive procedure you only want to be started a limited number of times.First, add a record to the […]

You rated this post out of 5. Change rating

2003-05-07

278 reads

Technical Article

Returning data with col number

This script enables you to return data from SQL Server's table without specyfing the name of the column .All you only need to supply is the column number, that you want the data from. In the example we want to chose all rows from the second column (categories table - northwind) Column number is based […]

You rated this post out of 5. Change rating

2003-05-07

165 reads

Technical Article

UDF to get first date or trim time for Datepart.

Not long ago I was in a forum discussion when someone presented another way to get the date with time value of midnight by doing similar to thisDATEADD(dd,DATEDIFF(dd,0,@DATE),0)Which I find is much cleaner than any other option I have seen or tried myself. Seeing this I realized there are many other dates that can be […]

4 (1)

You rated this post out of 5. Change rating

2003-05-02

477 reads

Technical Article

fnArabToEnglish

Last year I pulished a function ,named fnArabToEnglish,which can convert a arabic number to english ,such as turn 1234.56 to 'one thousand two hundred thirty four and cents fifty six'.Mr Rick send me a message with a bug of thefunction today,I get rid of the bug and publish the second time.I hope you like this […]

You rated this post out of 5. Change rating

2003-04-30

60 reads

Blogs

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...

Microsoft finally adds Tenant Switcher for Fabric / Power BI

By

Praise whatever deity you believe in, because it’s finally here, a tenant switcher for...

Read the latest Blogs

Forums

It's The People

By Grant Fritchey

Comments posted to this topic are about the item It's The People

To View or not to View, that is the question...

By pietlinden

I've read lots of the horror stories about nested views in databases where they're...

Grant user read-write permission to a single database

By PJ_SQL

Hello! How do I grant a user to read-write to a single database and...

Visit the forum

Question of the Day

The Density Vector

When building statistics, there is the concept of density that refers to the duplicates in a table. How is this calculated?

See possible answers