i want to create database dynamically using Jenkins after deployment and before deployment also. so can anyone suggest me how to create database using Jenkins or if there is third party tool or plugin is available in Jenkins ?
Asked
Active
Viewed 137 times
0
-
What do you mean by creating a database? What kind of a database? – towel Aug 22 '18 at 08:55
-
means after Deploying and testing using jenkins the database which i am using for testing that i want to reset – Jaydeep Bobade Aug 22 '18 at 09:05
-
Ok, so you can run an SQL script to backup the database and then another to restore after your last step. I'm not aware of any plugin that connects to a database (what kind?) and runs commands so you can create a utility and use it within Jenkins. – towel Aug 22 '18 at 09:09
-
ok i m trying batch file but when i am executing batch file it is giving error "Sqlcmd: Error: Connection failure. SQL Native Client is not installed correctly. To correct this, run SQL Server Setup." so how to add this feature?? – Jaydeep Bobade Aug 22 '18 at 09:11
-
The native client only exists for SQL Server 2012 and below. If you have a newer version I'd advise to change your utility to use another connection method. This is the installer of the [Native Client](http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409), courtesy of google. – towel Aug 22 '18 at 09:21
-
i am using 2008 R2 – Jaydeep Bobade Aug 22 '18 at 10:58
-
i tried but it is giving that already higher version is installed. but there is no native client is installed – Jaydeep Bobade Aug 22 '18 at 11:03
-
Sorry, I don't think I can offer any more help as we digress from the main question - can a database be reverted to its original state after deployment in Jenkins. Either find a way to install the appropriate native client version, or try to [connect using the SQL Management assembly](https://stackoverflow.com/questions/650098/how-to-execute-an-sql-script-file-using-c-sharp), which I think you may find easier. – towel Aug 22 '18 at 11:32