Red Gate forums :: View topic - Database triggers in the Database Triggers dir vs Tables
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 2
SQL Source Control 2 forum

Database triggers in the Database Triggers dir vs Tables

Search in SQL Source Control 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
gregmac



Joined: 08 Jul 2010
Posts: 3

PostPosted: Fri Jun 17, 2011 11:46 pm    Post subject: Database triggers in the Database Triggers dir vs Tables Reply with quote

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]
Back to top
View user's profile Send private message
peter.peart
Site Admin


Joined: 02 Sep 2008
Posts: 362
Location: Top floor, RG towers with the cool kids

PostPosted: Fri Jun 24, 2011 4:06 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group