Forum Replies Created

Viewing 15 posts - 31 through 45 (of 101 total)

  • RE: How to import data from text file into SQL

    Hi

    This isn't a perfect solution but it might get you a step closer.

    Try a bulk insert. You will need to define your table structure and you will also need...

  • RE: inner join in the same table

    You need to combine GROUP BY and a CASE statement:

    select doctor_code, sum(case when patient_code = '0000' then totaltests else 0 end)

    from YOUR_TABLE

    group by doctor_code

    You can add more columns with...

  • RE: Again recursive problem

    Does this union query get you the right results?

    SELECT PC.MainProductID AS partnumber, sum(P.ProductWeight * PC.quantity) AS weight

    FROM #myparts P INNER JOIN #mycombinations PC ON (P.ProductID=PC.SubProductID)

    WHERE ProductType <>7

    GROUP BY MainProductID

    UNION ALL

    SELECT...

  • RE: Where do I start?!

    Sounds like a great outcome - and a boss who is happy to delegate properly!

    All the best.

  • RE: Excel import truncates at 255 characters

    There is nothing more annoying than finding a forum post describing the exact problem you have.... but no answer!

    Which is exactly what happened to me when I...

  • RE: Excel import truncates at 255 characters

    Just in case anyone else ever hits this problem, the solution is to add a row near the top of the worksheet that contains your maximum string length. In...

  • RE: Where do I start?!

    I've been in a similar (though not quite as messy) situation as the one you described.

    If I was in your situation then I would be very keen to...

  • RE: How to select data in t-sql

    Jeff Moden (3/9/2009)


    Bevan keighley (3/9/2009)


    Or this works as well:

    Select t3.ID From #TEST t3 Where t3.COUNTRIES in ('AU', 'IN')

    except

    Select t3.ID From #TEST t3 Where t3.COUNTRIES not in ('AU', 'IN')

    Looks slower based...

  • RE: How to select data in t-sql

    or slightly fast if there is a clustered primary key on ID and countries...

    Bevan

  • RE: How to select data in t-sql

    Or this works as well:

    Select t3.ID From #TEST t3 Where t3.COUNTRIES in ('AU', 'IN')

    except

    Select t3.ID From #TEST t3 Where t3.COUNTRIES not in ('AU', 'IN')

    Looks slower based on execution plan but...

  • RE: How to select data in t-sql

    If you want to exclude those ID's that have other countries besides AU and IN then use this:

    SELECT ID

    FROM TEST

    WHERE ID IN (Select t2.ID From TEST t2 Where t2.COUNTRIES='AU')

    AND COUNTRIES...

  • RE: stored proc parameters

    Use default values for your parameters and then check if any have been changed...

    The following is untested but will give you an idea:

    Create Procedure proc1

    @p1 int =1,

    ...

  • RE: Adding ID columns to tables for primary key

    The monotonically increasing requirement comes about because when you are adding rows to a table, you do not want to be attempting to add them to database pages that are...

  • RE: Adding ID columns to tables for primary key

    There are probably quite a few opinions out there as to what is best and to be honest it really depends on your particular business circumstances.

    The things I take into...

  • RE: Normalization

    veena (3/2/2009)


    hi,

    thank you for replying....

    For Some reason i want to Store TableA id in TableC....

    Plz Tell me Whether i can do this in a database where Normalization rules are applied?

    regards

    veena

    Well......

Viewing 15 posts - 31 through 45 (of 101 total)