Solved

SQL 2005 con

Posted on 2008-10-30
5
204 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

786 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