Forum Replies Created

Viewing 15 posts - 796 through 810 (of 1,347 total)

  • RE: Stuck - Cant figure out a Query for this situation

    MYSQL 5.0 ? Why post the question on a MS SQL Server forum ? You'll likely get answers that use non-MYSQL 5.0 features. For example, does MYSQL implement derived tables...

  • RE: Optimized SQL Statement

    >>.Then probably the best way to do this would be use the Undocumented Stored procedure

    This would probably be the absolute worst way, since:

    - the SQL is dynamic, therefore not pre-compiled...

  • RE: eliminating rows with duplicate subsets in select query

    Select Name, Min(Length) As Length

    From tblDataType

    Group By Name

  • RE: Could not complete cursor operation because the table schema changed after the cursor

    Here's an example to get you started. This is a single UPDATE that removes the need for cursors DPC_1 and DPC_2 and the 2 WHILE loops.

    When you express it like...

  • RE: Could not complete cursor operation because the table schema changed after the cursor

    >>Oh yea, I did not create this, but have been giving the task to keep up with it.

    If at all possible you should track down the original author and insert...

  • RE: DTS: Text Source and Environment Vars

    In DTS, you generally do stuff like this by having the package contain an initial ActiveX script task. This task modifies the properties of the other package tasks and connections....

  • RE: Trigger Help!

    You are joining to the 'inserted' table twice, and you are still hitting records not in the inserted set. Also, you are taking the LEFT() of a string and then...

  • RE: Trigger Help!

    >>so you're saying something like this

    >>on inserted.dialemptyID = d.dialemptyId

    If DialEmptyID is the unique/primary key, then yes, that's exactly what's needed.

    The 'inserted' table is just a virtual table that is...

  • RE: Dropping and Re-creating Indexes

    There shouldn't be any repercussions. Just remember to use the most optimal Drop/Create sequence.

    Drop non-clustered first, then clustered

    Re-create clustered first, then non-clustered

    The only question really is, why is it not...

  • RE: Trigger Help!

    >>worked great by inner joining the inserted

    It works, sure, but if ProjectID is not the unique identifier of DialEmpty, then that UPDATE will also hit rows that were not recently...

  • RE: Trigger Help!

    We need to know the PRIMARY KEY or the UNIQUE row identifiers of the DialEmpty table.

    For a trigger like this, you need a correlated UPDATE between inserted and DialEmpty and...

  • RE: SQL Sorting Question

    This should do it:

    select sect_id,cat_id,sub_id,cat_nam

    from category

    order by

      sect_id,

      cat_id,

      Case When sub_id = 0 then 0 Else 1 End,

      cat_nam

  • RE: replacing a subquery with a join

    >>I will use the strange join statement i came up with.

    I suspect you will end up double-counting and generating an incorrect SUM() value.

    Look at your original sub-query - why did you...

  • RE: replacing a subquery with a join

    Alternatively, you can pre-select into a temp table and join to it:

    Select distinct B.PackingSlipID

    Into #PackingSlips

    from CustInvoiceTrans A

    Inner Join CustPackingSlipTrans B

      ON (A.InventTransID=B.InventTransID And A.ItemID=B.ItemID And A.SalesID=B.SalesID)

    Where A.InvoiceID like...

  • RE: Index hints and top operatror

    >>the same as the clustered sort order

    That's kinda the crux of the whole issue. "Clustering" is a vendor & version dependant physical implementation. There is really no such thing as...

Viewing 15 posts - 796 through 810 (of 1,347 total)