Red Gate forums :: View topic - updating a string colum to xml
Return to www.red-gate.com RSS Feed Available

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

updating a string colum to xml

Search in SQL Source Control 3 forum
Post new topic   Reply to topic
Jump to:  
Author Message
steven Evans



Joined: 28 Jan 2011
Posts: 4

PostPosted: Tue Oct 22, 2013 1:25 pm    Post subject: updating a string colum to xml Reply with quote

Hi,
I am looking at changing a column from a string to a type xml type. Some parsing of the string is required to re-encode the data. I have developed a CLR function to do this. My questions is how should I go about doing this I a migration scripted. As I only need the CLR function for the migration do I add and remove it or just leave it.

Any advice would be appreciated

Steven
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Fri Oct 25, 2013 11:20 am    Post subject: Reply with quote

My guess would be that you'd want to source control the CLR function first so it's available in target databases.

You could then commit your table change but override it with a migration script to execute your CLR function to update the data before changing the column type.

If you're not using migrations, then you'd probably be better off manually running the function to update the data, then getting the column change from source control afterwards?
Back to top
View user's profile Send private message
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