Forum Replies Created

Viewing 15 posts - 61 through 75 (of 160 total)

  • RE: Forcing a Select to use a specific index

    John Rowan (9/2/2009)


    1. Yes. The query optimizer will analyze the query, the table/index structure, and the data distribution and determine the most optimal query plan for that query. ...

  • RE: Creating an index

    Clive Strong (9/1/2009)


    Very true...If only my company would let me get my hands on EE!!

    As for moving data from certain tables from production to development, you can use SSIS/DTS, BCP,...

  • RE: Creating an index

    Clive Strong (8/29/2009)


    What Version of SQL?

    1. Depends - table and index. It would be best to do it during maintenance in many cases.

    3. There is downside to...

  • RE: Creating an index

    CirquedeSQLeil (8/28/2009)


    meichner (8/28/2009)


    I am not really a DBA, but I have assumed the role because of cutbacks. I need to add an index to a few of my tables...

  • RE: Multi Row Subquery

    Mansfield (7/16/2009)


    The second "1" is just a constant. For example, if you do the following:

    SELECT 1 FROM SaleOrderDetails

    Then it will just return a single column with 1 in it,...

  • RE: Multi Row Subquery

    manish.singh (7/16/2009)


    Hi,

    You can use the following querry for better performance

    SELECT h.SOID, h.CustomerNumber, h.PoNumber

    FROM SalesOrderHeader h

    WHERE EXISTS

    (Select top 1 1

    ...

  • RE: Multi Row Subquery

    Tim Mitchell (7/13/2009)


    Sure... you can actually do a DISTINCT query on all items:

    SELECT DISTINCT h.SOID, h.CustomerNumber, h.PoNumber

    FROM SalesOrderHeader h

    INNER JOIN SalesOrderDetails d ON h.SOID = d.SOID and d.ItemToSell = 'CAR'

    This...

  • RE: Multi Row Subquery

    Tim Mitchell (7/13/2009)


    The query you've written appears to be valid. However, a better performing and more commonly accepted methodology is to use a JOIN rather than a subquery in a...

  • RE: A question about Constraints

    Lynn Pettis (6/1/2009)


    meichner (6/1/2009)


    I put a constraint on the Shipping Details to make sure that the SOID and the Line # exist in the Sales Order Detail.

    ... It seems...

  • RE: How to preserve trailing spaces

    FelixG (5/15/2009)


    If all you wanna do is to have a 300 char field containing all the 10 description fields from the legacy table... you just have to do this:

    Insert last_table...

  • RE: How to preserve trailing spaces

    RBarryYoung (5/15/2009)


    Florian Reischl (5/15/2009)


    RBarryYoung (5/15/2009)


    FelixG (5/15/2009)


    Vrachar type removes trailing spaces... you must use the CHAR type

    It doesn't seem to be doing that on my system:

    --========

    declare @s-2 varchar(30)

    declare @t...

  • RE: How to preserve trailing spaces

    Ken Simmons (5/15/2009)


    I was thinking the same thing as Florian.

    Something like...

    MainTable

    MainTableID

    OtherFieilds

    MainTableDscr

    MainTableID

    DscrID

    DscrTable

    DscrID

    That's a similar approach to the one I wanted to take. Unfortunately I have no choice in the matter.

    DscrSequence

    Dscr

  • RE: How to preserve trailing spaces

    Florian Reischl (5/15/2009)


    Sounds like a normalization problem. What about a description table with a foreign key and a sequence instead of concatenated multi-value column? You will run into huge performance...

  • RE: How to preserve trailing spaces

    The reason behind this is hard to explain. Let me try.

    I am interfacing to a table in a legacy system that has 10 description fields defined as Desc_1, Desc_2, Desc_3,...

  • RE: How to preserve trailing spaces

    Thanks. I had a feeling that I would have to change the datatype from VarChar to Char. I was hoping that there was something else that I could have...

Viewing 15 posts - 61 through 75 (of 160 total)