I don't remember where I found this little gem, but as a VB Developer it has simplified retrieving dates on many projects. Simply pass the function a datetime value and the format that you want in VB style syntax and the date is properly returned. I have modified it slightly from the original author (who […]
2004-07-23 (first published: 2004-06-24)
313 reads
This procedures grants execute permissions to all the stored procedures in a database to the role/user supplied as the parameter. the default is Execute_StoredProcedure. Execute this procedure local to the database you need to grant permissions.
2004-07-22 (first published: 2004-06-21)
359 reads
Removes double spaces in a string, leaving all words seperated by a single space. Run in Query Analyzer.
2004-07-21 (first published: 2004-07-05)
271 reads
Counting the number of ocurrences of characters in a string can be useful, and this script will do the job. It can easily be modified to be a function or to search for ocurrences of strings. Run it in Query Analyzer.
2004-07-20 (first published: 2004-07-05)
155 reads
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)
378 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,030 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)
685 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)
472 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)
365 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)
893 reads