January 5, 2012 at 2:10 pm
Issue: When choosing Modify -> Trigger using SSMS Express Edition the Query Window opens with the trigger code duplicated twice in the window (example):
Line: Code:
1 USE [database]
2 GO
3 <standard SET code here>
4 ALTER TRIGGER [dbo].[trigger_name]
5 <blah blah>
6 END
7 GO
8
9 USE [database]
10 GO
11 <standard SET code here>
12 ALTER TRIGGER [dbo].[trigger_name]
13 <blah blah>
14 END
15 GO
My co-workers query window shows only one set of the code when he opens the same trigger. In addition, when I open a Stored Procedure it opens without the duplication. Is there some kind of option that turns on duplicating the code for a trigger back-to-back in the query window?
Thanks!
January 5, 2012 at 2:23 pm
Sounds like the template on your machine has been modified.
This link should help:
January 5, 2012 at 2:27 pm
Thanks - excellent suggestion. I checked this template and it seems OK:
--======================================
-- Alter T-SQL Trigger Template
--======================================
USE <database_name, sysname, AdventureWorks>
GO
ALTER TRIGGER <schema_name, sysname, Sales>.<trigger_name, sysname, uStore>
ON <schema_name, sysname, Sales>.<table_name, sysname, Store>
AFTER <data_modification_statements, , UPDATE>
AS <T-SQL_statement, , UPDATE Sales.Store SET ModifiedDate = GETDATE() FROM inserted WHERE inserted.CustomerID = Sales.Store.CustomerID>
GO
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply