Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Nvarchar versus varchar

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-10-10 : 05:56:20
I have table with a field defined as nvarchar. I want to change it to varchar. I have a stored procedure which defines the parameter @strCall_desc as nvarchar(4000). Are there going to be ay problems with running this sp if I just change the field type as described.

TIA

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-10-10 : 06:02:45
If your application uses Unicode data, then changing from nvarchar to varchar does not seem to be good idea.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-10-10 : 06:19:04
It does not use unicode data
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-10 : 06:43:50
I presume the @strCall_desc parameter relates to the column you want to change?

There is probably a (small) performance penalty with an implicit conversion from Varchar to Nvarchar when the Sproc is called.

And if you pass the SProc move than 4,000 characters you'll be hosed of course!

But other than that I think it should be OK

Kristen
Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-10-10 : 06:46:18
Thanks - I've tried it on the test db and it didn't throw up any errors - cross my fingers and try the live next :-)

There will not be more than 4000 characters.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-10-10 : 13:18:55
Well, if it's not going to be > 4000, why are you changing it in the first place

Seems kinda arbitrary

Are you interested in saving space?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-10-11 : 10:04:03
I am linking to the table from an Access database and running a query. It makes nvarchar a text field which will only hold 255 characters and I get an error about pasting much data. If I make it varchar it makes it a memo field and works ok.
Go to Top of Page
   

- Advertisement -