Tuesday, March 20, 2012

Restoring a .bak file to a SQL Server database


This is for my own benefit… when restoring a .bak file to a SQL Server database where the .bak file was not originally backed up from, right click –> All Tasks –> Restore Database –> From device –> Select Devices –> Add your .bak file. Click OK. Click the Options tab. Now on the left side you should see the Logical file name of the database from the .bak file. On the right side under the lable ‘Move to physical file name’, should be the path that the .bak file originally existed as. This field needs to be changed to the path & file name of the database you’re restoring too. After modifying those two fields, check the ‘Force restore over existing database’ and click ‘OK’.

Thursday, December 09, 2010

You just created a code project but it will not compile and get the error message: "does not contain a static 'main' method. Change the project property setting of "output type" to "Class Library". Recompile to test.....

Wednesday, May 12, 2010

T-SQL search table columns for a particular field:

select sysobjects.name
from syscolumns
left join sysobjects on sysobjects.id = syscolumns.id
where syscolumns.name like 'Field_Name'
order by 1

Friday, February 05, 2010

If you happen to get a "http 403 error" while trying to debug a .net web service, be sure to set the .asmx file to "set as start page". If you get the error you may spend a great deal of time trying to find the solution as I did with no luck.

Friday, October 30, 2009

Replace "Search_String", below, with the string you want to find.

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%Search_String%'
AND ROUTINE_TYPE='PROCEDURE'

Thursday, October 08, 2009

My test project will not build and it indicates that the proper reference is not set. So where is "Microsoft.VisualStudio.QualityTools.UnitTestFrameWork.dll" and how do I get it? You already have it.

...%VSINSTALLDIR%\Common7\IDE\PublicAssemblies

Add the reference to the bin directory and you're all set.
Using firefox I downloaded "Microsoft Enterprise Library 4.1". When trying to install I get an error "A network error"....After repeated aptempts, no luck.

The fix. Download the .msi by using IE. It worked but do not understand why. Oh well....

Tuesday, October 06, 2009

If you get this error message "Only one instance of a ScriptManager can be added to the page.", make sure you have a .aspx page set as "start page" before wasting a lot of valuable time searching for an answer. I unfortunately did waste the time to look up the error with no one knowing the cause.

At first glance, it appears that you put a "ScriptManager" control on two pages like master page as well as .aspx page. After seaching high and low, I figured out the problem. Cheers!