Forum Replies Created

Viewing 15 posts - 47,191 through 47,205 (of 49,552 total)

  • RE: Trouble writhing the code for a new trigger

    You can't have 2 primary keys on a table. If you mean it's a 2-column primary key, then you need to use both.

    So:

    inserted.ESSN = deleted.ESSN AND inserted.SSN = deleted.SSN

    The point...

    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: Trouble writhing the code for a new trigger

    Mostly complete.

    If you want to insert into an errors table, do it right after the rollback transaction. You can also use the raiserror to send an error back to 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: Trouble writhing the code for a new trigger

    Try something like this. Untested. Please test carefully.

    CREATE TRIGGER trg_PreventInvalidHours ON works_on AFTER UPDATE AS

    IF EXISTS (

    SELECT 1 FROM inserted i inner join deleted d on i.<Primary Key Column>...

    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: SQLserver.com clock wrong?

    There's some problem with the time zones I think. For me the time shows 11:18, but it's actually 10:18. My timezone is set to GMT + 2, no DST

    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: Torn Page Recovery -- DBCC CHECKDBFails

    Find your latest backup and restore it.

    Based on the error, I would guess that page 126 holds part of one of the system tables. CheckDB canot fix a DB if...

    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: Learning more about cached execution plans

    For all queries SQL executes, the plans are cached and reused. Adhoc or procedures.

    Views by themselves do not have execution plans. When a view is queried, SQL expannds the view...

    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: sp_configure 'Allow updates', 1 DOES NOT WORK

    The DAC connection will let you read the base system tables, not change them.

    You cannot (and should not) change the system tables in sQL 2005.

    What are yuo tryng to do?...

    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: Update Statistics job failed.

    Did the service restart? Are there any errors in the SQL error log from around the same time?

    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: Updating SQL Server Tables via .aspx built with VWD Not Working

    If you have access to SQL Profiler, run it against the SQL server while testing out your web page. You'll be able to see if the delete, insert or update...

    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: GROUP BY WITH CUBE query

    Does this help you? Cube and Rollup

    Like many things in SQL, it probably has a performance impact, but if you need the summary rows it produces, then you need 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: GROUP BY clause without an aggregate

    Group by without a distinct has the same effect as DISTINCT. sometimes there are minor differences behid the scenes, but usually not.

    When you use GROUP BY, you're telling SQL 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: Where are stored the stored procedures?

    And if using SQL 2005, there's no need for code to reconstruct procedures from syscomments as you can seelct rather from sys.sql_modules, which does not split objects into 4000 character...

    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: Varchar(max) problem in SQL server 2005

    The only thing I can find on storage of Varchar(max) is that 'SQL decides' (Inside SQL Server 2005: T-sql Programming)

    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: Where are stored the stored procedures?

    SELECT object_name(id) FROM syscomments where [text] like ....

    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: How to eliminate KeyLookUp in queryplan

    Jeff Moden (3/6/2008)


    The join needs to be part of the covering index or you will only get a scan.

    True, which is why I removed the suggestion about INCLUDE (and yes,...

    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 - 47,191 through 47,205 (of 49,552 total)