synchronization script
rgfriend
Posts: 21 Bronze 2
I use SQL compare to compare my dev database with production.
Since I only modify a column 's length to a table, it shows the table schema is different, and all is fine until I get to the generate script screen, I see the script also includes alter trigger of the table.
Nothing actaully changed in the trigger.
And in the review dependency screen, nothing shows there.
So I don't understand why the script include alter trigger statement.
I think the script should only shows the alter column statement.
Thanks
Since I only modify a column 's length to a table, it shows the table schema is different, and all is fine until I get to the generate script screen, I see the script also includes alter trigger of the table.
Nothing actaully changed in the trigger.
And in the review dependency screen, nothing shows there.
So I don't understand why the script include alter trigger statement.
I think the script should only shows the alter column statement.
Thanks
Comments
The only reason for modifying the trigger that I can think of is if the modified column is somehow involved in the trigger definition.
I didn't see why there is a need to refresh the trigger.
So is this a bug of SQL compare?
I would say no it is not a bug if the trigger is indeed dependent upon the modified column. It seems reasonable to me that SQL compare would include the trigger as it does not know what the trigger actually does and what effect modifying the column has on the trigger. In your case probably nothing, since you are increasing the length of the column, but what if you decrerased the size? Then there may be an issue.
Just my two cents...
It is just a trigger for update , delete.
Something like below:
I only increase the size of one column for example AccidentType
CREATE trigger [dbo].[Investigation_Trigger] on [dbo].[Investigation] for update, delete
as
set nocount on
insert Investigation (
LogDate,
LogNbr,
WorkgroupId,
CarrierId,
ControlNbr,
SchoolId,
SchoolYear,
StudentId,
InvestigationStatusId,
AccidentType,
CreateDate,
CreatedBy,
ChangeDate,
ChangedBy)
select LogDate,
LogNbr,
WorkgroupId,
CarrierId,
ControlNbr,
SchoolId,
SchoolYear,
StudentId,
InvestigationStatusId,
AccidentType
CreateDate,
CreatedBy,
ChangeDate,
ChangedBy
from deleted
GO