Export sql server table structure with data programmatically using C# -
i have table data in sql server. need take backup of table structure data sort of file programmatically using c#
. may .sql
extension file. same way using task
option in sql server management studio.
i googled did not find related this. if suggest me link highly appreciated.
(edited in comments)
the backup safety purpose. going execute conversion logic 1 of scheduler control. process is:
- get backup of table data list.
- truncate table.
- convert data desired format.
- insert converted data same table.
if conversion logic problem, can fix later using backup file.
this may you:
select * newtable yourtable
you not need create newtable
manually, execute query.
update:you can download database data dataset , use dataset write xml or without schema using dataset.writexml
method this:
ds.writexml(@"e:\temp.xml", xmlwritemode.writeschema);
Comments
Post a Comment