Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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
623
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