Article ID: 2606883 - Last Review: April 16, 2012 - Revision: 4.0 FIX: Slow performance when an AFTER trigger runs on a partitioned table in SQL Server 2008 R2 or in SQL Server 2012
On This PageSYMPTOMSConsider the following scenarios:
In this scenario, slow performance might occur. Additionally, many logical reads might occur if you run SQL Profiler. CAUSEThis issue occurs for the following reasons:
RESOLUTION
To resolve this issue, apply the following hotfix and then use the -T2470 trace flag The fix for this issue was first released in Cumulative Update 1 for SQL Server 2012. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
|
| File name | File version | File size | Date | Time | Platform |
|---|---|---|---|---|---|
| Sqlservr.exe | 2009.100.2776.0 | 43,053,920 | 15-Sep-2011 | 01:47 | x86 |
For all supported x64-based versions of SQL Server 2008 R2 SP1
Collapse this table
| File name | File version | File size | Date | Time | Platform |
|---|---|---|---|---|---|
| Sqlservr.exe | 2009.100.2776.0 | 62,176,608 | 15-Sep-2011 | 00:57 | x64 |
For all supported IA-64–based versions of SQL Server 2008 R2 SP1
Collapse this table
| File name | File version | File size | Date | Time | Platform |
|---|---|---|---|---|---|
| Sqlservr.exe | 2009.100.2776.0 | 122,105,696 | 15-Sep-2011 | 00:23 | IA-64 |
WORKAROUND
To work around this issue, change the AFTER trigger to an INSTEAD OF INSERT trigger or to an INSTEAD OF DELETE trigger.
For example, you run the following statements to create an AFTER trigger:
In this scenario, change the AFTER trigger to INSTEAD OF INSERT by using the following statements:
For example, you run the following statements to create an AFTER trigger:
CREATE TRIGGER TR_Test ON Test FOR INSERT
AS
BEGIN
DECLARE @groupe INT
SELECT TOP 1 @groupe=Groupe FROM INSERTED
END
GO
CREATE TRIGGER TR_Test ON Test INSTEAD OF INSERT
AS
BEGIN
DECLARE @groupe INT
SELECT TOP 1 @groupe=Groupe FROM INSERTED
INSERT INTO Test (Groupe) SELECT @groupe FROM INSERTED
END
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Other Resources
Other Support Sites
- Solution Centers
- Microsoft Fix It Solutions
- Windows Help and How-to
- Office Online
- Microsoft Partner Network
Community
Get Help Now
Article Translations
- Brasil (Português)
- Česká republika (Čeština)
- Deutschland (Deutsch)
- España, Latinoamérica (Español)
- France (Français)
- Indonesia (Bahasa Indonesia)
- Italia (Italiano)
- Nederland (Nederlands)
- Polska (Polski)
- Portugal (Português)
- România (Română)
- Slovenská Republika (Slovenčina)
- Türkiye (Türkçe)
- Việt Nam (Tiếng Việt)
- Ελλάδα (Ελληνικά)
- Россия (Русский)
- भारत (हिंदी)
- ไทย (ไทย)
- 대한민국 (한국어)
- 中国 (简体中文)
- 台灣 (繁體中文)
- 日本 (日本語)
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
