Forum Replies Created

Viewing 15 posts - 151 through 165 (of 252 total)

  • RE: Update Statistics Failure with Computed Column

    PS  The computed column uses the formula

    (convert(tinyint,case when ([check_count] = 0) then 0 when ([check_sum] = [pay_line_sum]) then 0 else 1 end))

    I initially cast to a bit.  I changed...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Why must tables have PKs?

    If you ever need to work with the data, then having a PK will make life much easier, even if it is just an identity column.  Perhaps you can argue...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Some stupid Questions before I go into battle

    I might also check the timing of

    delete from ... where 1=0 

    I have come across cases where doing nothing could take a long time. 

     

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Some stupid Questions before I go into battle

    Temp tables, cursors, and execute ad hoc in a trigger!  No wonder you're having problems.  Better check the procs called also. 

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Removing IDENTITY Constraint

    That's what I expected.  I used the VC++ IDE years ago with a database project.  It would do the same thing for you.  It also let you script the change...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Removing IDENTITY Constraint

    Look in BOL for SET IDENTITY_INSERT.  There is info there that should be understood before using this.   

    SET IDENTITY_INSERT [ database. [ owner. ] ] { table } { ON |...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Trigger/Update insterted row with sum values

    The select portion of the query used is the trigger is often the difficult part.  It can be developed and tested in QA before the trigger is even started. 

    If...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Trigger/Update insterted row with sum values

    I would start with georgedo's solution.  You can test the guts of the query on the entire table.  Replace the inserted table with the original trigger table.

          select -- perhaps a...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Trigger/Update insterted row with sum values

    georgedo,

    I was indeed.  Your trigger, without local variables and using group by, is a clear sign you are multirow aware.  And the group by is a clear sign you...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Why Is My Transaction Log Filling Up Really Fast

    Is the problem that the log just keeps getting bigger?  If you do not need transaction log backups for recovery, then you can set the recovery model to simple so...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Trigger/Update insterted row with sum values

    The trigger fires once even if 0, 1 or many records are affected.  Using local variables is not good - please, no cursor in a trigger - in this case...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: How Can I auto sum a Column for every record I select?

    The update query with local variables could also work if the sums are account specific.  A local variable could hold the account number.  If the account number changes, the @Balance...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: How Can I auto sum a Column for every record I select?

    Maybe this would be better - no need for in or out to be zero in Record 1. 

    SET @Balance = Balance = CASE WHEN Record = 1 THEN Balance ELSE @Balance...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: How Can I auto sum a Column for every record I select?

    Since you're processing the records one at a time forward, perhaps an update query using local variables will work.  Putting an order by into an update is not easy - I...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • RE: Best Practice - Copy Database

    I like to use the dts copy objects task as well.  However, I first script the logins using "sp_helprevlogins" - see "Migrating Logins To Another Server" on this site.  This...

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

Viewing 15 posts - 151 through 165 (of 252 total)