Forum Replies Created

Viewing 15 posts - 76 through 90 (of 342 total)

  • RE: SQL Problem with case statement

    Sorry - As I look again at the original SELECT, there is a RobinOnTime = CASE clause. If this is a variable, you probably need an @ symbol. ...

  • RE: UDF's vs. SP's and optimization

    Great thread! Lots of good comments. We work with larger tables (Millions of rows) and find that using OR is a performance killer more often than not. ...

  • RE: SQL Problem with case statement

    I believe you need an ELSE statement in the second CASE.

    Guarddata-

  • RE: how can i do this -EXEC IN

    Looks like the first column was names Solok instead of Silok...

    Just for curiosity - how many rows are in SilokE and mhlkot?

    Guarddata-

  • RE: how can i do this -EXEC IN

    Assuming you are in Sql2000, you will need the line to read

    EXEC sp_executesql @sqlCmd. I always forget EXEC in front

    If you are in Sql 7.0,...

  • RE: how can i do this -EXEC IN

    DECLARE

    @sqlCmd NVARCHAR(1000),

    @mh-2 VARCHAR(10),

    @mha VARCHAR(50)

    SET @mh-2 = '1,2,3'

    SET @mha = 'WHERE mhlkot.mhlka_id IN (' + @mh-2 + ')'

    SET...

  • RE: Stuck in SQL update

    Good job ghughes. You don't need to include the master table the second time, but you did fix a problem with J Moseley's earlier update statement by including the...

  • RE: Stuck in SQL update

    I don't know how you tested TOP. Remember that we are talking about SELECT TOP N...ORDER BY. It may be able to use in index if the statistics...

  • RE: Stuck in SQL update

    J Mosely, Thank you for simplifying my query. I wasn't thinking clearly . Your update is much nicer than the one I created even...

  • RE: Stuck in SQL update

    ghughes - I realize that orderid is the common field. The real question is...Can there be duplicate NoteIDs? If not, my query should have worked. You may...

  • RE: Stuck in SQL update

    ghughes...it sounds like the NoteID can be duplicated for an OrderID. Is that correct? If so, my proposal will not work. Johnathans solution should work except that...

  • RE: Stuck in SQL update

    Hopefully this is a one-time occurrence. If not, you may choose to use a trigger to keep the information updated.

    You might try

    UPDATE master SET OM_NOTES =

    ( SELECT SUBSTRING(...

  • RE: Complicated SQL Query

    This seems to be more of a presentation question. Can you just have the interface perform the data hiding? That way the repeated entries can be hidden -...

  • RE: Variable Questions

    And I imagine that you are saying ...

    WHERE simtask.round = ' + CONVERT( VARCHAR(4), @roundX ) + ' AND....

    Since you are building a string to execute, you need to convert...

  • RE: Scientific Number Format

    You could try something like

    SELECT CONVERT( DECIMAL( 12,2), CONVERT( FLOAT, '8.2360569935143943E-3' ))

    Guarddata-

Viewing 15 posts - 76 through 90 (of 342 total)