Forum Replies Created

Viewing 15 posts - 16 through 30 (of 66 total)

  • RE: Dynamic SQL - Is it possible in this case

    does the table CAF have a column called Currency_ID?

    Do you want to find the corresponding Rate in the Currency table, based on the Currency_ID, and assign the Euro_Value column...

  • RE: Inefficient joins...

    >>INNER JOIN dbo.Table_2 T2 (nolock)

    >>ON T1.column = T2.column

    >>AND ( T2.ID = @ID OR @ID = 0)

    Explain the logic of what you are trying to acheive here. Never use an...

  • RE: Procedure Problem

    Explain (in "pseudo-code", not T-SQL) what you are trying to do.

    Faulty logic that does not work, is all you are showing us.

    Impossible it is, then, to determine your...

  • RE: i have a problem

    >>see the policycode=001 .... when it gets endorse, it gets changed to 001/02

    no! Two columns you should have. Policy Code is "001", and never changes. Other column,...

  • RE: Using NOT EXISTS on composite Key

    very clever ... Approaching the problem from a different point of view, you are! MAX() you may use, instead of SUM, should you desire.

    Beware of EXISTS() .... unless contained...

  • RE: many to many query question

    hm...

    If natural key arises from data, use that you should! A table of US States ... abbreviation, a good key makes, not a "StateID" identity, hm? Too may...

  • RE: many to many query question

    >>Do I have to take any further action (like somehow linking these two columns in the database -- dunno how in mysql)? (My app does this well though already.)

    hmm ......

  • RE: many to many query question

    your primary key should be artistID/productID (a composite primary key).

    if not, a unique constraint you have on those two columns, I hope!

  • RE: Combing row results into a new column?

    One UDF per summary, write you must. Dynamic SQL, a UDF cannot use. Nor can you, in the manner in which you tried. SELECT * FROM @TableName,...

  • RE: Horizontal Partition of states with identity?

    oops.. yes, Yoda had it backwards. Long weekend, indeed!

    Either way, unless a convincing reason is given, done this should not be!

  • RE: Query error ?!!!

    Very nice, David. The force is strong with you!

    Grouping on many non-primary key columns, usually indicates time for subquery (derived table).

  • RE: Horizontal Partition of states with identity?

    Vertical partioning, this is, hm?  Horizontal = moving attributes (i.e., columns) to a new table, not moving rows.  edit: Yoda a little tired from the weekend!

    Why do you feel you must do...

  • RE: Better way to Update only those values changed?

    Why store flag or use CASE expression for each column? if at least one single column changes for a particular row, update all columns you can. By definition, changed...

  • RE: update statement, two linking fields to other table

    hmmm ... Yes, as Celko points out -- fundamental problem with your JOIN, there is. Select Max or Min or some other paritcular value from the joined table, you...

  • RE: update statement, two linking fields to other table

    Fair enough, and very well put!

Viewing 15 posts - 16 through 30 (of 66 total)