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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to specify scale on XSD used for SQLXML import

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :
I have an XSD that is marked up with SQLXML 4.0 annotations.  This schema is used for bulk importing xml data into a SQL server database.  When the data type is decimal, the default behavior specifies that the scale be 0 (which will not allow for decimal places).  I know I can introduce a post process that will use SMO to change the scale, but is there a way to specify scale along with the data type using SQLXML annotations on the XSD?

View Complete Post

More Related Resource Links

Import XML File to SQL Table

Here is a brief example of importing an XML file into SQL Server table. This is accomplished by using the BULK option of OPENROWSET to load the file, and then utilizing the XQuery capabilities of SQL Server to parse the XML to normalized table format. This example requires SQL server 2005 or SQL Server 2008.

First, the following XML is saved to XML file C:\Products.xml.

xml import to database


Hello. I have XML document I use for backups..

I am using this code for importing XML to database:

protected void uvoziPodatkeXML(string backup, int tabela, string destinacijaTabela)
            DataSet reportData = new DataSet();

            FileStream filestream = File.OpenRead(lblPotIzvozi.Text + txtIme.Text + backup);
            BufferedStream buffered = new BufferedStream(filestream);

            //reportData.ReadXml(lblPotIzvozi.Text + txtIme.Text + backup);

            SqlConnection povezava = new SqlConnection(Convert.ToString(Session["cs"]));
            SqlBulkCopy sbc = new SqlBulkCopy(Convert.ToString(Session["cs"]), SqlBulkCopyOptions.KeepIdentity);
            sbc.DestinationTableName = destinacijaTabela;


But there is a problem when XML file is very large, larger than 50MB, it lasts forever to import to database.. I was searching over google, and saw that datasets are terrible slow for this operation.. I found some other methodes for use, but don't know there are no examples, that could help me.

Did someone work on this before?

thanks, yevgeni

Scale Out: Distributed Caching On The Path To Scalability


Developers frequently face issues related to scalability bottlenecks when they have applications that need to handle a lot of load. This article describes the role of a distributed cache in building scalable applications.

Iqbal Khan

MSDN Magazine July 2009

Lessons Learned: Optimizing A Large Scale Software + Services Application


Udi Dahan explains how his team identified and overcame unforeseen problems while developing a large-scale software + services trading application.

Udi Dahan

MSDN Magazine April 2009

Scale: Real-World Load Testing Tips to Avoid Bottlenecks When Your Web App Goes Live


Load testing should be part and parcel of every Web development effort, and it should be performed early in the process. However, if you think you can load test using your development environment, you're going to have some surprises when you go live. In this article, the authors outline the process of planning your load testing effort, considering which machines to use, how many users to simulate, which tools are right for you, and how to interpret your results.

Jeff Dunmall and Keith Clarke

MSDN Magazine January 2003

XML Schemas: Take Advantage of Existing External XML Schemas with a Custom Import Framework in ASP.N


Over the years, many industry-standard XML schemas and dialects have been developed. These industry-specific schemas embrace the original purpose of XML and are extremely valuable in promoting and supporting B2B interaction. Unfortunately, the ASP.NET Web Services runtime does not allow developers to directly reference external schemas from within their XML Web Services interface (the WSDL file). This article builds an external schema framework as an extension to the ASP.NET Web Services runtime to enable you to reference external schemas within your XML Web Service interface.

Scott Short

MSDN Magazine December 2002

SQLXML 3.0: Build Data-Driven Web Services with Updated XML Support for SQL Server 2000


XML is becoming the ubiquitous data format on the Web, and XML support in SQL Server is evolving to meet the additional demand. Using XML, SOAP, HTTP, and SQL Server, you can now build powerful Web Services easily. To show just how simple it is with SQLXML 3.0, this article walks the reader through the process step by step, from setting up a virtual directory enabling data access via HTTP to executing queries and building Web Services. Finally, the author illustrates the creation of two Web Services clients-one with C# that works with the Microsoft .NET Framework and one with the SOAP Toolkit 2.0 for anyone still using earlier development tools.

Christian Thilmany

MSDN Magazine May 2002

EF 4: Function Import problem with Stored Procedures


I have the following SP which includes a temp table:

 DECLARE @pos int

--create table to hold parsed values
CREATE TABLE #list (val varchar

BDC Import error with ADD


I want to try the BDC features so I created a test database with 2 tables related table (Building, Contact, Building has a foreing key to Contact). I used the Application Definition Designer furnished with the MOSS SDK to create the xml file. I was expecting it would be easy and straightforward but the produced xml file isn't working.

I get the following error when I try to import the Application definition:

Application definition import failed. The following error occurred: Entity could not be found using criteria 'name LIKE [SP_Test].[dbo].[Contact]'. Error was encountered at or just before Line: '140' and Position: '16'.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<LobSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Type="Database" Version="" Name="Building" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">
  <LobSystemInstance Name="Building_Instance">
    <Property Name="rdbconnectionData Source" Type="System.String">MOSS2007</Property>
    <Property Name="rdbcon

stsadm Import command + include user security



When I move sites from test to staging to production, I am using the stsadm –o export command with the –includeusersecurity option in the staging environment.  In production environment, I then use the stsadm –o import command with the –includeusersecurity option.  I was assuming that this option was bringing over the security on the exported site only.  This does not seem to be the case.

Last night I exported one sub site to produtction.  Today, I was notified that the security groups on other sub sites have been altered.  


So why is it when using the –includeusersecurity option effect all sub sites and not just the one sub site being moved from staging to production

When create a suvery using type Rating Scale, is it possible to create 5 range text?


When create a suvery using type Rating Scale, is it possible to create 5 range text?

Default range text only show 3 fields

sql server 2008 import/export wizard... completely useless??



import/export wizard in 2000 had lots of options.

I could copy databases without a care in the world. Including constraints, stored proc., AND the data, etc.

Now, with v2008, the wizard is dumbed down too much. It's a "stupid" copy function that fails on the first constraint it meets.

"Copy database.." is not an option here: it needs sysadmin on both source and destination server.

Re-adding the constraints manually is not an option either: the database is WAY too large. 

I'm actually hoping there is a temporary bug in the import/export wizard. Each option (and you have THREE...) returns with a new error.

Googling, I found I am not alone:


This post is exactly my situation. Here's what his post says: (bolded key parts)


I'm trying to get used to sql server 2008 having been forced to upgrade by my isp. I need to back up my key db on a weekly remote schedule, so have been trying to use ssms to export data from my remote db to a local copy.

Firstly I created a new empty db on the local machine. Then I scripted the structure of the db on the remote machine and ran the resulting query on the local machin

Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

how to import contacts from yahoo, gmail, etc using C#.NET 1.1

i want to import contacts from gmail, yahoo etc when you give the username and password like in sites like hi5 and myspace. how do i do this?? i use visual studio 2003.

Possible to truly "scale" a Windows Form?

Hi all! I'm trying to think of a way to truly "scale" a Windows Form. I don't just mean resize the form and rearrange the controls accordingly; I mean really "Honey I shrunk the form!" type of shrink, including all text and graphics, as if they had been drawn on a Graphics object with a scale transform less than 1. Aero does this when it shows a shrunken window preview icon... that's exactly what I want, except I want it to happen to the window itself as the user resizes it. I know WPF can do this, but I need a way that'll work on a standard Windows Form without rewriting or massively re-engineering the UI. Any creative ideas? Thanks in advance! :-D

Import contacts on Mysql

Hello,   I am in the process of transferring data and contacts onto a Mysql database. I have had some help and am trying to get a software solution.   So main features would be to migrate large amounts of data and contacts every day. The migration would be done manually.  Thanks for the help.

SSIS Import/Export Wizard: "Unexpected Unrecoverable Error"

For whatever reason, whenever the SSIS Import/Export Wizard needs to display an error message, it throws up "Unexpected Unrecoverable Error" instead. The three buttons - Abort, Retry, and Ignore - all cause the wizard to close. I see some activity in Process Monitor that looks like DTSWizard.exe is probing around for some System.Web assemblies, and not finding them. I'm running 2008 SP1 on Win 7 x86, and I've reinstalled the client tools and Integration Services. Anybody else seen this issue? Should I file a report on Connect?
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