Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

Saturday, 4 February 2012

January Review

The first month of 2012 was fairly busy. 

A lot of it was SQL Server work.  I worked on a script to merge a couple of databases together, another smaller SQL script to copy some data within the same database, and wrote a stored procedure and SSRS report for a management system.

Also did some work on a Maximo / Great Plains Dynamics interface, programming a means to let the user edit some of the data before it was copied over.

The plan for February was to work on a new project for a forestry client.  That's still the plan, but in the first three days of the month, four different clients sent me requests as well.  It's going to be a busy month.

Friday, 6 January 2012

Use T-SQL to restore a database

Way quicker than using SQL Server Management Studio, especially if you have to repeat often.

RESTORE DATABASE [Database Name]
FROM DISK 'c:\data\client\project\backupfile.bak'
WITH FILE = 1

Tuesday, 20 December 2011

SQL Server Restore - Filestream feature is disabled

I was trying to restore a database in SQL Server 2008 and got the error: Restore failed... FILESTREAM feature is disabled.  It was annoying because I was able to restore another database no problem, but this particular one I couldn't restore.

After much Googling, I figured out how to enable the file stream.  There are two steps:
  1. Open SQL Configuration Manager, click on SQL Server Services on the left hand pane, and then right-click SQL Server on the right hand pane.  Select properties.  On the FILESTREAM tab, check off all three options.  OK out of the dialog and restart SQL Server. (Right-click and select restart).
  2. Run the following in SQL Management Studio:
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
After that, I was able to restore the database.