.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Restore database from system dbs and log file when .mdf file size set to 0KB after Windows Update ?

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :Sql Server

This can't be right. Friday I tried to install some Windows updates including ‘Security Update for …Windows Server 2008 for x64-based Systems (KB2416473)’ on both my host Server 2008 box and on a VM instance of Server 2008 running on the same physical box. An important SQL Server 2008 instance lives on that VM.


The above mentioned update failed on both the host and the VM, but a system shutdown and reboot were required for both OS’s anyway. When SQL Server started up again on the VM, the *.MDF file size for 2 (out of maybe 15 total) databases had been reduced to 0KB. Additionally, 1 of accompanying *.LDF files was now also 0KB in size, while the other *.LDF file was probably its normal size of 2.9GB. All the other databases and log files, including Master.mdf, seem to be okay.


I’m new to SQL Server and have a couple of questions of cours

View Complete Post

More Related Resource Links

Update Profile Database from text file using BDC



I have a requirement to import the profile properties from a text file in sFTP to update the MOSS Profile Database. The objective is to create a single repository for the Staff Directory in MOSS.

Can I use BDC to connect and update the Profile database?

What is the alternate approach?


Can't restore database backup file in my database ? using sql server 2005. please help

VERY IMPORTANT i am trying to restore database.bak in sql server 2005 (i know the database.bak was also generated in sql 2005 server) i am trying to restore back up database .bak into the new database i just created in sql server 2005 i have saved my database .bak into c drive and when i select database .bak "From Device", it doesn't get populated in the list below and i see nothing and it keeps on prompting a message "You must select a restore source" Here's the screen shot:   PLEASE HELP..it's really important (i tried restoring database in sql server 2008 and it was sucessful but i am facing this problem in sql server 2005 only)  

How to restore database from .bak file /

I have a .bak database file and i want to restore it to a new database so that i can get the data inside the .bak fileI am using SSMS 2008 Expresswhat i did :I created a database with the same name as of my .bak file (in my case "RM")now after creating a new database > righclick  on database > tasks > restoreSelected FROM : RM ( empty database that i just created)Selected TO : RM.bak (my backup file)when i press "Ok"i get this error:

what is the better design for location of system database data / log files and user data/log file,

is there a guideline for better performance for system database data location log location, like tempdb location etc. also better location for user databases/data and log.

file size increase when moving from file system to sharepoint 2007

Hi, While moving files from file system to Sharepoint 2007 via windows explorer view, why do file sizes increase? thanks, Burcu  

FAQ: How do I listen to changes in a file/directory in the windows file system?

How do I listen to changes in a file/directory in the windows file system?Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

how to periodically update database file of my wpf application?

Hi, I have a WPF Windows application which we distribute to our clients. The application consists of some database table which changes every month. eg. the application users a  exchange rate table which is valid for one month. What is the best approach to update the data in these table. Please note that the whole application is not changing but only the data in it changing. Please guide me with some options how I can achieve this task. Thank You. Mohamed Ziyad

Need to restore MDF or LDF file from BAK without creating database.

I need to restore the actual MDF or LDF files within a BAK file without creating/restoring to another database. I just need the physical MDF or LDF files only. Is there a way to do this?
What is not explicitly allowed should be implicitly denied

Restore database from file and reduce datafile while restoring


SQL 2005 Standard.

I want to restore a database from a .bak file. This bak file is referred to a database with fixed size datafile but they are bigger than I need for the new database.

Is there a way to reduce datafile size, during restore process ? I ask this because I will have to do this operation programmatically.


Create a new Database from .bak file OR Restore a database from .bak file with out using database


i need to create a database, and i have a mydatabase.bak( another database from other system).

nw i need to create a database and restore the database from that .bak file. is it possible to create and restore with in single query?

[ my requirement is restore a database from .bak file without using database file path]

Please help me


The file-size of website project contain blank database.mdf


I tested the file-size of my new website using VS 2008. The new website contains almost one blank page aspx and one “Database.mdf” with no record in database. “Database.mdf” contains one table, and the table has 2 columns with no record at all.

When I take a look the file-size of this website, total folder project size is 2.68 MB. The most file-size is at folder “App_Data” that is 2.67 MB. The breakdown file-size of “App_Data” is 2.2 MB for Database and 0.5 MB for Database_log. My questions are:

  • How much the file-size normally for the new website that is similar with my testing?
  • If there is something problem with my VS 2008 setup, please advise me how to fix it.


WSS 3 Storage Space vs. Database File Size


Our SharePoint (WSS 3.0) databases are on a SQL-2000 server that's starting to get low on disk space. In order to buy some time to move content into either our MOSS or SP-2010 environment we did some cleanup in SharePoint by archiving & removing several old sites and removing older document versions in a couple of libraries. These changes were made 3 days ago. The Site Settings | Storage Space Allocation page indicates that content size is a little under 37 GB, down from a bit more than 40 GB. (I did make sure that the deleted files / versions were also removed from the site collection recycle bin.)

What has us puzzled is that the physical database file on the SQL Server has not gotten smaller and the amount of "free space" that can be reclaimed has actually gone down - it's currently at about 200 MB. The database file size is over 57 GB; 20 GB larger than SharePoint reports.

So, I have a few questions:

  1. Is it normal for the content database file size to be significantly (50-60%) larger than the amount of content that SharePoint reports?
  2. Is it normal for the database not to get smaller (or at least have more internal free space) when a large amount of content is removed?
  3. Is there any way that we can recover some of this space to get some breathing room on the SQL Server?



Does this look correct for saving a file/ new record to a database


So thank you for all your help so far, So I think i got this right,
but would like for you all to look it over to see if there is any
areas I might run into trouble with:

//using asp.net mvc 2
the table (sql server 2005, using entities framework)
table fields
"Pattern_Media_GUID  uniqueid 
"Pattern_GUID  uniqueid
"Media varbinary(max)  
"height int
"Width int
"Media_Type String (50)

the form:
<h2> Add Media to this pattern</h2>
<% Html.EnableClientValidation(); %>
<% Html.BeginForm("AddMedia", "Pattern", new { id= Model.Pattern_Guid} , FormMethod.Post, new {enctype = "multipart/form-data"}); %>
    <%: Html.Label("height") %>
    <%: Html.TextBox("height") %>

    <%: Html.Label("width") %>
    <%: Html.TextBox("width") %>

    <%: Html.Label("Media") %>
    <input type="file" id="Media" name="Media" />
    <input type="submit" name=

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

Compiler Error Message : CS0006: Metadata file 'System.EnterpriseServices.dll' could not be found


I get this error when i Debug my web application....


I followed these steps.,

  • Ended the aspnet_wp.exe process in the Windows Task Manager
  • Then deleted the application`s folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
  • Then started Visual Studio 2008 again

I also rebooted my system but no use....

Plz help !

Access Control: Understanding Windows File And Registry Permissions


Understanding the ACLs that govern permissions and rights before an operation is allowed to proceed is critical to enhancing security.

John R. Michener

MSDN Magazine November 2008

NTFS: Enhance Your Apps With File System Transactions


Presented here is an overview of Transactional NTFS and how it revolutionizes transactions.

Jason Olson

MSDN Magazine July 2007

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend