Groups | Blog | Home
all groups > sql server (alternate) > december 2006 >

sql server (alternate) : SQL can it be done ?


David Portas
12/13/2006 3:46:37 PM
[quoted text, click to view]

If you've lost some data then first see if you can restore it from a
backup. Assuming you want to recover some data selectively then you can
restore to a new database and extract the data you want.

Maybe you just need to know how to insert an IDENTITY column value. In
that case, use the SET IDENTITY_INSERT option:

SET IDENTITY_INSERT tbl ON;
INSERT INTO tbl (id, col1, col2) VALUES (1234, 'foo','bar');
SET IDENTITY_INSERT tbl OFF;

Hope this helps.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
BD
12/13/2006 3:50:37 PM

[quoted text, click to view]

If you're asking if a value can be reverted back after a commit, I
strongly doubt it.

What are your backup policies? PLEASE don't say you haven't backed up
this db in the whole 6 years...?
JF Fortier
12/13/2006 6:05:30 PM
Hi group

I'm not familiar with the name, newbies user.

The SQL key is call Row # ?? if that correct can it be possible to create a
new record and replace that unique ID key to a previous erase value ??

Some one did a terrible mistach by erasing data without knowing the full
consequence of her act, now I lost all reference from 6 years of reports job
cost because of that, so when creating the new key and replacing the Row#
with the original, all link to that will be restore.

Thank you

JF Fortier

othellomy NO[at]SPAM yahoo.com
12/13/2006 9:29:34 PM
Hello JF,
You need to tell me:
1. What is the structure of the table where data is lost(?). Primary
keys, foreign keys etc.
2. What is the nature of the problem ie what data was there before and
what got lost and what data is there now.
3. Any other relevant issues.
Once you provide these 3 details maybe we can look into it. Doesn't
sound like a complex issue though.

[quoted text, click to view]
JF Fortier
12/14/2006 3:32:18 PM
Hi

OK, Phase 2

I have restore the backup file from the tape, it's now a Database_Dt1_Bak
file on my HD
All I want to know now is how do I get to see inside that file ??
I'm going to look inside and see what whore the 5 Identity that are erase
and using identity on/off, I will go back and put the 5 news keys to the
original key are VOILA it's done.

In the database dt1 I have many sub-database..... and the one that I need to
set back to original is about 15 rows only.....

With Entreprise Manager, I can go see the database, I can create a new one,
but I don't know how to setup this new temporary database to the server as
dt1_Bak.

The only option I have is to create a new one, then I try to restore data
from my file into the database.... I can't it ask for backup file done with
Backup Manager, it won't allow my to select source from a file....

Thank you all for your help


<othellomy@yahoo.com> a écrit dans le message de news:
1166074174.862413.301830@l12g2000cwl.googlegroups.com...
[quoted text, click to view]

othellomy NO[at]SPAM yahoo.com
12/14/2006 8:01:43 PM
Hi,
You should restore from device and set it up to choose the backup file
name making sure you have the right file directory under the options
tab. Can you ask someone to show you how?

[quoted text, click to view]
AddThis Social Bookmark Button