Showing posts with label shown. Show all posts
Showing posts with label shown. Show all posts

Friday, March 23, 2012

Recovering MDF file! Need Assistance!!

Somehow, our MS SQL 2000 Server database mdf file size is 0,
The database is in suspected state. and the backup file related to that database shown 0 size.
Its totaly weird as there are many databases in server group but just one database's mdf file and backup file size is 0.

Any idea how this can possibly happen and is there any way to recover it from this state

Thank you very muchTry running sp_resetstatus 'DBNAME' .
For a Suspect database the query "Select Status from master..Sysdatabases' would return 256.
The above sp should set it back to 0.

Also restoring the database file will turn off the suspect mode.|||reseting status did not help cause mdf files' physical size on the HD is zero bytes. the backup files size is as same as its

IS there a way to see a log file in sql to see what has happened?|||The only tool I have heard of that does this is Lumigent Log Explorer. It is fairly expensive though...

http://www.lumigent.com/products/le_sql/le_sql.htm|||My guess is that there is something wrong with your backup procedure (has it ever been tested) and that the zero length file has been restored.

Tuesday, March 20, 2012

Recover lost data

Hello!

Hopefully someone can help me that i have lost my data on my D: drive.

driven shown all folder but in side of the folder there is nothing.

i have lost my Doc, xls, Jpeg etc. all files.

please help me what sould i have to do.

thanks

This forum is specific to disaster recovery in SQL Server databases.

The standard answer is that you need to find your most recent backup and restore from it.

|||Don't worry you will get back your data. Try Stellar Phoenix Windows Data Recovery Software a file and parition recovery utility which recovers the lost data from formatted hard drive or data lost occur due to software malfunction, viruses or even sabotage.
Download the demo version of the software from: http://www.stellarinfo.com/partition-recovery.htm Scan your hard drive with it and it will show you the preview of the recovered data. If you are able to see your data through demo version then get the full version to save it.

Recover lost data

Hello!

Hopefully someone can help me that i have lost my data on my D: drive.

driven shown all folder but in side of the folder there is nothing.

i have lost my Doc, xls, Jpeg etc. all files.

please help me what sould i have to do.

thanks

This forum is specific to disaster recovery in SQL Server databases.

The standard answer is that you need to find your most recent backup and restore from it.

|||Don't worry you will get back your data. Try Stellar Phoenix Windows Data Recovery Software a file and parition recovery utility which recovers the lost data from formatted hard drive or data lost occur due to software malfunction, viruses or even sabotage.
Download the demo version of the software from: http://www.stellarinfo.com/partition-recovery.htm Scan your hard drive with it and it will show you the preview of the recovered data. If you are able to see your data through demo version then get the full version to save it.

Saturday, February 25, 2012

Records Between two date columns

Hi All,
I am having a problem getting records between two date columns. My table is shown below.

SAP_ID JoinDate LeaveDate
1 2006-01-23 00:00:00.000 2006-04-12 00:00:00.000
2 2006-09-04 00:00:00.000 2007-10-10 00:00:00.000
3 2006-10-03 00:00:00.000 2007-01-01 00:00:00.000
4 2007-12-04 00:00:00.000 2007-10-10 00:00:00.000

From asp page i am getting joindate and leavedate . I need to show records between joindate and leavedate.

For ex:
If
JoinDate=2006-01-01
LeaveDate=2007-01-01
then

report should show 1,2,3 SAP No's. But My Query showing only 1, 3. Here is the my query.

select sap_id from tblsap where joindate >= '2006-01-01' and leavedate <='2007-01-01'

I am not able to figure out the problem. Can some one please post suggestions to my problem.

Rajesh

The row 3 has leaveDate greater than 2007-01-01. You can AND logic in where clause and that row doesn't match where clause. So your query won't catch this row. You need understand requirement and make a little change your code.

SAP_ID JoinDate LeaveDate
3 2006-10-03 00:00:00.000 2007-01-01 00:00:00.000

select sap_id from tblsap where joindate >= '2006-01-01' and leavedate <='2007-01-01'

|||

As I understand the problem, you want rows where the 'active' period included any part of the year 2006.

I think that this should accomplish the task.

Code Snippet


SET NOCOUNT ON


DECLARE @.MyTable table
( SAP_ID int,
JoinDate datetime,
LeaveDate datetime
)


INSERT INTO @.MyTable VALUES ( 1,'2006-01-23', '2006-04-12' )
INSERT INTO @.MyTable VALUES ( 2,'2006-09-04', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 3,'2006-10-03', '2007-01-01' )
INSERT INTO @.MyTable VALUES ( 4,'2007-12-04', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 5,'2005-05-15', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 6,'2007-01-01', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 7,'2005-05-15', '2005-12-31' )


SELECT
Sap_ID,
JoinDate,
LeaveDate
FROM @.MyTable
WHERE ( JoinDate < '2007-01-01' --Join Prior 2007 and
AND LeaveDate >= '2006-01-01' --Leave 2006 or After
)