Forum Replies Created

Viewing 15 posts - 24,256 through 24,270 (of 49,552 total)

  • RE: Getting current date as part of an Stored Procedure

    Yup. Anywhere after the beginning of the procedure and before you reference the variable in the select statements.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: online = on index option

    Ninja's_RGR'us (8/10/2011)


    Statistics have this behavior. If you use sample 50% this time, then the next time it'll be 50% if you don't specify a new sampling rate.

    Depends how you...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: online = on index option

    But it's not set anywhere. That's not something that's stored anywhere in the metadata. It is purely and solely an option specified for an index rebuild operation and it only...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Getting current date as part of an Stored Procedure

    In your case, because the date you're computing is at midnight, you can just calculate current date at midnight and use an =.

    DECLARE @CurrentDate DATETIME;

    SET @CurrentDate = DATEADD(dd,0,DATEDIFF(dd,0,GetDate()));

    By the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Server is in script upgrade mode. Only administrator can connect at this time

    I think at this point you may need to call Microsoft's Customer Support.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Blocking

    Do you know what those operations are doing? Do you know what effects killing those connections will have on the applications that use the database?

    If you don't and you...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Blocking

    Do you know what it's doing? Do you know what effects killing it will have on the business applications?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: online = on index option

    Metadata? That's just a setting on an index rebuild, not based on metadata

    If you want to change the script, why not a find/replace?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Getting current date as part of an Stored Procedure

    Getdate()

    Just be aware that's date and time to a 3 ms accuracy. If you're using = with it, the other value must match exactly (to 3 ms)

    Generally inequalities are used...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: speed up and lean up my SQL Statement that will be come a view

    Are those DISTINCTs necessary, or are they just there for no good reason

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Rolling back already commited data..?

    If it's Enterprise or Developer edition, create a database snapshot before, revert to it after.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: DBCC SHOW_STATISTICS, Rows and sampled Rows are not match

    colin.Leversuch-Roberts (8/10/2011)


    you may want to try sp_updatestatistics @resample='resample'

    and/or dbcc updateusage(0) with count_rows;

    Update Usage has nothing to do with statistics. It fixes space-used errors in the PFS pages.

    UPDATE STATISTICS <table...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: log growth

    Guess: There's enough free space in the data file, but not in the log.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: query datetime column

    Once more with feeling....

    What is the data type of the ETD and ETS columns in the OceanShipments tables?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Log file corrrupted

    Because it it's just the log damaged, repair_allow_data_loss will rebuild the log. There won't be any data lost, though there may be some transactional inconsistencies (see my blog post)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 24,256 through 24,270 (of 49,552 total)