Hello everyone.

I have DB, and want to move it to another PC.

I use MSSQL Publishing Wizard or SQL Server Management studio to create dump.

There is some problem after I executed dumped queries.

I get error "Invalid tuple descriptor" when trying to insert something.

I can upgrade domain, it solves this problem.

But it seems that autoincremented IDs reset theirs last inserted value after that.

How can I make correct dump of DO database?

PS. Sorry for my English :)

asked Oct 12 '10 at 04:06

Ness's gravatar image

Ness
155232328

edited Oct 18 '10 at 00:12

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412


3 Answers:

With SQL server management studio, you can right click on a database and select "Tasks" then "Backup..." to get a .bak file.

You can then restore this file on another server.

answered Oct 12 '10 at 10:11

olorin's gravatar image

olorin
358878792

Yes, thanks. I used Tasks-Generate Scripts.

(Oct 12 '10 at 12:07) Ness Ness's gravatar image

That's not usual way of doing MSSQL database backups. Script generation there is mainly intended to be used for administrative purposes.

(Oct 12 '10 at 14:24) Alex Yakunin Alex%20Yakunin's gravatar image

I.e. usual way is to use Tasks - Backup \ Restore.

(Oct 12 '10 at 14:24) Alex Yakunin Alex%20Yakunin's gravatar image

P.S. Please accept the correct answer, if it's there ;)

(Oct 12 '10 at 14:25) Alex Yakunin Alex%20Yakunin's gravatar image

Yes, it's here :)

Thanks.

(Oct 13 '10 at 03:47) Ness Ness's gravatar image

You must ensure all Xxx-Generator tables are included into the dump, and their identity seed and increment values are also dumped there.

These tables are used to emulate sequences, that are supported by other database (and described in SQL-99), but aren't supported by SQL.

answered Oct 12 '10 at 05:08

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

edited Oct 12 '10 at 05:10

Ok, I understand. Here is sql, generated by Management Studio:

CREATE TABLE [dbo].[Int32-Generator](
    [ID] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [PK_Int32-Generator] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

Both seed and increment = 1.

But I can't find option that will include seed and increment values in dump.

Could you recommend some tool to make correct dumps?

answered Oct 12 '10 at 06:01

Ness's gravatar image

Ness
155232328

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA