Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

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.

Tuesday, 13 December 2011

Combo box changing background colour

I had an odd thing happen in one of my Access databases.  On one of the forms, a bunch of the combo boxes were changing colour when they lost the focus.  It worked fine in Access 2003, but the problem appeared when running the program in Access 2007.

To fix, open the form in design view and view the properties of the detail section (assuming that's where the controls are).  There will be a property called 'Alternate Back Color'.  It's likely set to 'No Color'.  Set it to white, or whatever you want the colour of your combo box to be.  That should fix the problem.