Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Be Careful with String Concatenations in SQL Server with Big Strings.

 Now, we are going to get slightly esoteric here. I'd noticed that the performance of string concatenation tasks didn't increase in a linear fashion with increasing size of a string. For a short string, it was blindingly fast, but when you scale up, the performance gets disappointing. When you're handling… Read more

22 comments, 2,928 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 16 February 2009

Inserting Markup into a String with SQL

 There are a number of occasions when one might want to insert information at various places in a string. Where one has a template for reporting or emailing, for example; or maybe creating an HTML-formatted result.  Here is a method that I've used a fair amount, and which I'm refining… Read more

6 comments, 650 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 12 February 2009

The Wickedness of the mass 'REPLACE()'

  I have been admonished in the past for the use of this code which makes as many substitutions as you like in a string. However, It has worked on every version of SQL Server I've ever tried it on. I've been using it for years. It has an extraordinary… Read more

7 comments, 545 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 23 January 2009

Sniffing out bogus data

/* Imagine that you have some names and addresses. You are anxious to look at the addresses that may be spurious. As well as looking at such things as the vowel-to-consonant ratio and the digraph frequencies, (see my previous posts) you might want to also look at the…

Read more

2 comments, 211 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 3 November 2008

SQL Server Messages: fairies rearranging furniture.

SQL Server and Sybase are geared up to send information to applications over two distinct channels, the results in one channel that we all know and use that is dedicated to the processing of result sets, and both messages and errors in the other..

Messages were once used a lot… Read more

0 comments, 281 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 20 October 2008

Validating text data. A few techniques.

/*datafile used in the SQL  */

DECLARE @String VARCHAR(MAX)
SELECT  @String = 'When you are starting out to validate text input, perhaps to clean up a database, you will, at some point need to get down to the character level. Doing a simple character frequency of…

Read more

1 comments, 477 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 9 October 2008

Rendering code nicely in blogs and forums.

 I wrote the prettifier specifically to help with posting SQL into blogs and forums. You can find it here http://extras.sqlservercentral.com/prettifier/prettifier.aspx Actually, it is just a stored procedure that does all the work. The website has very little progamming logic in it. (I haven't had a moment to update the prettifier… Read more

3 comments, 518 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 7 October 2008

Un-concatenating row values


/* Anith Sen's achievement, in his article 'Concatenating Row Values in Transact-SQL' has been to list and illustrate the many ways of producing a 'grouping' or concatenation of row values so that the result of this... */
SELECT CategoryId, ProductName FROM Northwind..Products
/*
...can be 'grouped', in a far…

Read more

0 comments, 518 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 6 October 2008

Never say 'never' to the WHILE loop.

/* download the test text file Moby-Dyck.zip here */

/* You might notice that I refer to Moby **** in this blog. This is because the busybodyish nanny software cannot allow me to refer to my test data, the 1851 novel by Herman Melville. This reminds me of when the Royal Society… Read more

16 comments, 803 reads

Posted in Phil Factor's Phrenetic Phoughts: The SQL on 2 October 2008

Newer posts