updating a string colum to xml

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, andy.campbell.smith

updating a string colum to xml

Postby steven Evans » Tue Oct 22, 2013 1:25 pm

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
steven Evans
 
Posts: 4
Joined: Fri Jan 28, 2011 1:10 am

Postby james.billings » Fri Oct 25, 2013 11:20 am

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?
james.billings
 
Posts: 1146
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 0 guests