Forum Replies Created

Viewing 15 posts - 14,086 through 14,100 (of 14,953 total)

  • RE: Removing empty carriage returns

    Matt:

    I just tested the CLR UDF vs a straight-up replace. I may have done something incorrectly, since this is the first time I've used a CLF UDF, so please...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Removing empty carriage returns

    My last example:

    update dbo.Table

    set Column = replace(Column, '

    ', '

    ')

    Will do exactly what you're talking about.

    1

    2

    3

    4

    5

    6

    7

    Will turn into:

    1

    2

    3

    4

    5

    6

    7

    Whole table, all at once, all rows.

    Matt: On the RBAR thing, it looked to...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: adp,parameters in functions, subsequent views

    In my last job, I spent 6 years managing an Access app on top of an SQL database. I had a lot of forms that used functions and were...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Simplified WHERE clause???

    In the actual execution, yes, it stops after the first true test in the Case statement. When building the execution plan, it has to check all of them, and...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: CTE's are useless

    The only time to compromise on performance is when integrity would be threatened by it. Integrity first, performance second.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: SELECT DISTINCT on Long Table

    With data that doesn't update constantly (like several dozen/hundred/thousand/million changes per hour), this is a pretty common solution.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Limiting impact of poorly designed queries

    It sounds like you've got a decent handle on what to do.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Recursive Queries in SQL Server 2005

    john.racer (4/21/2008)


    The basic business requirement is to roll sales up from employee to lead to manager to director. We have much movement in our sales organization. We want to historically...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Removing empty carriage returns

    And, as per the original post, if you want to keep double-returns, and get rid of single, try something like this:

    declare @test-2 varchar(100)

    select @test-2 = '1

    2

    3'

    select @test-2 = replace(replace(replace(@test, '

    ',...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Removing empty carriage returns

    Okay, I have to ask if this is being over-complicated. Why not just:

    declare @Test varchar(100)

    select @test = '1

    2

    3'

    select @test = replace(@test, '

    ', '')

    select @test

    That works for me. I...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Replace non numeric characters in string

    Yeah, telling a regex to keep an "e" or "E" if it's after a number and before another number or a "+" or "-" which is followed by another number,...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Logical Reads

    Often, SQL Server will reduce the amount of work an inner query does if the outer query can limit the rows for the inner query. I'd have to at...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Performance Problem with SQL Server 2005

    It looks to me like you're on the right path.

    What else is running on that server? SQL Server doesn't "play nice", when it comes to taking over RAM and...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: How to write update trigger in sql database with current system date

    I'm not clear on what you're trying to do.

    If you just want to know what date is 3 days from now (which is what I'm reading the first part of...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Simplified WHERE clause???

    Roy Ernest (4/21/2008)


    The Basic reason why I prefer Case over OR is it is much more easier to read. Especially when there are more than one OR condition. It really...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 14,086 through 14,100 (of 14,953 total)