Forum Replies Created

Viewing 15 posts - 76 through 90 (of 49,552 total)

  • RE: Table level constraints vs. column level constraints

    You were trying to add a check constraint, therefore I mentioned check constraint in my reply, not because only check constraints are invalid.

    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: General audit / monitor question

    And you'd create the AuditImport procedure in the database where you want the data to be imported to, not where the tables being audited are (shouldn't be the same place,...

    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: Unable to start the trace

    SELECT * FROM sys.traces (fn_trace_getinfo has been deprecated for years)

    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: Casting one datetime as date converts other datetime fields

    Then consider the possibility that the problem is not in SSIS, but in Toad's display of the data that SSIS has loaded.
    Double-check in SSMS before you go digging...

    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: Casting one datetime as date converts other datetime fields

    If it's happening in SSIS, then that's a problem. I can see a client tool weirdness, but SSIS is another matter.

    Assuming SSIS is inserting into some table with...

    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: Casting one datetime as date converts other datetime fields

    What client is that?

    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: Casting one datetime as date converts other datetime fields

    Screenshot please? And where are you running this from?

    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: Unable to start the trace

    Again, you don't have to run the setstatus separately (and you probably shouldn't), the script already contains the line to start the trace.

    So leave...

    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: Unable to start the trace

    What error are you getting?

    Note that you don't have to run sp_trace_setstatus separately. It's part of the script already,

    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: Two constraints under column definition?

    The first is the syntax for a default constraint (enforce a default value for a column). The second is referencing another block of syntax for creating check, unique and foreign...

    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: Table level constraints vs. column level constraints

    https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-2017

    You will note that ALTER TABLE ... ALTER COLUMN don't allow for the addition of a check constraint. You want ALTER TABLE ... ADD CONSTRAINT,...

    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: Troubleshooting Deadlock, Victim holding on to shared lock

    Probably because it's in the process of reading the table and needs locks on both pages as it's locating the data. The ad-hoc SELECT, which is the one that has...

    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: @@TRANCOUNT (variable or function)

    Nothing. It has no special meaning by itself.

    This works fine, but has no meaning difference to any other variable
    DECLARE @@i INT
    SET @@i = 1;

    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: Recovery of database

    Depends on how that snapshot is taken. Is it a block-by-block copy it's fine to checkDB.

    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: Recovery of database

    You don't. Run CheckDB.

    NorthernSoul - Thursday, October 11, 2018 6:43 AM

    You could try and restore it and see if it fails.

    Nah, I've...

    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 - 76 through 90 (of 49,552 total)