updating a string colum to xml

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

updating a string colum to xml

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

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

Postby james.billings » Fri Oct 25, 2013 10: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?
Posts: 1122
Joined: Wed Jun 16, 2010 10:10 am
Location: Red Gate

Return to SQL Source Control Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests