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)
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
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
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.
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?
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.
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
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.
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?
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.
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?
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.
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.
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.
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.
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 ??
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!
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?!
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.
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.
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.
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.
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?
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?
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.
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.
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:
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?
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>