By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,766 Members | 1,290 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.

Quick question

P: 1
Hi

I have a quick question. I'm studying how XML works in sq server 2005, and I've hit the following code online that I can't completely understand (see below code).
I know what it does, how it works, but it's just the part "AS feed (xmlData)" that I'm trying to fully understand. I get the 'As feed' is an alias,but why must the (xmlData) be there?
If anyone can answer this (i'm asuuming simple question!) I would greatly appreciate it.

Thanks.

INSERT INTO rssFeeds (feedName, feedXML)
SELECT 'MSDNRSS', xmlData FROM
(
SELECT * FROM OPENROWSET
(BULK 'C:\Temp\rss.xml', SINGLE_CLOB)
AS xmlData
) AS feed (xmlData)
GO
Sep 11 '09 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
It's a column alias. As you can see, the outer SELECT used xmlData. That xmlData is the same xmlData used in the alias. Read the FROM part of the select here.

Happy Coding!!!

--- CK
Sep 12 '09 #2

Post your reply

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