Forum Replies Created

Viewing 15 posts - 421 through 435 (of 920 total)

  • RE: Truncate real/float to two digits

    How about

    cast(round(float_num,2) as numeric(20,2))


    And then again, I might be wrong ...
    David Webb

  • RE: Please Help me improve this SPROC!!! It runs too slow!

    So, if you're going to filter this by criteria other than just period, what are you going to use. That may have a large impact on the index you...


    And then again, I might be wrong ...
    David Webb

  • RE: The Logic, Mathematics, and Utility of NULLs

    Redefining NULL on a whim? You can't redefine something that doesn't have a good definition to start with. N/A, unknown, not yet entered, incomplete, etc. can all be...


    And then again, I might be wrong ...
    David Webb

  • RE: The Logic, Mathematics, and Utility of NULLs

    Yep, that pretty well sums it up. I've been reading Hugh Darwen for a couple of days and working through Tutorial D and the Rel implementation. 6th normal...


    And then again, I might be wrong ...
    David Webb

  • RE: The Logic, Mathematics, and Utility of NULLs

    WOW, over my head on the first post. OK, I'll just grab the popcorn and sit back and absorb.

    Carry on.


    And then again, I might be wrong ...
    David Webb

  • RE: Please Help me improve this SPROC!!! It runs too slow!

    The indexing advice will certainly improve the performance of the query. Many of us have inherited similar structures and I've found that it's usually worth the effort, in the...


    And then again, I might be wrong ...
    David Webb

  • RE: Please Help me improve this SPROC!!! It runs too slow!

    The period column is a datetime datatype and your argument is a varchar. This might be better:

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_NULLS ON

    GO

    -- =============================================

    -- Author: <Author,,Name>

    -- ALTER date: <ALTER...


    And then again, I might be wrong ...
    David Webb

  • RE: Stored procedure

    If you have to use a case statement, then this is what you're going for, I think:

    UPDATE dbo.tbl_Cpay

    SET Cpay_Stop = CASE WHEN Cpay_Stop IS NULL

    THEN CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ELSE...


    And then again, I might be wrong ...
    David Webb

  • RE: Stored procedure

    You still have a problem with both the select and update statements.

    This statement:

    SELECT @Cpay_Stop = Cpay_Stop

    FROM dbo.tbl_Cpay;

    will select every row in the table because there is no 'where'...


    And then again, I might be wrong ...
    David Webb

  • RE: Odd sort with BIN2 Collation and non-printable ASCII

    Just to add to the confusion, this works the way I think you want:

    select b from a order by cast(b as varbinary)

    but I don't have a good explanation as to...


    And then again, I might be wrong ...
    David Webb

  • RE: Data goes missing when maually add via Sql Server 2005

    1- The row gets added to the table and is physically placed based on whether the table is a heap or has a clustered index. How it gets retrieved...


    And then again, I might be wrong ...
    David Webb

  • RE: DBCC SHOW_STATISTICS with HISTOGRAM_STEPS

    And no other SQL shows up on that spid? Just that sp execution and the DBCCs it spawns? Can you see the processes running on the SQL Server...


    And then again, I might be wrong ...
    David Webb

  • RE: DBCC SHOW_STATISTICS with HISTOGRAM_STEPS

    I've never seen this, either. Does a profiler trace show any other interesting SQL being issued by that spid? Is there a cross-server join goin on?


    And then again, I might be wrong ...
    David Webb

  • RE: Insert slowing down

    Is there a trigger on the table? If so, can you post the code for the trigger and any table it references?


    And then again, I might be wrong ...
    David Webb

  • RE: Insert slowing down

    You said you checked the script durations. Did you do that with sql profiler or was that taken from some application log? Is the log set to autogrow?...


    And then again, I might be wrong ...
    David Webb

Viewing 15 posts - 421 through 435 (of 920 total)