0

I am new to C# and SQL Server programming. I have a project in which I have to create a database backup automatically after every transaction. I tried SQL Server Agent jobs but unfortunately I came to know that in SQL Server 2014 Express, SQL Server Agent is not available.

Now I want to take a complete database script after every transaction in my C# application automatically. I found many ways of database script with data but all are through SQL Generate scripts Wizard. According to my need, I want an exact query that I run from C# application after every transaction and it creates a script in specific directory (replace if already exists). Thanks all.

2
  • Why not just enable snapshot isolation with ALTER DATABASE MyDatabase SET ALLOW_SNAPSHOT_ISOLATION ON: msdn.microsoft.com/en-us/library/…. Seems essentially equivalent to your task. Commented Jan 27, 2016 at 4:15
  • 1
    This is a dumb requirement, because Sql Server already does this natively. They're called Transaction Logs. Make sure recovery mode is set to "Full" rather than "Simple", and do frequent T-Log backups. Commented Jan 27, 2016 at 4:23

1 Answer 1

0

You can use Database class or Scripter class to specify objects you need to generate script for.

Previous Question 1

Previous Question 2

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.