Viewing 15 posts - 3,571 through 3,585 (of 6,036 total)
- it opens the recordset (table in this case) once; Cursor only opens one recordset one time in the declaration. Rule met for cursor?
Yes, unless you use FETCH.
September 19, 2007 at 7:36 pm
Create a function dbo.MembersList (GroupID) to build the Members list for any particular GroupId
and run this:
SELECT GroupID, dbo.MembersList (GroupID)
FROM (
select GroupID from YourViewName
GROUP BY GroupID
) DT
This does not use...
September 19, 2007 at 7:05 pm
Net, you probably did not get the point in my initial post.
Trigger must just record PKs of the rows affected by changes.
It must affect just single "trace" table.
Your updates must...
September 19, 2007 at 5:18 pm
Lynn,
Let's do some exercise.
Start Profiler, open Trace Properties, add all "SP" events to selected events list and start the trace.
Now execute procedure.
Find "SP: Recompile" event right after |SP:StmtStarting|SELECT * FROM...
September 19, 2007 at 2:09 pm
Because procedure contains temp table it's recompiled every time it's executed.
On recompilation optimiser checks for existence of all objects mentioned in SP.
Because #fred does not exist and is not created...
September 19, 2007 at 6:07 am
Not really.
Does not fit 1st requirement.
When using cursor you open recordset as many times as many rows it contains.
And in most cases cursors are created to have a chance to...
September 18, 2007 at 10:39 pm
if exists (select * from sysobjects where id = object_id(N'[dbo].[MyTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
PRINT 'MyTable already exists'
else
CREATE TABLE dbo.[MyTable] (
[username] varchar (64) NOT NULL ,
[moduleID] varchar (100)...
September 18, 2007 at 9:56 pm
That's why I always insist on making DEV server the weakest one.
![]()
September 18, 2007 at 7:13 pm
net,
I've got a trigger on one of my tables which processes inserted data in join with data from 4 other tables and 17 views. Then it populates "result" table with...
September 18, 2007 at 2:27 pm
> and there is no preexisting "dates" table to use.
Then create it.
September 18, 2007 at 5:49 am
Execution plan may be changed even if nobody was touching SP for years.
It depends in statistics, on indexes, etc., not only on SP code.
If after next data upload statistics will...
September 18, 2007 at 5:48 am
WHERE
(YourDate >= @FromDate OR @FromDate IS NULL)
AND
(YourDate < @ToDate OR @ToDate IS NULL)
AND
(FirstName = @FirstName OR @FirstName IS NULL)
.....
etc.
September 16, 2007 at 9:27 pm
Viewing 15 posts - 3,571 through 3,585 (of 6,036 total)