Viewing 15 posts - 4,531 through 4,545 (of 6,036 total)
I would store this kind of ranking in separate column and update this column using trigger when data in the table is changed.
This update not suppose to happen to often,...
_____________
Code for TallyGenerator
February 1, 2007 at 12:35 am
sol,
how many records WITHOUT distinct (see Jeff's query) and how "heavy" is each of those records?
I mean what is aggregate size of all columns in your recordset?
_____________
Code for TallyGenerator
January 31, 2007 at 8:59 pm
Locks really depend on data statistics, indexing, etc.
Someone dropped or changed an index on this table, statistics forced Server to choose another execution plan...
It's not so easy to guess,...
_____________
Code for TallyGenerator
January 31, 2007 at 8:52 pm
Because when you have INSERT outside the whole SP appears locked in transaction (INSERT is implicit transaction, right?)
It does not happen if you perform INSERT inside of SP.
_____________
Code for TallyGenerator
January 31, 2007 at 8:48 pm
Try this workaround:
SELECT * INTO #agingData
FROM dbo.agingData
WHERE 1=0 -- copies table structure, no data copied
INSERT #agingData
EXEC dbo.populateAging
INSERT INTO dbo.agingData
SELECT * from #agingData
If it works it's definitely...
_____________
Code for TallyGenerator
January 31, 2007 at 8:09 pm
Jason,
do you read table dbo.agingData inside SP?
It appears locking problem.
If you perform INSERT ... EXEC you lock targeted table. If you are trying to read something from this table...
_____________
Code for TallyGenerator
January 31, 2007 at 8:01 pm
CREATE TRIGGER Trig_vendor_code ON [vendor] FOR UPDATE
AS
UPDATE V
SET vendorcode = i.vendorcode
FROM dbo.Vendor V
INNER JOIN inserted i ON V.origvenid = i.vendorID
WHERE V.vendorcode i.vendorcode -- add NULL checks if...
_____________
Code for TallyGenerator
January 30, 2007 at 1:19 am
CREATE PROC dbo.Blah-blah ..., @NAME varchar(255), ....
AS
...
SET @NAME = replace ( @NAME,char(39),char(39)+char(39))
...
GO
_____________
Code for TallyGenerator
January 28, 2007 at 2:31 pm
DISTINCT is simplest option of GROUP BY.
It makes SQL Server rescan returning resultset and group the data.
It involves creating hash table in tempbd for holding temporary data.
Your query must return...
_____________
Code for TallyGenerator
January 26, 2007 at 10:31 pm
Breaking relational data model and normakization rules is not smart.
It does not simplify your life.
Homogenious data must be in a single column. Period.
And column names [1]...[18] must become numbers in...
_____________
Code for TallyGenerator
January 26, 2007 at 12:02 pm
Look for DATEPART in BOL.
Check cross links there to be aware of other datetime functions.
_____________
Code for TallyGenerator
January 26, 2007 at 11:50 am
I don't see any problems with EAV for those who does not use to use SELECT *
In poperly designed application you need to return FirstName, LastName, etc. once per person....
_____________
Code for TallyGenerator
January 25, 2007 at 11:19 pm
Join to CALENDAR table.
_____________
Code for TallyGenerator
January 25, 2007 at 7:04 am
January 24, 2007 at 11:26 pm
One view could solve all your problems with joins.
_____________
Code for TallyGenerator
January 24, 2007 at 5:02 pm
Viewing 15 posts - 4,531 through 4,545 (of 6,036 total)