Forum Replies Created

Viewing 15 posts - 346 through 360 (of 627 total)

  • RE: Help with PIVOT

    Luis Cazares (4/11/2016)


    yb751 (4/11/2016)


    Pretty cool technique I learnt from Luis. 😉

    You just made my day 🙂

    I learned this concatenation method from Wayne Sheffield, which he explains it in here: http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    And...

  • RE: Help with PIVOT

    Hey this is an example using a dynamic solution.

    create table #TEST

    (

    YearMonth varchar(10),

    PatientStatus varchar(10),

    Location varchar(10),

    PatientVisits int

    )

    DECLARE @sql VARCHAR(MAX)

    insert into #TEST(YearMonth, PatientStatus, Location, PatientVisits) values('2015-10','IN','B4','103')

    insert into #TEST(YearMonth, PatientStatus, Location, PatientVisits)...

  • RE: Help with PIVOT

    This can also be achieved using crosstabs which have the benefit of being simpler and faster. You'll still need to come up with a dynamic solution though.

    SELECT

    PatientStatus,

    Location,

    MAX(CASE WHEN YearMonth...

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (4/7/2016)


    Chocolatey is amazing. If you haven't tried it, I recommend it. I've used it more and more, grabbing software as I need it rather than...

  • RE: CONCAT

    Seems to me like you got tripped up because you copy and pasted the code from online documentation. For future reference keep in mind why the square brackets are...

  • RE: Convert a string with an array of variables?

    Phil Parkin (3/31/2016)


    Sergiy (3/30/2016)


    Solution is suprisingly simple.

    1. Create a "translation" table:

    CREATE TABLE #Mapping (

    FromChar NCHAR(1) PRIMARY KEY,

    ToChar NCHAR(1)

    )

    INSERT INTO #Mapping ( FromChar, ToChar )

    SELECT 1, 'A'

    UNION ALL

    SELECT 2, 'B'

    UNION...

  • RE: Are the posted questions getting worse?

    Damn it guys! Do you realize how hungry you're all making me right now?!? LOL

  • RE: Joining Multiple Tables

    I don't recommend using 'comma' joins as this is not the standard and easier to make a mistake. Learn and use JOIN...trust me you'll be better off for it.

  • RE: Varchar usage

    GilaMonster (3/29/2016)


    yb751 (3/29/2016)


    I could have sworn I remember reading that declaring larger column sizes than required could cause some inefficiencies. i.e. incorrect estimates, over allocating memory...

    I wouldn't be surprised...

  • RE: Varchar usage

    I could have sworn I remember reading that declaring larger column sizes than required could cause some inefficiencies. i.e. incorrect estimates, over allocating memory...

    I wish I could find good...

  • RE: Backup Sets - Monday Musings

    Lynn Pettis (3/28/2016)


    Personally, every backup to its own file whether full, differential, or transaction log. Also, personal preference is to disk, then if needed backup the file(s) to tape.

    Exactly...

  • RE: Are the posted questions getting worse?

    Jacob Wilkins (3/22/2016)


    Steve Jones - SSC Editor (3/22/2016)


    Alan.B (3/21/2016)


    Quick question: I got the standard email saying that someone replied to a comment on one of the forum threads but when...

  • RE: Are the posted questions getting worse?

    SQLRNNR (3/21/2016)


    Brandie Tarvin (3/21/2016)


    Lynn Pettis (3/21/2016)


    Okay, my daughter and I are in Providence, RI. We were scheduled to do campus visit at Johnson & Wales University this morning but...

  • RE: The New Men of IT

    I've always been truthful and tend to be modest during interviews. I have often wondered if I have lost some opportunities to the liars/exaggerators because the interviewer had never...

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (3/21/2016)


    For those of you with standing desks, ArsTechnica says it may not be helping[/url] you at all.

    ...and 'they' said margarine was better for you. Oh wait, it's...

Viewing 15 posts - 346 through 360 (of 627 total)