.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Quick Question in using nvarchar and varchar

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :Sql Server

Basically I am desiging a schema for datawarehouse in multi language support and iam setting up a suitable collation for this. But in some of the fields in different tables i am using nvarchar as a data type for some fileds where i need to insert different language characters. But in some fileds i am thinking of  using varchar where i am expecting just english language data.

My question is if i use varchar and nvarchar in the different fields on the same table in this database. Is there any performance issues ?

or just use nvarchar on all the fields where i am getting alphanumeric data.

What you people suggest.

Please tell me.


View Complete Post

More Related Resource Links

asp 4 quick question????


i am checking out a hosting provider f(https://www.blacksun.ca/order_hosting.html?plan=advanced_checked) and im trying to check if they are compatible with asp.net. they say they support asp4. can somebody please tell me if this is compatible with my version of asp.net that im using right now? im using visual studio 2008, version 9.0.3729.1 SP, .net framework version 3.5 SP1. is this compantible with asp4? thanks so much in advance.

Quick basic question about TFS 2010

Is TFS a standalone platform or do I need to install SQL Server 2010 first?     Thanks, Joshua

A quick question

I am new to ASP.net but i used VB a lot back in days, i am working on a site and i want to create form so the data from it could be submited to the email. i have put some stuff together but need some corrections. It feels like having brain shut down. I am paralzed and need help.. Thanks<% Dim EmailFrom Dim EmailTo Dim Subject Dim Name Dim LastName EmailFrom = "Example@mysite.com" EmailTo = "Example@mysite.com" Subject = "Example@mysite.com" Name = Trim(Request.Form("Name")) LastName = Trim(Request.Form("LastName")) Dim validationOK validationOK=true If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom) Dim Body Body = Body & "Name: " & Name & VbCrLf Body = Body & "LastName: " & LastName & VbCrLf Dim mail Set mail = Server.CreateObject("CDONTS.NewMail") mail.To = EmailTo mail.From = EmailFrom mail.Subject = Subject mail.Body = Body mail.Send Response.Redirect("ok.htm?" & EmailFrom) %> And here is code that contact the Email server that i have found in this forum on diffrent thread.# public static bool SendMessage(string RecipientAddress, string Subject, string Content, string SenderAdress) # { # MailMessage m = new MailMessage(SenderAdress, RecipientAddress, Subject, Cont

CLR Stored procedure SQLString (NVarchar) to varchar.


Hi trying to upgrade my current SQL 2000 database to 2008.

All the legacy code uses VARCHAR: tables columns, variables, input/output of SPs and XPs etc...

I'm trying to port an existing extended stored procedure to CLR stored procedure. The output parameter for the old xp is varchar(8000). In CLR it is obviously SQLString which maps to NVARCHAR(4000)

Now the legacy code which is expecting VARCHAR(8000) output is calling the new CLR which returns NVARCHAR(4000).  The CLR procedure can indeed return more then 4000 characters. I can use SQL facet size of -1 to force NVARCHAR(MAX). But I hear the performance is slow. Also what are the consequences of a CLR returning NVARCHAR to an SQL SP that expects VARCHAR?

Is there a way to return larger string from a CLR to SQL code that expects varchar?

This is the error I'm getting

Msg 6522, Level 16, State 1, Procedure xp_XYZ, Line 0

A .NET Framework error occurred during execution of user-defined routine or aggregate "xp_XYZ":

System.Data.SqlServer.TruncationException: Trying to convert return value or output parameter of size 8000 bytes to a T-SQL type with a smaller size limit of 8000 bytes.


 at System.Data.SqlServer.Internal.CXVariantBase.StringToWSTR(String pstrValue, Int64 cbMaxLength, Int32 iOffset, EPadding ePad)

 at Syste

A quick question about protocols a WCF service can use


I am beginning to examine WCF, and like what I have seen so far.

I am intrigued, however, by something I recently read about WCF services being able to work with multiple protocols (and the example used included support for TCP and HTTP). Alas, I am so new at trying to figure out proper use of WCF, I don't know where to look for relevant information for my present query.

First, is it true? Can a WCF service handle both TCP/IP packets and http requests?

Second, I am also studying WinPcap, to learn how to examine TCP packets to see if there is a discrepancy between IP address data in those packets and the IP addresses in the HTTP headers (among other things).  I want to be able to redirect HTTP traffic through a site based on such an analysis of the TCP/IP packets used to make a given HTTP request.  I don't suppose there is already a class within .NET 4 that provides access to the complete TCP/IP packet that contains a given HTTP request (that would let me avoid having to compile the WinPcap code into a .NET app).  I guess the first question for this ought to be, is WCF the right technology to use for this?  Then, if WCF is appropriate for this, how would I establish the connection between multiple OSI layers?  If I can use WCF for this, can you provide URLs for resources that discuss how to do it?



Search for Clustered Index in database on varchar, nvarchar column



I have very big database, i am running a Re-index job and it's keep failing throwing everyday error stating "Online index operation cannot be performed on clustered index as index contains column of data type text, nvarchar.

is there any way i can search and change all such datatype of culstered into non-clustered indexes or any better solution i have.

Replace all Varchar to Nvarchar


Hi all,

i want to convert all my database columns whose data type is char,varchar, nchar to nvarchar datatype. But the main problem is that some of my primary key, foreign key columns are also of varchar datatype. So when i try to change their datatypes to nvarchar then i receive the errors related to constraints of Primary Key, Unique Key and indexes. So please tell me that how to change the datatypes to nvarchar after droping the constraints and after changing all constraints will apply again. I also want that no data loss will occur. So please give me some solution. Will be thankfull to all of you

quick question on support for WPF on server 2003



I need to make a pretty small utility and I was thinking of using this task as my first experience with a WPF application... whether I do this largely depends on if it will work on server 2003, which is the oldest OS I need to support. I know WPF is part of .net 3.0 and later, so does that mean as long as server 2003 has .net 3.0 or later installed WPF is an option? Or are there other steps that would need to be taken to install, or enable WPF on server 2003? It all comes comes to if all our server 2003 systems can utilize WPF as-is, if not, I need to use WinForms.


SharePoint Usage Reporting Quick Poll Question


I've got a very quick poll question for any DBAs out there who utilize SharePoint Usage Reporting.


Would you rather view your SP Usage Reports inside SharePoint itself, or have them emailed to you once per day/week/month in a PDF or Office formats?

Quick validation question...


I have a textbox called "tax rate" which I need to validate the input...

The only thing I need to ensure is that the value entered is a number (decimals ok of course).

eg. the input might be "8.75"

How do I write the validation expression for this please?



ASP.NET 4.0: WebForm Routing (quick n dirty version)

One of the things we're adding in ASP.NET 4.0 is built-in support for using Routing together with WebForms. Now, I'm totally aware that this is possible to do already and that a number of people have posted ways of doing this with the Web Routing feature which shipped with ASP.NET 3.5 SP1. We're just adding some features to make it easier to do

Some basic MVC question

  1. In regular asp net I can run (debug) the application but I can either "view in browser" that gives me the option to view the application and write code on same time.

In MVC I can't find this option.

  1. What is the basic DATA MODEL for working with SQL DB.

I mean with no any framework (entity framework, Sub sonic, Link to SQL etc')

I look for basic application that works with data but with no fw.

  1. What is the popular DB framework that working with data.
  2.  I am looking on  mvc series


C# Soup To Nuts  (the best series ever)


I watch some of the MVC video, seems that the music store is good but I have to wait to the other part.

Does any one know and recommend   a Microsoft MVC tutorial?





Web Site to Web Application Question


I've been building web sites and for my next project I will be creating a web application.  I use a 'BasePage' class in all my projects but, since web applications do not contain the 'App_Code' folder, what is the best place/practice for the 'BasePage' class?



Bug: Does not change column type from nvarchar to ntext


Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.

connection string question from a newbie


when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"

Security Question Answer Retrieval


I know there is a method built in for retrieving the encrypted password, but how do I retrieve the encrypted security answer?

What I want to do is have a member profile update screen that the end user can update their password and security question and answer. However, when they get to this page, I want to already be showing the security question (the easy part) and its answer (the not so easy part).

I have updated web.config with passwordFormat=Encrypted and have added a machineKey with the generator (forgot the link, but located on eggheadcafe somewhere).

I haven't done ANYTHING yet, since I already have a user store with hashed information. I wanted to get some functionality done before publishing, wiping the store and recreating users (only a couple developers).


Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend