TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Table Schema And Data In XML
Arun Kumar
Jul 26
2016
Code
549
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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