Forum Replies Created

Viewing 15 posts - 361 through 375 (of 413 total)

  • RE: Add column to table in stored procedure

    Glad to hear that you solved the problem

    I still don't like changing a table in a stored procedure. What happens if a user...

  • RE: Linked server stored proc never returns

    Hi Dilip,

    I am through step 1 and a window ("Distributed COM Configuration Properties") opens. But I can't locate "My Computer" here... I apologize if this is easy, I am a...

  • RE: Deleting Duplicate Data

    Or use "not in" instead of "in"

    My suggestion would be the following:

    delete dups where pk != (select min(dups2.pk) from dups dups2 where dups2.foo =...

  • RE: Linked server stored proc never returns

    I asked the same question a couple of weeks ago:

    Insert into problem with linked server

    I never solved the problem...   And...

  • RE: cumulative running total in a query?

    You need to be able to sort the rows in your table in some way such that you can tell where to begin and where to end your calculation (in other words,...

  • RE: SQL Newbie here... how would u solve for this

    Ray, I was a little puzzled about the number 675 in your requested output, but if it should be 672 instead, then the following should work:

    select

      row1.AppID as AppID,

      row1.score...

  • RE: corelated subquery to join query

    Thanks, Phil, for this explanation - I didn't know what a corelated subquery was. I should also mention that my query is nothing but your view idea - except that...

  • RE: corelated subquery to join query

    This is my understanding of a join query

    Could you be more specific as to how you have access to data?

  • RE: corelated subquery to join query

    Or you could try this:

    update c

    set c.sumorders = t.sum

    from copy_orders c inner join

    (select orderid, sum(quantity) as sum from [order details] group by orderid) t

    on c.orderid = t.orderid

  • RE: corelated subquery to join query

    Without having tested anything, I guess that the following query gives the same result:

    update [copy_orders]

    set sumorders=(select sum(quantity) from [order details]  od

    where od.orderid=[copy_orders].orderid)

    That's a simplification but still not a join

  • RE: SQL Newbie here... how would u solve for this

    Using Ray's table definition, maybe something like this is what you want?

    select t1.appID, t1.score as score1, t2.score as score2 from

    TestTable t1 inner join TestTable t2

        on t1.appID = t2.appID

    where

       ...

  • RE: Add column to table in stored procedure

    I have tested in on my db and I have no problems adding two cols to a table in a stored proc. Try cutting off everything else in your sp...

  • RE: omit part of WHERE clause?

    Could you post some sample data and the output you want (for different @varCat values).

     

  • RE: How to generate primary Keys?

    I have never worked with Oracle - could you describe further, please?

  • RE: sp_who

    Try something like

    create table spwhotbl

     (

      spid int,

      ecid int,

      status varchar(50),

      loginname varchar(100),

      hostname varchar(100),

      blk int,

      dbname varchar(100) null,

      cmd varchar(20)

    &nbsp

    go

    insert into spwhotbl exec sp_who

    The table definition may need minor modifications...

Viewing 15 posts - 361 through 375 (of 413 total)