GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Database  >  SQL Server
Go To First  |  Previous Question  |  Next Question 
 SQL Server  |  Question 22 of 101    Print  
Difference between "VARCHAR" and "VARCHAR2" datatypes?

  
Total Answers and Comments: 9 Last Update: February 05, 2009     Asked by: Beena 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: cybersavvy
 
Varchar2 in Oracle is equal to varchar in SQL Server. There is no varchar2 data type in SQL Server

Above answer was rated as good by the following members:
goksn, prakashgm
September 22, 2005 02:21:38   
rahultripathi Member Since: September 2005   Contribution: 22    

RE: Difference between "VARCHAR" and "VARCHAR2" dataty...

Both are related to varible length but difference that varchar stores only 2000 byte character of data and varchar2 stores 4000 byte charecter of data .

If any problem don't hesitate write to rahultripathi@myway.com


 
Is this answer useful? Yes | No
October 11, 2005 08:08:18   
Ketan Pathak        

RE: Difference between "VARCHAR" and "VARCHAR2" dataty...
The other difference is that varchar occupy total length which is define to create database while the varchar2 occupy the total length of the given string.
 
Is this answer useful? Yes | No
October 19, 2005 03:24:33   
Ajay Sharma        

RE: Difference between "VARCHAR" and "VARCHAR2" dataty...
Both VARCHAR and VARCHAR2 are same. ORACLE may remove VARCHAR in its future version.
 
Is this answer useful? Yes | No
November 08, 2005 02:41:46   
dhanunjay valisetty        

RE: Difference between "VARCHAR" and "VARCHAR2" dataty...

dear friend... here is small clarification w.r.t your answer reg...

The VARCHAR datatype is actually a subtype of VARCHAR2 with the same range of values found in VARCHAR2. VARCHAR in other words is currently synonymous with VARCHAR2. Use of VARCHAR offers compatibility with ANSI and IBM relational databases. There is a strong possibility however that VARCHAR's meaning might change in a new version of the ANSI SQL standards. Oracle recommends that you avoid using VARCHAR if at all possible and instead stick with VARCHAR2 to declare variable-length PL/SQL variables (and table columns as well).

cheerz..

dhanunjay

Ketan Pathak Wrote: The other difference is that varchar occupy total length which is define to create database while the varchar2 occupy the total length of the given string.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
August 21, 2006 13:11:59   
helper        

RE: Difference between "VARCHAR" and "VARCHAR2" dataty...

Varchar and Varchar2 differs only by space.

2000 byes is allocated for varchar and 4000 bytes for varchar2


 
Is this answer useful? Yes | No
October 27, 2006 08:06:02   
shravan        

RE: Difference between "VARCHAR" and "VARCHAR2" dataty...

If we declare datatype as VARCHAR then it will occupy space for NULL values In case of VARCHAR2 datatype it will not occupy any space.


 
Is this answer useful? Yes | No
May 01, 2008 15:14:00   
kumars77 Member Since: April 2008   Contribution: 4    

RE: Difference between "VARCHAR" and "VARCHAR2" datatypes?

This is not right ans because varchar datatype store more than 2000 character i checked it no error found so plz anbody give right ans


 
Is this answer useful? Yes | No
September 17, 2008 02:36:14   
smithanair Member Since: September 2008   Contribution: 2    

RE: Difference between "VARCHAR" and "VARCHAR2" datatypes?
VARCHAR is used to store alphanumeric values without padding unused memory locations. But VARCHAR2 is used to store alphanumeric values with padding unused memory locations. so using VARCHAR2 we are saving memory locations.
 
Is this answer useful? Yes | No
February 05, 2009 11:45:23   
cybersavvy Member Since: February 2009   Contribution: 16    

RE: Difference between "VARCHAR" and "VARCHAR2" datatypes?
Varchar2 in Oracle is equal to varchar in SQL Server. There is no varchar2 data type in SQL Server
 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape