Forum Replies Created

Viewing 15 posts - 2,386 through 2,400 (of 8,731 total)

  • RE: Help with a PIVOT

    Is this what you need? Note that instead of pivot I'm using cross tabs and instead of unpivot I'm using CROSS APPLY.

    SELECT RowId,

    MAX( CASE WHEN ExSubCat...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Issue with slow find and replace function code from a lookup table can I do this in a better way

    Northern Monkey (8/3/2016)


    I have some dim tables for find and replace for colours and sizes as I have multiple columns in a table that could hold the value see below

    ,FilterColour=CASEWHEN(SELECT...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Object Explorer Details & undocumented system stored procedures

    Brandie Tarvin (8/3/2016)


    . I assume I open a trace against the server I'm browsing as opposed to my local machine?

    Exactly, unless they're the same. I did that to reduce noise...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    Hugo Kornelis (8/3/2016)


    Ed Wagner (8/3/2016)


    crookj (8/3/2016)


    djj (8/3/2016)


    Grumpy DBA (8/3/2016)


    djj (8/3/2016)


    Ed Wagner (8/2/2016)


    Audience

    Mob

    Mafia

    Made

    Created

    Born

    This way

    Out

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: select parent/ child records in same table

    I'm sorry, I didn't realized that the id values had gaps.

    Here's a script that might help you and others for future references.

    CREATE TABLE [dbo].[instrument_ref](

    [instrument_id] [int] NOT NULL,

    [description] [nvarchar](100)...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: select parent/ child records in same table

    Your sample data doesn't seem to correspond with your expected results. Are you missing tables?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: PLEASE HELP - Pivot just not working

    Use Cross tabs instead. I'm not sure if there's only one date per month so I included a range, but you can change the condition as needed.

    SELECT SUM( CASE WHEN...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    Ed Wagner (8/2/2016)


    Ray K (8/2/2016)


    Ed Wagner (8/2/2016)


    Y.B. (8/2/2016)


    Revenant (8/2/2016)


    crookj (8/2/2016)


    Ray K (8/2/2016)


    Ed Wagner (8/2/2016)


    whereisSQL? (8/2/2016)


    Grumpy DBA (8/2/2016)


    Ed Wagner (8/2/2016)


    jasona.work (8/1/2016)


    scratch

    Itch

    Floozy

    woozy

    Sleep

    Wake

    Stir

    Stick

    Ball

    Volley

    Serve

    Food

    Please

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Is there an "easy" way to do this?

    Going further on J Livingston's formula.

    DECLARE @str VARCHAR(100) = 'Discontinued Rx # 0011122657 via Prescription File'

    SELECT SUBSTRING(@str,19,10) AS FixedLength_FixedPos,

    SUBSTRING(@str,PATINDEX('%[0-9]%',@str),10) AS FixedLength_VarPos,

    SUBSTRING(@str,19,PATINDEX('%[0-9] %',@str)-18)...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How Far Have You Traveled for a SQL Saturday?

    Rod at work (8/2/2016)


    Eric M Russell (8/1/2016)


    Maybe local user SQL Server groups should organize van pools for out-of-town SQL Saturday events. Not only would it help mitigate the expense of...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Grumpy DBA (8/2/2016)


    Phil Parkin (8/2/2016)


    I just read a post on another site which suggested using a 'carrot' as a column delimiter, rather than a comma.

    Took me a moment to realise...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Datatype performance - in theory there should be a difference, but in practice is there?

    Quick tought.

    Test for performance instead of trying to guess.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to get rid of implicit conversions ??

    The only way to avoid implicit conversions is to change the data types in the tables or making them explicit which isn't an improvement over implicit ones.

    You could try Eirikur's...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    BrainDonor (8/2/2016)


    Anybody remember DataEase? They've 'relaunched' the DOS version:

    http://www.dataease.com/test_article_view/?ArticleID=00122&field1=00122

    Sorry, I wasn't born yet.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    djj (8/1/2016)


    Ed Wagner (8/1/2016)


    whereisSQL? (8/1/2016)


    Ray K (8/1/2016)


    djj (8/1/2016)


    Grumpy DBA (8/1/2016)


    crookj (7/29/2016)


    whereisSQL? (7/29/2016)


    Khakis

    BDUs

    Fatigues

    Outerware

    Underwear

    Laundry

    Dirty

    Bleach

    chlorine

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 2,386 through 2,400 (of 8,731 total)