I had a developer in my company come to me recently with a unique request. He asked if there was any way for sql to return a result set that was flopped. In other words he wanted the rows to be columns and the columns to be rows. So that a result set like this:Col1 […]
2004-07-19 (first published: 2004-07-02)
344 reads
The purpose of this task is to generate a report showing all your foreign keys. Generally this would be considered nothing special only that this script also returns the tables, column foreign key constraint name and the relationship properties.Here's how to do it:First of all copy the script and paste it in Query AnalyzerStep 1: […]
2004-07-16 (first published: 2004-07-02)
1,004 reads
The script finds occurrences of string(s) in stored procedures, triggers and views. You can use typical boolean logic as described in the script comments. Very useful. It was found on the companion cd to [Gurus Guide to Transact-SQL] by Henderson. I left in the original credits. Excellent procedure. Some may scoff but I place it […]
2004-07-15 (first published: 2004-07-02)
655 reads
This stored precedure can be used within a scheduled job to UPDATE STATISTICS on a data during off hours.I have commented out a parameter used to limit the size of tables to UPDATE STATISTICS. Script uses the Northwind database.Have a GREAT day!!
2004-07-14 (first published: 2004-07-02)
453 reads
SQL Server returns numeric values always in a internal format. The conversion of numeric values into a language specific format is usually part of the client. With this User Defined Function, you can do thison your backend. The function expects 3 parameters: The numeric value, the requested language and the number of decimals (will be […]
2004-07-13 (first published: 2004-07-02)
302 reads
Do you ever need to look for a given user's permissions for security reasons or move the permissions for that user from test environment to production? This is a script, which will generate print statements, which can be use to view/grant, the permissions of all dbo objects, which the given user has, which is not […]
2004-07-08 (first published: 2004-01-16)
871 reads
My first stab at a script, I have a dev server will 60 + db'sI wanted to db size + log size in a more centralised location.
2004-07-07 (first published: 2004-01-09)
699 reads
This script will generate and populate a table variable with a stipulated number of unique 8 randomly generated character alphanumeric values. This can be useful in situations where one has to allocate passwords or unique id to users. It accepts one input parameter "@HowMany int" representing the number of these alphanumeric values to generate; default=500.Usage: […]
2004-07-06 (first published: 2004-01-09)
3,252 reads