Forum Replies Created

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

  • 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) values('2015-11','IN','B4','92')

    insert into...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • RE: Are the posted questions getting worse?

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


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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.


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • 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...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • RE: Find hierarchyID from different parts of a node?

    Jeff Moden (3/17/2016)


    yb751 (3/17/2016)


    Sigh, so close!

    Tested, Jeff's technique and it works great. Had to make some modifications to the code to work with my data but it wasn't too...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

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