Solved

sql server 2008 xml query syntax / semantics

Posted on 2012-04-10
5
339 Views
Last Modified: 2012-04-11
I have some questions about this snippet of code:

If Exists
(SELECT 1
FROM Common.XmlArrayOfInt(@ListingIDs) IDs

Is XmlArrayOfInt a built-in TSQL function? If so, how does it work and what does it do both generally and in this instance? I have some experience (~1.5-years) with db-programming, but I currently don't know XML nor have I ever seen XML used within sql-server queries. Please explain as much as possible.

Thanks!
0
Comment
Question by:pae2
5 Comments
 
LVL 14

Expert Comment

by:nishant joshi
ID: 37830944
you can load xml to temp table and then use it.after use drop it.
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
ID: 37831298
XmlArrayOfInt is not a built-in function in tsql or sql in general.
it seems that XmlArrayOfInt is a user defined function which i assume accept list of ids (probably string generated ids).
try look for this function in your DB, i should be under <DB>->Programmability->Functions->Scalar-valued Functions
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 250 total points
ID: 37832279
try look for this function in your DB, i should be under <DB>->Programmability->Functions->Scalar-valued Functions
Make that Programmability->Functions->Table-valued Functions
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 37832329
any progress?
0
 

Author Closing Comment

by:pae2
ID: 37832533
sedgwick, thanks for the explanation. it helped. acperkins, thanks. you were right. it was in Table-valued Functions.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now