Viewing 15 posts - 47,191 through 47,205 (of 49,552 total)
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
March 12, 2008 at 3:39 am
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
March 12, 2008 at 3:24 am
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
March 12, 2008 at 3:04 am
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
March 12, 2008 at 2:20 am
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
March 12, 2008 at 2:16 am
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
March 12, 2008 at 2:00 am
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
March 12, 2008 at 1:18 am
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
March 12, 2008 at 1:13 am
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
March 12, 2008 at 12:50 am
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
March 12, 2008 at 12:42 am
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
March 12, 2008 at 12:22 am
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
March 8, 2008 at 8:34 am
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
March 8, 2008 at 8:32 am
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
March 7, 2008 at 1:52 pm
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
March 7, 2008 at 1:45 pm
Viewing 15 posts - 47,191 through 47,205 (of 49,552 total)