Unix Technical Forum

Create trigger - do users need to be out?

This is a discussion on Create trigger - do users need to be out? within the SQL Server forums, part of the Microsoft SQL Server category; --> I created and successfully tested a trigger on a test database. Now that I want to put this on ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 07:50 PM
rdraider
 
Posts: n/a
Default Create trigger - do users need to be out?

I created and successfully tested a trigger on a test database. Now that I
want to put this on a production system, the create trigger statement takes
way too long to complete. I cancelled after a few minutes. The test
trigger took just a second to create. The test and production databases are
identical in design. Only difference is that there are users in the
production system.

Any ideas?
Thanks


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 07:51 PM
MGFoster
 
Posts: n/a
Default Re: Create trigger - do users need to be out?

rdraider wrote:
> I created and successfully tested a trigger on a test database. Now that I
> want to put this on a production system, the create trigger statement takes
> way too long to complete. I cancelled after a few minutes. The test
> trigger took just a second to create. The test and production databases are
> identical in design. Only difference is that there are users in the
> production system.


When someone is accessing the target table you can't add anything to it
(indexes, triggers, constraints, etc.). Best to add the trigger during
off-hours.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 07:51 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Create trigger - do users need to be out?

rdraider (rdraider@sbcglobal.net) writes:
> I created and successfully tested a trigger on a test database. Now
> that I want to put this on a production system, the create trigger
> statement takes way too long to complete. I cancelled after a few
> minutes. The test trigger took just a second to create. The test and
> production databases are identical in design. Only difference is that
> there are users in the production system.


Does the trigger by chance access a linked server?

Else, I guess it could be blocking from a running query. Use sp_who
to determine if you have any blocking. The Blk column is non-zero if
the spid on the row is blocked. Blk is the spid of the blocker.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com