Forum Replies Created

Viewing 15 posts - 76 through 90 (of 1,240 total)

  • Reply To: Query Help - History Table with no range data.

    Without wanting to pile-on, there's no 31st of September either and there's a Sale Date in your Desired Results picture that's not in Table 1.

    You'll generally find most people around...

    • This reply was modified 4 years, 10 months ago by  Neil Burton.
  • Reply To: Quick query help

    select 
    LEFT(filename,LEN(filename)-CHARINDEX('\',REVERSE(filename)))
    from master..sysaltfiles

    That should do it.

  • Reply To: String extraction - SQL 2012

    pwalter83 wrote:

    Neil Burton wrote:

    DECLARE 
    @String VARCHAR(100) = 'CKflower2002-pouch-5AR-OneSize'
    select
    SUBSTRING(@string,PATINDEX('%[0-9]%',@string),PATINDEX('%[^0-9a-z]%',@string)-PATINDEX('%[0-9]%',@string))

    That will work for whatever the first delimiter is and for any length of string before the numbers.  It does...

  • Reply To: The Triple Update

    Jeff Moden wrote:

    Thomas Rushton wrote:

    From the post:

    Not sure where this is useful or why it's there, but if anyone uses this, let us know.

    If you yabingle "quirky update", you'll find examples of...

  • Reply To: String extraction - SQL 2012

    DECLARE 
    @String VARCHAR(100) = 'CKflower2002-pouch-5AR-OneSize'
    select
    SUBSTRING(@string,PATINDEX('%[0-9]%',@string),PATINDEX('%[^0-9a-z]%',@string)-PATINDEX('%[0-9]%',@string))

    That will work for whatever the first delimiter is and for any length of string before the numbers.  It does assume that...

    • This reply was modified 4 years, 10 months ago by  Neil Burton.
    • This reply was modified 4 years, 10 months ago by  Neil Burton.
  • Reply To: String extraction - SQL 2012

    select REPLACE(REPLACE(SUBSTRING('CKnovelty2002_pouch-5AR-OneSize',1,CHARINDEX('_','CKnovelty2002_pouch-5AR-OneSize',1) - 1),'CKnovelty',''),'CKflower','')

    Your CHARINDEX was looking for '-' rather than '_'.

  • Reply To: Are the posted questions getting worse?

    Lynn Pettis wrote:

    Eirikur Eiriksson wrote:

    MVDBA (Mike Vessey) wrote:

    don't - I went once and it was "an experience" (this is from Wikipedia)

    Kæstur hákarl, fermented Greenland shark.

    Súrsaðir hrútspungar, the testicles of rams pressed in blocks, boiled...

  • Reply To: Are the posted questions getting worse?

    Steve Jones - SSC Editor wrote:

    Glad to see everyone is talking about SQL Server stuff. Hope you've had a good last month.

    The end of last month was fantastic because I had a week in...

  • Reply To: Error on executing rename statement

    You need to run

    EXEC sp_rename

    and remove the ''GO'.  That is a batch separator so your IF is technically in a different piece of code from your ELSE.

  • Reply To: tempdb shrinking

    If I remember rightly it's something to do with execution plans that use temp tables but don't take my word for that.

  • Reply To: tempdb shrinking

    This post helped me in a similar situation.  There might be a couple of other things you need to do but that was a good place to start.

  • Reply To: How to write loop below with best practice performance ?

    Sometimes a loop is the best way to do something.  Doing something iteratively can be one of those times.  Have you tested the performance of a loop? Do you know...

  • Reply To: Are the posted questions getting worse?

    Stopped gigging a while back, now it is only for my personal pleasure (read: when no one else is at home)

    Same here, it's one of the disadvantages to the 9-5...

  • Reply To: Are the posted questions getting worse?

    jonathan.crawford wrote:

    Jack's just kinda boring, that's all. It's not "bad", like undrinkable or anything, but it's not interesting either.

    Some of the special Jacks are much better.  I don't think they're...

  • Reply To: Are the posted questions getting worse?

    ChrisM@Work wrote:

    jasona.work wrote:

    OK, so I'm curious and interested in expanding my repertoire when it comes to liquor...

    Whiskey / whisky vs scotch, and, what's so bad about Jack D?

    (Note, I've only...

Viewing 15 posts - 76 through 90 (of 1,240 total)