Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Monday, March 26, 2012

New SQLXMLBulkLoad user--having problems

I am trying, for the first time to load an xml file into SQL Server 2000, and to get me going I am trying to execute the msdn example:-

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlxml3/htm/bulkload_6bos.asp

I have configured all the needed set up and keep getting this error:-

Automation error(80040e21)

With no real error info in the error log

The Connection string details are all correct..I have checked that

The error occurs at line:-

objBL.Execute "SampleSchema.xml", "SampleXMLData.xml"

Have you got any ideas…?

Has anyone actually managed to run this example without errors?


Appreciate your help

Thanks

Raj

Hello,

Send me the schema and the data file and I will try a repro.

Regards,

Monica

sql

New SQLXMLBulkLoad user--having problems

I am trying, for the first time to load an xml file into SQL Server 2000, and to get me going I am trying to execute the msdn example:-

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlxml3/htm/bulkload_6bos.asp

I have configured all the needed set up and keep getting this error:-

Automation error(80040e21)

With no real error info in the error log

The Connection string details are all correct..I have checked that

The error occurs at line:-

objBL.Execute "SampleSchema.xml", "SampleXMLData.xml"

Have you got any ideas…?

Has anyone actually managed to run this example without errors?


Appreciate your help

Thanks

Raj

Hello,

Send me the schema and the data file and I will try a repro.

Regards,

Monica

Monday, March 12, 2012

New problem getting data from xml table in sql db (Newbie)

Hello,

I have this xml tablerow in a table in my db.

2 examples

<Toyconfiguration version = "1" name = "Lego">

<Ballconfiguration version = "2020" name= "Adidas">

If I would want to get the name of the toy or ball I would write

Select

Tablerow.value('((@.name)[1]', 'varchar(100)')

From table

This would return Lego and Adidas

But what if I want to know which kind of configuration it is? How do I do this?

The answer I want is Toyconfiguration and Ballconfiguration..

Any help would be appreciated!

You could use local-name() function:

select

Tablerow.xml_col.value('(//@.name)[1]', 'varchar(100)')

,Tablerow.xml_col.value('local-name((*[@.name])[1])', 'varchar(100)')

from TableRow

|||

Kontantin,

Thanks a bunch for your answer. You saved me!!!

Saturday, February 25, 2012

New features?

Hi!

What are the new features in the area of XML support in Katmai?

Thanks

Klaus Aschenbrenner

http://www.csharp.at

http://www.csharp.at/blog

Hi Klaus

At the moment the new features are (with the CTP numbers):

CTP3: XML Schema supports lax validation including schema evolution and precise static typing for XQueries into lax validated sections.

Monday, February 20, 2012

New data types in SQL Server 2005

SQL Server 2005 has some new data types like XML, varchar(MAX). Are they
supported by C# in Visual Studio 2003 and 2005?Hi Roy
From http://tinyurl.com/c2glu
DataTypes - UDTs, the XML data type, and "MAX" BLOBs and CLOBs
SQL Server 2005 adds support for user-defined types, a native XML data type
and better large data support. Large data support is improved by using the
Transact-SQL types VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX).
User-defined types and a native XML type are defined by the SQL:1999 and
SQL:2003 specifications. To use these data types with SqlClient, new classes
in the System.Data.SqlTypes namespace are defined (SqlUdt and SqlXml),
support is added to the SqlDbTypes enumeration and IDataReader.GetValue was
enhanced to support returning UDTs as .NET Object types, and support
returning XML as a .NET String.
These new SQL Server 2005 types are supported in DataReaders returned from
SQL SELECT statements and as Parameters using SqlParameter. A special class,
SqlMetaData, can return information about extended properties of these new
data types, such as the XML schema collection that a strongly typed XML
column adheres to, or the database name of a UDT. You can use these types
from the client directly, in generic code, and also in the DataSet. Finally
you can perform partial updates on the "MAX" data types from the client,
which required using special SQL functions before ADO.NET 2.0.
You may also want to look at the Hands-On Labs in the resource kit.
For more information check out http://msdn.microsoft.com/SQL/2005/
John
"Roy" wrote:

> SQL Server 2005 has some new data types like XML, varchar(MAX). Are they
> supported by C# in Visual Studio 2003 and 2005?