Monday, October 13, 2008

Attaching SQL Server .mdb without .ldf file

If you're using SQL Server 2005:
create a database of equal size to the one you're trying to attach
shutdown the server
swap in the old mdf file
bring up the server and let the database attempt to be recovered and then go into suspect mode
put the database into emergency mode with ALTER DATABASE
run DBCC CHECKDB (dbname, REPAIR_ALLOW_DATA_LOSS) which will rebuild the log and run full repair
Your database will be available again but you'll have lost data and the data won't be transactionally consistent - see the following blog posts:
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/15/632398.aspx
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/16/633645.aspx
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/18/636105.aspx
If you're on SQL Server 2000, you can still do this but you'll need to use the undocumented DBCC REBUILD_LOG at your own risk.

original post on MSDN

Wednesday, October 1, 2008

ASP.NET Visual Studio Project Types

(thru 2008)
" Visual Studio supports two modes of project management: Web Site Projects and Web Application Projects. Web Site Projects lack a project file, whereas Web Application Projects mimic the project architecture in Visual Studio .NET 2002/2003 - they include a project file and compile the project's source code into a single assembly, which is placed in the /bin folder. Visual Studio 2005 initially only supported Web Site Projects, although the Web Application Project model was reintroduced with Service Pack 1; Visual Studio 2008 offers both project models. "
- Scott Mitchell


Useful, related links:
Converting a Web Site Project to a Web Application Project
Web Application Projects versus Web Site Projects
ASP.NET Web Application Project Deployment Overview