October 6, 2014 at 11:10 pm
Hi,
I have few set of columns for whose datatype has to be changed from Varchar to Nvarchar , all these columns are used in many Stored Procedures and also in other DB objects.
Please let me know how should i proceed and what are the things i have to keep in mind before making the changes so that it will not break something else.
October 7, 2014 at 12:45 am
Unless using Integration Services (which is a metadata control freak), normally things won't break that easily.
SQL Server will just use implicit conversions everywhere, which may impact execution plans and the use of indexes.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 7, 2014 at 12:46 am
One more thing: maybe run sp_refreshview to update view metadata for views using those columns.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 7, 2014 at 2:23 am
Koen Verbeeck (10/7/2014)
SQL Server will just use implicit conversions everywhere, which may impact execution plans and the use of indexes.
However, since the column will be going to varchar, the implicit conversions will generally be on the other side (varchar implicitly converts to nvarchar), so shouldn't be too much of a problem.
Just make sure that any related columns in other tables are converted as well. You'll have to drop any constraints on the columns to make the change iirc (foreign key), recreate them afterwards.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 7, 2014 at 3:50 pm
Hmm, I read it as going to varchar to nvarchar.
That is tricky, if any code uses local variables of type "varchar" to hold those columns. Given the implicit conversion of nvarchar to varchar and back, you might see conversion issues of the underlying data.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply