C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Table Schema And Data In XML
WhatsApp
Arun Kumar
Jul 26
2016
637
0
0
DECLARE
@TableData XML,@TableSchema XML
SELECT
@TableSchema = (
select
column_name,data_type,
case
(is_nullable)
when
'YES'
then
'true'
else
'false'
end
as
is_nullable,
CHARACTER_MAXIMUM_LENGTH
as
Charlen
from
information_schema.columns [
column
]
where
table_name =
'lkpActivityType'
for
xml auto,root(
'Table'
))
SELECT
@TableData = (
SELECT
*
FROM
lkpActivityType Row
FOR
XML AUTO,
BINARY
BASE64,root(
'lkpActivityType'
))
SELECT
@TableSchema,@TableData
Table schema
Data in XML
XML
Up Next
Table Schema And Data In XML