By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,766 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,766 IT Pros & Developers. It's quick & easy.

Bulk Load Copy - nvarchar is not recognized

P: 3
Hi,
durin importing data via bulk load copy componet appears error 'nvarchar' is not a recognized built-in function name.

I have around 200 xml files and schemas for importing to SQL Server but I have problems with only 3 schemas. They are valid and I don't know reason of this problem.

And next problem , how can I set up in xml schema size of text datatype. After import in MSSQL column has size 1000 chars but I need to change this size higher.In xml schema it doesn't work by defining new data type with higher size.

Any Idea please?
Pablo
Aug 18 '09 #1
Share this Question
Share on Google+
2 Replies


Delerna
Expert 100+
P: 1,134
Post the code that contains the error

It seems you are using nvarchar in a way that causes it to be interpreted as a function name and not the correct interpretation as a type.

Thats what the error means
there is no function called nvarchar()

I think the nvarchar type allows up to 8000 characters
someone correct me if I am wrong
Aug 19 '09 #2

P: 3
Hi Delerna,
I appologize for late answer and thank you ,that you write me too soon. Can you advice me with this problem again?


I have this xml schema:


<!-- schema for importing to MSSQL2005 to database with validating -->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="root" sql:is-constant="true">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="row" maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="row" sql:relation="C_pho"> <!-- table name -->
<xsd:complexType>
<xsd:sequence>
<!-- elements -->
<xsd:element name="ID_OMEZ_PHO" type="xsd:string" minOccurs="0" />
<xsd:element name="ZKRATKA" type="xsd:string" minOccurs="0" />
<xsd:element name="POPIS" type="xsd:string" minOccurs="0" /> <!-- need max except 8000 chars -->
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>



a this code in C#:



bulkLoad = new SQLXMLBulkLoadClass(); ;
bulkLoad.ConnectionString = textBox1.Text;
bulkLoad.ErrorLogFile = Application.ExecutablePath + "importXMLSupport_log.xml";
bulkLoad.KeepIdentity = false;
bulkLoad.SchemaGen = checkBox1.Checked;
bulkLoad.SGDropTables = checkBox1.Checked;


If chekbox1 is checked, I want to create table against xml schema in MSSQL2005.
But, I need nvarchar(max), yes, navarchar allows up to 8000 character or max, what is about 2 giga characters.

Question is: How can I set 'max' in xml schema?

thank for any advice.
Sep 16 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.