Removing double spaces in a string
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
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)
377 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,029 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)
471 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)
891 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)
714 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,525 reads
By Brian Kelley
A few months ago I started using Deepstash. Deepstash breaks books into the key...
By Brian Kelley
Do you have a case where you have a named instance you'd like to...
I’ve been running this blog on Hugo for a long time, and like most...
Comments posted to this topic are about the item Admin Rights for Everyone
Comments posted to this topic are about the item Kerberos Authentication for Aurora PostgreSQL:...
Comments posted to this topic are about the item RegEx Functions I
Which of these RegEx functions need compatibility level 170 in SQL Server 2025?
See possible answers