Forum Replies Created

Viewing 15 posts - 2,431 through 2,445 (of 5,841 total)

  • RE: Replacement for a whole mess of left joins?

    See if this helps:

    CREATE TABLE dbo.#responses (serial tinyint NOT NULL)

    CREATE TABLE dbo.#otherdata2 (serial tinyint NOT NULL, variableid tinyint NOT NULL, TextVal varchar(10) NULL)

    INSERT dbo.#responses VALUES (1)

    INSERT dbo.#responses VALUES (2)

    INSERT dbo.#otherdata2...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    Let me try to put together a quickie demo to see if what I am thinking will work in this case. I have come across your situation before so...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    One question: is the numeric value that indicates each "type" of value fixed? If so I think I can come up with something to get what you need in...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    You want this one Sean?!? You are WELCOME to it!! 😛

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    Sean Lange (8/21/2013)


    TheSQLGuru (8/21/2013)


    I would have appreciated a warning to take a deep breath and be sitting down before I opened up that file and saw the query therein!! :w00t:

    EAV...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    Looks like some very ugly EAV crap..., er, design. 😀

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    BTW, I don't need (or want) any type of production data. Simple dummy stuff that matches requirements is best...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    I would have appreciated a warning to take a deep breath and be sitting down before I opened up that file and saw the query therein!! :w00t:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    erikd (8/21/2013)


    Sean - yeah, I sort of figured. I was hoping there was a general rule for a situation like this. Assuming I'm just looking for direction and not a...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: does it make difference nvarchar(50) or nvarchar(500)

    aykut canturk (8/21/2013)


    dear friends,

    I'm just confused about varchar and nvarchar types. I learned that nvarchar holds unicode character sets and varchar cannnot. varchar doubles the size. thats fine.

    What I confused...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: When I put my Where clause on Qry will not return data

    lisa.ogle (8/21/2013)


    Not sure why but any suggestions?

    Select Distinct

    M.Memid,

    M.Fullname,

    E.enttype,

    EK.planid,

    Ek.Carriermemid HICN,

    EK.effdate EffectiveDate,

    BP.upid ContractPBP,

    PA.CreateDate,

    PA.Comment,

    PA.[Source],

    PA.CompleteDate

    From dbo.Member M

    Left Join dbo.Entity E

    on E.entid=M.entityid

    Join dbo.EnrollKeys Ek

    on EK.Memid=M.Memid

    Join dbo.BenefitPlan BP

    on BP.Planid=EK.planID

    ...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Why queries are using certain indexes

    Even IF your 2 queries are logically equivalent (which I am not going to bother to figure out), the optimizer is just like any other piece of software. It...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Replacement for a whole mess of left joins?

    erikd (8/21/2013)


    Hi,

    A bit of a general question:

    I have a query with 28 LEFT JOINS. 20 of them join one table to the original query in order to break information out...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Format varchar to currency.

    CASE WHEN @money < 0 THEN '(' + CAST(@money AS varchar(20)) + ')' ELSE CAST(@money AS varchar(20)) END

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Format varchar to currency.

    CRAP!! I went backwards!! Just a sec and I will have a fix ...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 15 posts - 2,431 through 2,445 (of 5,841 total)