Forum Replies Created

Viewing 15 posts - 46 through 60 (of 126 total)

  • RE: another problem I can't seem to work out.

    pseudo code??

    declare @max-2 int

    select @max-2 = max(productcontrolid) from productcontrol

    DT1 = select productcontrolid from productcontrol where productcontrolid > @max-2 - 25

    dt2 =...

  • RE: another problem I can't seem to work out.

    Steve Jones - Editor (3/24/2009)


    Which one? Any one?

    I need to update napathirdpartypn.pcid = (unique productcontrolid) from 1 of the 25.

  • RE: @@rowcount

    I figured this out by doing this:

    declare @max-2 int

    select @max-2 = max(productcontrolid) + 1 from productcontrol

    insert into productcontrol (productcontrolid)

    SELECT row_number()...

  • RE: deleting some rows leaving one.

    by George, I think I got it:

    SELECT DISTINCT Application.ApplicationID

    FROM ApplicationProduct WITH (nolock) INNER JOIN

    ...

  • RE: deleting some rows leaving one.

    error on this query:

    Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

    is there an easy way to solve this error?

    SELECT DISTINCT...

  • RE: deleting some rows leaving one.

    Linson.Daniel (3/23/2009)


    Hey FoxJazz,

    I couldnt really read through all the posts..but from what I have understood , ur requirment seems to be that from the set of records having the same...

  • RE: deleting some rows leaving one.

    I created a table that has napathirdparty PN and just put distinct PN's in that one. This substntially fixed the long running query problem that this was doing.

    SELECT DISTINCT MIN(Application.ApplicationID)...

  • RE: deleting some rows leaving one.

    Lynn Pettis (3/23/2009)


    First question, does the following query return the correct result set that you are deleting items based on?

    SELECT distinct

    Application.ApplicationID,

    ApplicationProduct.ProductControlID

    FROM

    ...

  • RE: deleting some rows leaving one.

    Since there is a constraint, I have to delete the applicationid from the application table first, then delete it from the applicationproduct table.

    As seen in the code above.

  • RE: deleting some rows leaving one.

    Chris Morris (3/23/2009)


    There's a DELETE...FROM lurking in here:

    SELECT DISTINCT a.ApplicationID, n.PN, p.PartNumber, c.GenCategoryID

    FROM ApplicationProduct ap (nolock)

    INNER JOIN Application a

    ON ap.ApplicationID = a.ApplicationID

    INNER JOIN Product p

    ON ap.ProductControlID =...

  • RE: deleting some rows leaving one.

    I just finished code that should do that:

    private void button1_Click(object sender, EventArgs e)

    {

    ...

  • RE: deleting some rows leaving one.

    sorta right, but:

    lets say this query gives me a set of the ones I want to delete.

    It certainly doesn't perform as well as the first part.

    SELECT DISTINCT Application.ApplicationID, NapaThirdParty.PN, Product.PartNumber,...

  • RE: T-Sql rant

    Hi all, I didn't mean to have a thread run this long, and move off topic a bunch.

    I did learn some stuff, and very glad I did.

    We have some...

  • RE: T-Sql rant

    J, thanks for the reply. I don't think it's safe to go changing production tables to just have an identity pk.

  • RE: T-Sql rant

    Because when we compare the primary datasource with the data we distribute, it's compared completely within those limits. And for the other datasources, we only need to add them and...

Viewing 15 posts - 46 through 60 (of 126 total)