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:

  1. get backup of table data list.
  2. truncate table.
  3. convert data desired format.
  4. 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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -