What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 13509 |  Welcome, Guest!   Register  Login
 Home > Forums > Sql Server > I have problem in sql query ...
Nuwan

I have problem in sql query

Replies: 10 | Posted by: Nuwan on 7/9/2012 | Category: Sql Server Forums | Views: 308 | Status: [Member] | Points: 10  


Hi all,

Unfortunately I use wrong delete command without where condition my one of table all the data deleted,
How I recover it? Is it possible. Please help me.

Thanks...

Rathnayake


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Akiii
Akiii  
Posted on: 7/9/2012 2:11:55 AM
Level: Bronze | Status: [Member] | Points: 25

You don't have a backup of the database ?


Thanks and Regards
Akiii

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Nuwan
Nuwan  
Posted on: 7/9/2012 3:35:59 AM
Level: Starter | Status: [Member] | Points: 25

Actually I have old backup... It not included new data.

Rathnayake

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Akiii
Akiii  
Posted on: 7/9/2012 3:45:22 AM
Level: Bronze | Status: [Member] | Points: 25

I don't think that it is possible. Whenever running a delete or update you should always use BEGIN TRANSACTION, then COMMIT if successful or ROLLBACK if not. Have you done that ?


Akiii

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Johnbhatt
Johnbhatt  
Posted on: 7/9/2012 3:48:30 AM
Level: Starter | Status: [Member] | Points: 25

This is nearly Impossible.

But While searching for Solutions I found a Link,

http://raresql.com/2011/10/22/how-to-recover-deleted-data-from-sql-sever/

Try to Get if some helpful there.

John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Nuwan
Nuwan  
Posted on: 7/9/2012 4:01:30 AM
Level: Starter | Status: [Member] | Points: 25

Actually I only do "delete from table1" run that query



Rathnayake

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Bhupentiwari
Bhupentiwari  
Posted on: 7/9/2012 4:02:27 AM
Level: Starter | Status: [Member] | Points: 25

I think it not possible.

Thanks n Regards
Bhupendra Tiwari

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Ranjeet_8
Ranjeet_8  
Posted on: 7/9/2012 7:48:05 AM
Level: Gold | Status: [Member] | Points: 25

its not possible.

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 7/9/2012 8:37:45 AM
Level: Starter | Status: [Member] | Points: 25

Hi

I also think that it is impossible

but as John Bhatt post a link i read review and many people say that its working fine for some table for sql server 2005 and above

Really that's nice

Regards


R D Patel

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muhsinathk
Muhsinathk  
Posted on: 9/4/2012 6:23:54 AM
Level: Bronze | Status: [Member] | Points: 25

Hi,
I also think that it is not possible.
When you delete datas from database, please use TRANSACTION.

DECLARE @CustomerID AS int
SET @CustomerID=''

BEGIN TRY
BEGIN TRANSACTION;

IF EXISTS(SELECT * FROM Customer WHERE CustomerID=@CustomerID)
BEGIN
DELETE FROM Customer WHERE CustomerID=@CustomerID
PRINT 'DELETED'
END

COMMIT TRANSACTION;
END TRY
BEGIN CATCH
PRINT 'Unexpected error occurred!'
ROLLBACK TRANSACTION;

END CATCH

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Maheshvishnu
Maheshvishnu  
Posted on: 9/4/2012 6:36:47 AM
Level: Starter | Status: [Member] | Points: 25

Not Possible

mahesh

Nuwan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 10:53:01 PM