Viewing 12 posts - 136 through 147 (of 147 total)
Check for an insert trigger.
I've seen ridiculously inefficient triggers resulting in high CPU and IO.
September 2, 2008 at 7:31 am
There is a sneaky way of doing this described here:
September 1, 2008 at 3:46 pm
The common approach in a client/server, or web based application is to use optimistic locking.
This article explains it well:
August 22, 2008 at 8:13 am
To simplify the request, with this data:
create table a (id int identity(1, 10) primary key clustered, dummy_col uniqueidentifier)
create table b (id int identity(1, 1) primary key clustered, dummy_col uniqueidentifier)
insert a...
August 22, 2008 at 7:27 am
rbarryyoung beat me to it, but I'll post this anyway. It does what you want, although not as useful as his view.
set nocount on
create table #temp(namet varchar(255),countf varchar(255))
exec sp_MSforeachtable...
August 21, 2008 at 11:57 am
I said it might be more efficient.
You can never tell for sure without testing. Comparative performance depends on data volumes, statistics, indexes, etc.
August 21, 2008 at 10:07 am
What percentage of these rows actually need to be rtrimmed?
I'm just wondering if adding
WHERE MRN <> RTRIM(MRN)
would make any difference.
It will still perform the initial scan, but if the index...
August 20, 2008 at 6:00 pm
How about using a derived table
Update s
Set s.load_end_dts = GetDate()
From dbo.s_table as s
Join (Select UserId, Min(Load_Dts) as MinDts From dbo.s_table Group By UserId) as z
On s.UserId = z.UserId And s.Load_Dts...
August 20, 2008 at 5:32 pm
charshman (8/20/2008)
August 20, 2008 at 5:02 pm
What you are suggesting is very dangerous.
Who will populate your search table? What checks will you have in place to prevent something inefficient from being generated?
If you end up with
WHERE...
August 20, 2008 at 6:01 am
In response to sunjiulu's query, you don't need a cross-tab.
A bit of magic with XML is all that's required:
SELECT d1.tablename,
(SELECT STUFF(sep, LEN(sep), 1, '')
FROM (
SELECT columnname + ',' AS [data()]
FROM...
August 19, 2008 at 11:25 am
I presume you are reading about functions.
The WITH SCHEMABINDING clause prevents the object(s) referenced by the function from being altered or dropped.
This can also be used with the CREATE VIEW...
August 16, 2008 at 5:19 pm
Viewing 12 posts - 136 through 147 (of 147 total)