Automate SQLExpress Restore.
Mar 11, 2008
Dear All
Im not the greatest SQL guy in the world...(as you will gather from this post)
I have multiple machines (x80) all with SQLExpress installed and a Database instance (MYDB).
This database is part of a demonstration software install. (which is limited).
I need to run a restore from a .BAK file to reset this software to the original version of the database. But this restore MUST happen without user interaction (Users are 17 yo students who know less SQL than me !!!)
Ive tried all the norms..
OSQL couldnt get it to connect at all.
SQL query (Works but requires interaction)
Any other ideas..
kr
Paul
View 1 Replies
ADVERTISEMENT
Jul 23, 2005
hello people!I am very new to the SQL World. Currently I work on DB2 and ORACLE andthis is a new "fruit" for me.I have the task to automate the following scenario:- backup database A- restore database A into database B (overwrite database B)- perform the above every night at 23:00.Can anyone indicate me where do i find info how to perform the above?I know that you can do it through the Enterprise Manager but I need toscript the above (probably).Thanks
View 6 Replies
View Related
Dec 11, 2003
Is there a way to automate a sql server restore? I have a db that I need to include in an installation. I could use generate script but there is info in the db that needs to be copied too. What is the best way to do this?
Thanx
weisenbr
View 1 Replies
View Related
Apr 17, 2015
I want to automate backup and restore operation in T-sql script I need to give resource server,database and backup file location as input and then I need to restore that backup in different server so I want to give destination server as input too.
View 4 Replies
View Related
Sep 20, 2006
Hello,
I have a fresh install of sqlExpress and Management Studio Express on my test server. I want to restore my master database from backup.
From the command prompt I set the Sqlservr -s SQLEXPRESS -m
Then I opened another comand prompt and ran my SQLCMD script to restore the Master Database.
here is the sql script:
RESTORE DATABASE [Master] FROM DISK = N'E:COPLEYNEWSDATABASEBACKUPMaster.bak' WITH FILE = 1, MOVE N'mastlog' TO N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAMaster_1.ldf', NOUNLOAD, STATS = 10
GO
I recieve the following error.
Msg 3154, Level 16, State 4, Server COPLEYNEWSSQLEXPRESS, Line 1
The backup set holds a backup of a database other than the existing 'Master' dat
abase.
Msg 3013, Level 16, State 1, Server COPLEYNEWSSQLEXPRESS, Line 1
How do I restore a Master Database on SQL Express?
View 8 Replies
View Related
Apr 22, 2008
Hi all
i create a setup project with visual studio 2005.
In this project i install cassini, sqlexpress, ajax and my site.
After this i have to restore a database i use for my application.
this is my code:
Server svr = new Server(@".SQLExpress");
Restore res = new Restore();
res.Database = "DbName";
res.Action = RestoreActionType.Database;
res.Devices.AddDevice(Application.StartupPath + @"DbName.bak", DeviceType.File);
.......
if i try to restore it in two machines (XP-Vista) where i have already installed sql server it works fine but when i try to restore it in a virgin machine i have a "Restore failed for Server 'MyServer' " error
So i suppose it's a problem of permission for user or is locked something in sqlexpress while it isn't in sql server
I try to change "Built-in account" in Configuration Manager from Network service to Local System but nothig
someone can help me?
thanks
Marco
View 4 Replies
View Related
Jan 29, 2008
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLAlamoDB.mdf'. (Microsoft.SqlServer.Express.Smo)
--------------------------------
Hi,
I got this error while trying to restore my database (which was running on SQL Server 2005 Express Edition) onto another machine's SQL Server 2005 Express Edition.
Can anyone plz. help me out with this error.
Thanks & Regards
Trinadh P.
View 4 Replies
View Related
Mar 13, 2007
I can't start SQLEXPRESS.
The SQL ERRORLOG shows: Error is 3414, Severity 21, State 2 and says: "An error occurred during recovery, preventing the database 'model' (database ID 3) from restarting." Just prior to this, I get a warning: "did not see LP_CKPT_END".
Any thoughts why this might be and how I can fix this?
View 3 Replies
View Related
Sep 21, 2006
hiya,
I have sqlExpress and sqlServerManagementStudio on my XP pro box.
Will the installation of sqlExpress (Advanced Services) cause any problems?IS thereanything that I shold be aware of in advance?
many thanks,
yogi
View 3 Replies
View Related
Jan 19, 2007
Hi All,
I have created an installation application which will install the application with SQL Express and .NET Framework 2.0.
If i install this application in a Fresh system(i.e which is not having SQL Express), it is installing the application with new database instance successfully.
But if i try to install the same in a system which is already having SQL Express, throwing "Object reference exception" because it is not able to create the new database instance.
Can anybody help me out .
Regards,
Doppalapudi.
View 2 Replies
View Related
Mar 21, 2006
Because of numerous problems trying to get sqlexpress working, I uninstalled it with the intention of reinstalling (via Add or Remove Programs). However, now when I try to reinstall it, I get a message that the I am not making a changes so it won't let me install it.
I do have sql server 2005 developer's edition installed; is that the reason? and does that mean I cannot have both installed on the same machine?
View 1 Replies
View Related
Jul 1, 2006
Hi All,I've been struggling with this for hours...Could someone please advise me on how to convert my current File based SQL Server Express website to a Server based SQL Express one.Particularly interested in what I need to do in the SQL Express management tool, changes I need to make the projecvt itself and changes needed to get IIS to understand things have been changed.Thanks,Martin.
View 1 Replies
View Related
May 7, 2002
Is it possible to execute a DTS package via a stored procedure?
We have created a web-based application with a SQL back-end, I would like the
user to select an option on the .asp page that will then trigger the DTS.
Is this possible? Any suggestions would be greatly appreciated.
Thanks
View 2 Replies
View Related
Mar 2, 2006
Can someone let me know any 10 things that are usally automated using the SQL Server Agent,
I mean besides backup what all can i automate
Thanks
View 1 Replies
View Related
Jan 28, 2014
I want to create a form (Infopath) or web page where the user can request for a new database I want the user to fill in the required info (like the size, name columns.....) and ones they're done filling the required info, they will click on a button and that should trigger the database automation script to run and if the database with the requested name is not created, the script should create a database for the user.
View 1 Replies
View Related
Mar 2, 2006
Can someone let me know any 10 things that are usally automated using the SQL Server Agent,
I mean besides backup what all can i automate
Thanks
View 10 Replies
View Related
Mar 15, 2007
I want to automate a query that I am running everyday. So, what I want to do is run it at a particular time of the day say 11:00pm. Is this possible? Should I create a stored procedure? And also, I want to run an update statement on a particular table on the first of every month. If anyone can give me some advice on this, I would appreciate it.
Jared
View 8 Replies
View Related
May 7, 2007
Folks:
I have a text file which has all "drop" statements (drop proc, drop view)... I want to run this statements on a daily basis. How can I automate this?
Thanks !
View 8 Replies
View Related
Aug 14, 2006
Hi All,
I have created the package using Import data ( from comma delimeted text file)
Actually I schedule the JOB to run the package from SQL Server Agent
I am getting error when start the job. ( job started successfully and executing time am getting error.)
here is the Log error
[298] SQLServer Error: 3621, The statement has been terminated. [SQLSTATE 01000] (ConnIsLoginSysAdmin)
[298] SQLServer Error: 15404, Could not obtain information about Windows NT group/user 'VGOSVRSaleem', error code 0x2095. [SQLSTATE 42000] (ConnIsLoginSysAdmin)
If I run the .dtsx file from outside. it works fine
do I need to do any kind of setup before running/starting the job ??
Please advise
Cheers
Saleem
View 3 Replies
View Related
Feb 8, 2008
I am running this procedure to copy the call data info from oma11wicacct01 to oma11csql5tst01 and to vsql4shared
INSERT INTO [oma11csql5tst01].[rms sql].dbo.WICCallData ( ClientID, ProgramID, Calls, ActSeconds, UsageDate )
SELECT WICCallData.ClientID, WICCallData.ProgramID, Sum(WICCallData.Calls) AS SumOfCalls, Sum(WICCallData.ActSeconds) AS SumOfActSeconds, WICCallData.UsageDate
FROM WICCallData
GROUP BY WICCallData.ClientID, WICCallData.ProgramID, WICCallData.UsageDate
HAVING (Sum(WICCallData.Calls)>0 or Sum(WICCallData.ActSeconds)>0) AND WICCallData.UsageDate>'2/3/2008'
The usage date has to be greater than the max date on the target database!
How can I automate the execution?
View 3 Replies
View Related
Dec 19, 2006
hi!
i already have a program that when you click a button it will get the new transactions in the database then pass it to another database now i need to automate the passing... once there is a new entry in the database it should automatically pass it to the other database. how could i do this?!
thanks!
View 5 Replies
View Related
Feb 15, 2005
I want to be able to fire off a DTS package through calling a stored procedure in my vb.net code.
I know how to call the stored proc in my vb.net code however I do not know how to write a stored proc to automate my DTS package that I have set up.
If anyone can shoot me some ideas please let me know
Thanks for the help in advance
Regards,
RB
View 2 Replies
View Related
Sep 19, 2000
Using SQL Server 7.0, I need to watch for a file to be placed in a directory and then load it automatically. What is the best way to do this? I have the Bulk Insert process set up in DTS and would like to just add another process if possible.
View 2 Replies
View Related
Jul 25, 2001
Hi, and thanks for your help. I usually generate script of a database table, triggers, views, and store procedures by right click table/Task manager/selecting Generate sql script...etc
How can I automate this process, Is there a way where I can set up such sql scripts generation via Ms sql Agent so every week I can generate database script.
Thanks for your help
Ali
View 2 Replies
View Related
Apr 14, 2004
Is there a way to generate reports every 15 minutes for example?
ddave
View 9 Replies
View Related
May 2, 2007
I'm using SQL 2000, which is integrated with a VB.NET 2003 app.I have an Audit trigger that logs changes to tables. I want to applythis trigger to many different tables. It's the same trigger, with theexception of the table name. I could manually change the table name inthe trigger and create it, over and over, but I'd like to automatethis - by iterating through the collection of tables and passing thetablename to something that would create the audit trigger for thattable.Any ideas? With any scripting language I can create the text of theCREATE TRIGGER procedure for each table and use simple textreplacement, but how do I automate that inside of SQL?Thanks.
View 9 Replies
View Related
Dec 6, 2007
Hi,
We are working on a project and are using SQL reporting services for reporting feature. Can somebody guide me how can we automate the testing of such reports.
Thanks
Amit
View 1 Replies
View Related
Dec 15, 2006
Hi,
Unfortunately the deployment Utility does not support adding dll's to the GAC. Still I want to automate it. (By the way on target machines GacUtil is not present). I tried to make a setup project that only adds a dll to the GAC, however the setup project still makes an application folder. How can I turn this off?
Regards,
Henk
View 2 Replies
View Related
Jun 12, 2007
Hopefully, there is a way to do this. I work with two SQL servers. One is our production server the other is our test server. In order to test various things, I often need to copy the source data from one server to the other. Most of our programming is in VBA. It's easy enough to open a recordset and fill it with the data I need from the production server, then upload each record, one at a time, to the test server. The problem is that I am dealing with a massive amount of data and this takes a long time.
I have found that I can use the import task in SQL Server Enterprise and it transfers the data extremely quickly. Is there a way, preferably using VBA, that I could automate this import task process?
Thanks
View 1 Replies
View Related
Jul 11, 2007
We can use rs.exe to publish a report automatically, but how do we do the reverse - remove a report automatically?
Is there a way by using a MS utility?
Is there a way by writing code, using library objects?
Part of the problem we face is having servers with RS all set up with a particular connection string and published reports. We then want to change everything and we want to do it automatically.
View 7 Replies
View Related
Oct 26, 2007
I am very new to SQL 2005. I need to automate backup for the SQL server which can take backup of all databases from the server at fixed time without using third party backup system. Thank you for help.
View 13 Replies
View Related
Apr 10, 2008
OK I have this table I am grbbing from Oracle and I need to take selected columns and do a value lookup against another table: IE Here is a list of fields I get from Oracle:
Code SnippetENTRY_ID
SUBMITTER
CREATE_DATE
ASSIGNEE
LAST_MODIFIED_BY
MODIFIED_DATE
STATUS
SHORT_DESCRIPTION
CATEGORY
TYPE
ITEM
SCHEMA_NAME
SCHEMA_KEYWORD
ID
FULL_NAME
USERNAME
PAGER
PAGERPIN
PAGING_METHOD
RECORD_TYPE
GROUP_ID
GROUP_ALIAS
APPLICATION
NOTIFICATION_SERVICE
ARS_GROUP_NAME
GROUP_TYPE
AUDIT_TRAIL
FULL_NAME_
RESPONSIBILITY
PAGER_EMAIL_ADDRESS
Now I need to do a value lookup on these fields:
Code SnippetSTATUS
RESPONSIBILITY
In this example it is only 2 but in other conversions it could be 20 or more... Now here is my select statement for each Field (The ? being the FIELD from before IE Status or Responsibility):
The is for Status:
Code Snippet
SELECT VALUE AS STATUS_VALUE
FROM Field_Values
WHERE (NAME = 'Project Name') AND (ENUMID = ?) AND (FIELDNAME = 'Status')
This is for Responsibility:
Code SnippetSELECT VALUE AS RESPONSIBILITY_VALUE
FROM Field_Values
WHERE (NAME = 'Project Name') AND (ENUMID = ?) AND (FIELDNAME = 'Responsibility')
So for this the way I am doing it now is I have 2 "Lookup" Components setup... It works fine... However as I said when I get say 20 or so it gets really tiresome. I was wondering if I could feed it a EXCEL or XML file saying these are the fields that need a value lookup where:
FIELD - Project - FIELDNAME VALUE - OUTPUT VALUE
So with this example I would have a file saying something like this:
STATUS - Project Name - Status - STATUS_VALUE
RESPONSIBILITY - Project Name - Responsibility - RESPONSIBILITY_VALUE
Then it runs whatever and returns the *_VALUE for each row it goes through... Any suggestions?
View 12 Replies
View Related
Jan 23, 2007
Hay Gurus'
Please can you help out this with this question????
I have created a SQL 2005 select statement that returns an XML file with the correct items (in the correct format) to be used as a sitemap... This needs to have a function and then a select statement run in conjunction 1 CREATE FUNCTION QuickNav(@MenuItem int)
2 RETURNS XML
3 WITH RETURNS NULL ON NULL INPUT
4 BEGIN RETURN
5 (SELECT ID as "@ID", Title as "@title", url as "@url", Description as "@Description", ParentID as "@ParentID", NodeGroupParent as "@NodeGroupParent", ImageURL as "@ImageURL", NodeGroupSort as "@NodeGroupSort",
6 CASE WHEN NodeGroupParent=@MenuItem
7 THEN dbo.QuickNav(id)
8 END
9 FROM dbo.QuickNavView WHERE NodeGroupParent=@MenuItem
10 ORDER BY NodeGroupSort
11 FOR XML PATH('siteMapNode'), TYPE)
12 END 1 WITH XMLNAMESPACES (
2 DEFAULT 'http://schemas.microsoft.com/AspNet/SiteMap-File-1.0'
3 )
4 SELECT ID as "@ID", Title as "@title", url as "@url", Description as "@Description", ParentID as "@ParentID", NodeGroupParent as "@NodeGroupParent", ImageURL as "@ImageURL", NodeGroupSort as "@NodeGroupSort",
5 CASE WHEN id=31
6 THEN dbo.QuickNav(id)
7 END
8 FROM QuickNavView
9 WHERE id=31
10 ORDER BY NodeGroupSort
11 FOR XML PATH('siteMapNode'), ROOT('siteMap')
So when i run this code in SQL 2005 Express it works fine and i can save the results as a Web.sitemap and my menu looks ok...But now i want to automate this creation process.... have a button that when clicked saves an XML file (Web.sitemap) to a server directory... How Can I Do This????? This may seem like a dumb question but i really do need help and have searched everwhere... any help, pointers to a tutorial would be great...Any Ideas .....Tod BTW the results look like... (and work fine with both tree control and menu) 1 <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
2 <siteMapNode ID="31" title="root" url="~/Default.aspx" ImageURL="~imagesEASLogoSmall.jpg" NodeGroupSort="1">
3 <siteMapNode ID="34" title="Business" Description="Group node for Business Objects" NodeGroupParent="31" xmlns="">
4 <siteMapNode ID="1" title="Business Case" url="~/EASObjectInventory.aspx?LookUPID=BusinessCase" NodeGroupParent="34" ImageURL="~imagesBusinessCase.gif" NodeGroupSort="100" />
5 <siteMapNode ID="19" title="Business Plan" url="~/EASObjectInventory.aspx?LookUPID=BusinessPlan" NodeGroupParent="34" ImageURL="~imagesBusinessPlan.gif" NodeGroupSort="200">
6 <siteMapNode ID="9" title="Mission" url="~/EASObjectInventory.aspx?LookUPID=Mission" ParentID="19" NodeGroupParent="19" ImageURL="~imagesMission.gif" NodeGroupSort="210" />
7 <siteMapNode ID="10" title="Vision" url="~/EASObjectInventory.aspx?LookUPID=Vision" ParentID="9" NodeGroupParent="19" ImageURL="~imagesVision.gif" NodeGroupSort="220" />
8 <siteMapNode ID="11" title="Goal" url="~/EASObjectInventory.aspx?LookUPID=Goal" ParentID="10" NodeGroupParent="19" ImageURL="~imagesGoal.gif" NodeGroupSort="230" />
9 <siteMapNode ID="12" title="Strategic Objective" url="~/EASObjectInventory.aspx?LookUPID=Strategic Objective" ParentID="11" NodeGroupParent="19" ImageURL="~imagesObjective.gif" NodeGroupSort="240" />
10 </siteMapNode>
11 <siteMapNode ID="7" title="Bussiness Concept" url="~/EASObjectInventory.aspx?LookUPID=BusinessConcept" NodeGroupParent="34" ImageURL="~imagesBusinessConcept.gif" NodeGroupSort="300" />
12 </siteMapNode>
13 <siteMapNode ID="24" title="Compliance Item" url="~/EASObjectInventory.aspx?LookUPID=ComplianceItem" NodeGroupParent="31" ImageURL="~imagesComplianceItem.gif" NodeGroupSort="400" xmlns="" />
14 <siteMapNode ID="32" title="Exposure" url="~/EASObjectInventory.aspx?LookUPID=Exposure" NodeGroupParent="31" ImageURL="~imagesRisk.gif" NodeGroupSort="500" xmlns="" />
15 <siteMapNode ID="26" title="Human Resource" url="~/EASObjectInventory.aspx?LookUPID=HumanResource" NodeGroupParent="31" ImageURL="~imagesHumanResources.gif" NodeGroupSort="600" xmlns="" />
16 <siteMapNode ID="13" title="IT Component" url="~/EASObjectInventory.aspx?LookUPID=ITComponent" NodeGroupParent="31" ImageURL="~imagesITComponent.gif" NodeGroupSort="700" xmlns="" />
17 <siteMapNode ID="14" title="IT Hardware" url="~/EASObjectInventory.aspx?LookUPID=ITHardware" NodeGroupParent="31" ImageURL="~imagesITHardware.gif" NodeGroupSort="800" xmlns="" />
18 <siteMapNode ID="16" title="KPI" url="~/EASObjectInventory.aspx?LookUPID=KPI" NodeGroupParent="31" ImageURL="~imagesKPI.gif" NodeGroupSort="900" xmlns="" />
19 <siteMapNode ID="18" title="Portfolio" url="~/EASObjectInventory.aspx?LookUPID=Portfolio" NodeGroupParent="31" ImageURL="~imagesPortfolio.gif" NodeGroupSort="1000" xmlns="" />
20 <siteMapNode ID="27" title="Process" url="~/EASObjectInventory.aspx?LookUPID=Process" NodeGroupParent="31" ImageURL="~imagesProcess.gif" NodeGroupSort="1100" xmlns="" />
21 <siteMapNode ID="20" title="Product" url="~/EASObjectInventory.aspx?LookUPID=Product" NodeGroupParent="31" ImageURL="~imagesProduct.gif" NodeGroupSort="1200" xmlns="" />
22 <siteMapNode ID="29" title="Program" url="~/EASObjectInventory.aspx?LookUPID=Program" NodeGroupParent="31" ImageURL="~imagesProgram.gif" NodeGroupSort="1300" xmlns="" />
23 <siteMapNode ID="17" title="Project" url="~/EASObjectInventory.aspx?LookUPID=Project" NodeGroupParent="31" ImageURL="~imagesProject.gif" NodeGroupSort="1400" xmlns="" />
24 <siteMapNode ID="21" title="Service" url="~/EASObjectInventory.aspx?LookUPID=Service" NodeGroupParent="31" ImageURL="~imagesService.gif" NodeGroupSort="1600" xmlns="" />
25 <siteMapNode ID="25" title="Stakeholder" url="~/EASObjectInventory.aspx?LookUPID=Stakeholder" NodeGroupParent="31" ImageURL="~imagesStakeholder.gif" NodeGroupSort="1700" xmlns="" />
26 <siteMapNode ID="23" title="Standard" url="~/EASObjectInventory.aspx?LookUPID=Standard" NodeGroupParent="31" ImageURL="~imagesStandard.gif" NodeGroupSort="1800" xmlns="" />
27 <siteMapNode ID="35" title="Administration" url="~/admin/Default.aspx" NodeGroupParent="31" NodeGroupSort="5000" xmlns="" />
28 </siteMapNode>
29 </siteMap>
View 4 Replies
View Related