Database triggers in the Database Triggers dir vs Tables

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace

Database triggers in the Database Triggers dir vs Tables

Postby gregmac » Fri Jun 17, 2011 11:46 pm

I'm running into some strange behaviour, which is interfering with an external packaging process I have.

Basically:

    I add a trigger to a table (using SSMS) and commit, SQL Source Control adds the trigger statement to the bottom of the table.sql script in the Tables directory.
    I manually extract the trigger SQL, and put it into a new file in the Database Triggers directory called trigger1.sql, and commit to svn.
    SQL Source Control shows no modifications.
    I modify the trigger, and commit. SQL SC shows it as a change to the table, but commits the change to trigger1.sql and doesn't touch table.sql
    I add another trigger and commit. SQL SC adds it to the bottom of table.sql

I find this bizarre. SQL SC obviously knows about the Database Triggers directory, and is even smart enough to know to update SQL code in there vs in the tables directory, and yet, it doesn't use it by default. Is there a reason for this?

Is there a way to change this behaviour, so it always just puts triggers in the Triggers directory?
[/list]
gregmac
 
Posts: 3
Joined: Thu Jul 08, 2010 11:11 pm

Postby peter.peart » Fri Jun 24, 2011 4:06 pm

Hi there,

Thanks for your post. Can you tell me, how did you perform the second modification, i.e. the modification after you had altered the folder structure for where triggers are stored? Did you modify it in SSMS and then commit using SQL Source Control?

I'm personally giving this a go and so far it's erroring out on me when I try to commit the modified object.

As far as I am aware though, SQL Source Control follows the SQL Compare hierarchical structure relating to DB objects and creates the trigger along side the table creation script. I also don't believe there is any way to modify this at all.

I can however raise a feature request for you if you would like?

Pete
Peter Peart
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569
peter.peart
Site Admin
 
Posts: 362
Joined: Tue Sep 02, 2008 9:58 am
Location: Top floor, RG towers with the cool kids


Return to SQL Source Control 2

Who is online

Users browsing this forum: No registered users and 0 guests