2
votes
0answers
250 views

Passing NULL xml value to a certain CLR stored function crashes it when called in a certain way

Consider a CLR stored procedure that accepts an XML parameter and calls another stored procedure in the same schema: [SqlFunction(DataAccess = DataAccessKind.Read, IsDeterministic = false, ...
0
votes
1answer
683 views

Store FOR XML result in xml variable (using WITH statement)

I am creating xml with a SQL query that works like this: First a CTE, then the SELECT statement that creates the XML. That works. However I would like to store the output in a XML variable (a table ...
1
vote
1answer
152 views

Relative cost of two similar queries involving XML columns

I have two queries as shown below which do the same thing. Here xmlcolumn is a column with datatype XML. I use these queries to search for a string anywhere in the XML column. I checked the execution ...
6
votes
1answer
420 views

How to shred .docx XML?

I am trying to import a xml (actually a docx file) to a sql server 2008 database. I am almost a novice in XML programming. I googled a lot but almost all the examples there are with simple xml file. ...
2
votes
1answer
357 views

SQL Server stored procedure working when run manually, not running from SQL Server Agent

I have a procedure that runs fine using the execute command in SSMS, however putting the same command in a job gives the following error. line 9, character 9, unexpected end of input The code ...
0
votes
2answers
477 views

how to select * from XML where id=1?

declare @xml xml, declare @num int set @num = 1 set @xml = ' <row> <Id>1</Id> <name>reza</name> </row> <row> <Id>2</Id> ...
2
votes
1answer
693 views

how to convert xml to database table

input: Declare @OUT xml select @OUT = N' <row> <kind>MainCat</kind> <sortid>1</sortid> <kind_id>1</kind_id> <PPoet>حافظ</PPoet> ...
2
votes
2answers
2k views

Fast XML, slow XML

Our database update Windows application needs to transfer some data between two databases as part of the process for a certain one-time update. I chose XML as the intermediary to move the data. The ...
1
vote
1answer
564 views

Trying to Build TreeView Query in T-SQL

I have parent records in two tables, Table1 and Table2. Some records in Table3 are children of Table1, and some are children of Table2. I would like to build a query that I can use to populate a ...
2
votes
1answer
110 views

I would like to better understand the SQL Server security model in terms of users and groups to possibly replace an XML heirarchy model I am using

I am currently using XML in my database to represent metadata for individual products. I am using the below schema to enter the data. In each sub grouping of fields you will notice the cms_name ...
3
votes
4answers
4k views

Is it possible to get SQL Server 2008 to download a file from a URL

I have a set of XML based services running on my network. The data in these services needs to be mirrored into a Table on an SQL Server 2008 instance. Getting the XML into a table is no problem I ...
0
votes
0answers
308 views

Identifying XML Node Position in SQL Server 2008

I am having a problem identifying the node position that contains a particular element in a piece of XML. In the example below I would like to extract the position for each node within the statements ...
2
votes
0answers
233 views

going from heirarchical XML to heirarchical SQL tables then SQL to c# objects to go to user view, how should I store the data in the databases?

Hi I'm getting my data from a web service using their getData call and it comes in as fairly chunky heirarchical XML, first everything all at once, like <allData> <product1> ...
2
votes
3answers
127 views

Document versioning

I want to store in SQL Server 2008 XML files, but in a way that versioning is supported. For example, I have a XML document and I save it in the DB(in the XML datatype column). After that, I edit it. ...
0
votes
1answer
312 views

Returning Multiple Result-Sets or Single XML Blods

I've been writing some new Stored Procedures, and find myself returning between 6-8 result-sets in a few cases. I've always worked under the assumption that there were certain inefficiencies with ...
3
votes
1answer
2k views

Storing XML in varchar(MAX) or use SQL-XML

I am defining a schema for a new set of resources using SQL Server 2008... In this case, each record (e.g. row) will need to store XML fragments. From time-to-time; although not frequently; I'll need ...
0
votes
2answers
323 views

SQL Server XML Insert Optimize?

I have a 400k XML document trying to insert into an 86-column SQL Server 2008 table. It takes about 35 minutes to get that XML into a temp table using this code: with XmlNamespaces ( ...
2
votes
1answer
213 views

Where can I find information on shredding xml with .nodes?

I recently saw this answer on SO which uses the "local-name" value while shredding xml using .nodes(). I've never seen this before: select T.N.value('local-name(.)', 'varchar(128)') as Name, ...
4
votes
2answers
215 views

How do I track the usage of XML indexes?

My XML indexes are not listed in sys.dm_db_index_usage_stats Does this mean they aren't being used? Or does this particular DMV not track XML index usage? (Books Online doesn't appear to answer the ...
10
votes
4answers
3k views

When to use XML data type

I'm responsible for creating a database on a project. We have fields that are rarely going to have a value (1 in every 10,000 records) and I'm trying to work out the best way to store this in the ...
3
votes
2answers
1k views

Select XML values when attribute involved

I have a table that stores XML values in field: OtherData. An XML value from one row: < file path="C:\WINDOWS\system32\svchost.exe" /> I would like to select all rows that have an ...
4
votes
3answers
3k views

How to insert multiple records using XML in SQL server 2008

i use SQL server 2008 in my web application back end. Apparently i iterate through all the records from the C# code whenever there is a multiple insertion scenario. i have never tried the multple ...
6
votes
3answers
15k views

Read XML file in SQL Server 2008

How can I read an XML file and store the data in XML to our table in SQL Server 2008?
3
votes
1answer
10k views

trying to turn XML into heirarchical SQL tables, can anyone provide a good explanation of two parts of this code example?

I am trying to learn how to turn XML into heirarchical SQL tables. I have found an old code snippet from a Microsoft forum which is basically what I am trying to do, but I was wondering if someone ...