views:

107

answers:

2

Hi ,

I need to store XML data to database(MS SQL Server). The data type defined in the column is text.

I need to know the the equalent datatype for text. I have tried with adLongVarChar but it does not works. Also I tried with adLongVarWChar(nText). But both are not working.

Need help.

Thanks.

A: 

TSQL datatype for a string is varchar or nvarchar (unicode). To specify the length of the string, varchar(50).

Also note there is an XML datatype in SS 2008 (2005?).

Rob Elliott
Hi Rob,The column was defined as Text and I need the equalent ADO datatype.Is there any other equalent datatypes can I fit or need to change the DB column datatype.
A: 

Hi

In case your are using SQL Server 2005 or higher then you might prefer going for the XML data type. Read more of it here http://www.codeproject.com/KB/database/XMLdDataType.aspx

Also going forward avoid using ntext and text data types as they would be removed from future versions of SQL Server. Instead go for nvarchar(max) or varchar(max). Read on this here http://msdn.microsoft.com/en-us/library/ms187993.aspx

cheers

Andriyev