Viewing 15 posts - 48,091 through 48,105 (of 49,552 total)
Assuming that HistoryID is the primary key....
DELETE FROM HistoryTable
WHERE HistoryID NOT IN
(SELECT Top 15 HistoryID FROM HistoryTable
ORDER BY UpdTimestamp DESC)
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
December 8, 2007 at 1:13 pm
Grant Fritchey (12/7/2007)
The main reason I've received for not using bit fields is because they don't allow null values.
They accept nulls just fine (unless defined not null). At least...
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
December 8, 2007 at 1:03 pm
use Query analyser to run the delete.
Deletes can run for a long time, and the query time is probably exceeding the timeout value for the application that you're using. Query...
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
December 7, 2007 at 5:31 am
Note that that's for varchar(max) or nvarchar(max) The largest number that you can use to define a varchar is 8000 (as in varchar(8000)) and 4000 for nvarchar (nvarchar(4000))
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
December 7, 2007 at 1:26 am
Ramesh (12/7/2007)
Create a non-clustered index on columns server, customer and add audit_output as include column.
audit_output is ntext, and as such can't be used as an include column.
Even if changed...
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
December 7, 2007 at 12:43 am
As first suggestions... These may not be completely optimal, as I don't hav your queries, I don't know the data distribution and I can't see the exec plans
Clustered index on...
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
December 7, 2007 at 12:39 am
They are column statistics created by SQL when it filters or joins on a column that doesn't have an index or existing stats.
They're there to tell the optimiser aproximatly...
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
December 7, 2007 at 12:24 am
TheSQLGuru (12/6/2007)
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
December 6, 2007 at 11:54 pm
That's not a very nice trigger.
Frank Lain (12/6/2007)
select @key = cashlist_key from INSERTED
What happens if more than one row is inserted in a batch?
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
December 6, 2007 at 11:41 pm
SQL Server Express Management Studio?
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
December 6, 2007 at 11:40 pm
Ramesh (12/6/2007)
Jai,I appreciate your feedback but, dynamic SQL is not always the best choice, but the last choice if all else fails!!!!!
Performance-wise, with this kind or requirement it sometimes...
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
December 6, 2007 at 12:47 am
Do you have a recent database backup? How critical is the data in that table?
You have some corruption in your data file, probably a data page that's damaged.
Run the following...
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
December 6, 2007 at 12:02 am
Perfomance-wise it's a bad idea to change the value of parameters in a proc before using them. Confuses the optimiser's row estimates.
Rather define a local variable, set the variable's value...
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
December 5, 2007 at 11:39 pm
TheSQLGuru (12/5/2007)
I personally LOVE such situations (and countless others out there)!!! It is one of the main reasons my services are in such high demand. 😎
If I was contracting...
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
December 5, 2007 at 2:10 pm
Not from the trace itself, as far as I know. What you can do is create a lookup table with the event ids and the text values, then join 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
December 5, 2007 at 2:03 pm
Viewing 15 posts - 48,091 through 48,105 (of 49,552 total)