Viewing 15 posts - 181 through 195 (of 548 total)
It's interesting how in this discussion we have all been very busy trying to map numbers to the days of the week to 'make sense out of them' and to...
February 19, 2010 at 2:18 pm
svansickle (2/19/2010)
SELECT DATENAME(weekday, 'CCYY-MM-DD') does it for me. I would hope that this builtin function handles different DATEFIRST settings correctly.
Don't forget language issues. Where I am, when I do
SELECT...
February 19, 2010 at 6:20 am
In many cases, I can do what I have to do by simply capturing the weekday values for a known saturday and sunday, like so:
declare @dowSat int
declare @dowSun int
set @dowSat=datepart(dw,'20061028')
set...
February 18, 2010 at 10:20 pm
Well, after some hard looking around I found the cause. It appears that some nitwit dba at this site for some reason created a db schema called 'DBO'. While this...
December 14, 2009 at 5:24 am
David,
You say everything can be done with machine code.
But does machine code understand the concept of tables?
Or do you insert the concept of tables into your machine code?
And you say:
Data...
December 12, 2009 at 10:39 am
Mitesh, it was mentioned earlier that using varchar(max) solves the problem of data loss.
November 27, 2009 at 12:52 am
OK. I see it now. Missed out on the 5K+5K.
And the HasSpaces will benefit more any algorithm that does particularly poor with strings having no double spaces.
November 25, 2009 at 2:08 am
C#Screw
I decided to look at your benchmarking script and I must say there are many interesting things.
By the way, why does Mitesh have a run count of only 1?
And why...
November 25, 2009 at 1:35 am
The problem is replicate which will not return more than 8000 characters.
Thus this works just fine.
declare @STR varchar(max)
declare @s1 varchar(max)
declare @s2 varchar(max)
declare @s3 varchar(max)
set @s1=replicate(' ',4000)
set @s2=replicate(' ',4000)
set...
November 24, 2009 at 6:55 am
Very strange this MAX stuff on SS2005. The code below behaves very strange. I.e. I set a string to 8004 characters and yet the LEN function shows it to be...
November 24, 2009 at 6:25 am
Interesting idea. And it's collation insensitive too.
But this approach will lose data!
Thus try:
DECLARE @STR VARCHAR(8000)
set @STR='*' + replicate(' ',7998) + '*'
select @STR
select
November 24, 2009 at 5:18 am
Jeff Moden (11/22/2009)
C# Screw (11/22/2009)
:satisfied:!!!!Wait a minute - I thought I was onto something!!!!!!:satisfied:This works nicely without the Nested replace:-):-):
Very cool revelation but I'd suggest using the same spacing scheme...
November 23, 2009 at 5:37 am
The problem is the where clause in your function.
It gets interpreted only once.
November 23, 2009 at 3:50 am
C#Screw
My compliments on this neat cleanup engine. Here are some comments:
In the 32+1, 16+1, etc part of the code, you need to add an extra replace of two spaces with...
November 23, 2009 at 2:31 am
Paul,
BOL doesn't explain the guts of what goes on behind collate.
I'm no expert on collate but I have a rough feeling of what it is all about.
This little example makes...
November 22, 2009 at 1:49 pm
Viewing 15 posts - 181 through 195 (of 548 total)