Solved

SQL 2005 con

Posted on 2008-10-30
5
185 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
Comment Utility
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
Comment Utility
Can you please site an example of the datalenght () function , you are referring to
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now