Solved

SQL 2005 con

Posted on 2008-10-30
5
223 Views
Last Modified: 2010-03-19
CAn some tell me the best way to conert SQL Storedprocedure Non Unicode to Unicode. Any script out there to convert all SP with varchar , char to nvarchar nchar.

CAn you please tell me how to go about it SQL 2005
0
Comment
Question by:Abeokuta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22841620
The best way is to open your source control software where you store all of your procedures, change them there, write the underlying DDL changes for altering your tables, then push it out as a migration package.

There are a lot of reason why you can't run a "convert to unicode" script.  

1. If you use the datalength() function anywhere, you now need to use datalength()/2 to get the character length of the data in the column
2. Assigning unicode strings to variables is different
  set @unicodeString = N'Hello'
  set @NONunicodeString = 'Hello'

Those are just 2 of the problems you will face trying to "convert" with some sort of code generator.
0
 

Author Comment

by:Abeokuta
ID: 22841752
Can you please site an example of the datalenght () function , you are referring to
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22842017
datalength is similar to len but does not trim.

select len('hello   ')
select datalength('hello   ')
select len(N'hello   ')
select datalength(N'hello   ')/2
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question