How to copy tables from other db

11/27/2019 17:23 alangomez2#1
deleted
11/27/2019 20:28 #HB#2
You can set IDENTITY_INSERT off, copy, then set it back on.
11/28/2019 20:36 NorseGodTyr#3
Quote:
Originally Posted by alangomez2 View Post
Two tables

*Shard
*Shard1

Table _RefGame_World

I cant copy the table from Shard1 to Shard

There is a problem with the Constraint Pk key

So what i can do??

If i deleted the primary key then i cant recreate it

If i dont delete it i cant copy the tables

Any hints?

With my Shard ([Only registered and activated users can see links. Click Here To Register...])

With a clean Shard db (Shard1)

[Only registered and activated users can see links. Click Here To Register...]

So the problem is that, with my shard jump from 94 to 96 and with a clean db not, why?
Red is the Table
SELECT * INTO SRO_VT_SHARD.dbo._RefObjItem from SRO_VT_SHARD1.dbo._RefObjItem
11/29/2019 00:52 alangomez2#4
Quote:
Originally Posted by #HB View Post
You can set IDENTITY_INSERT off, copy, then set it back on.
Dude i fixed it, but i tried that and, cant cuz the key clustered

Quote:
Originally Posted by NorseGodTyr View Post
Red is the Table
SELECT * INTO SRO_VT_SHARD.dbo._RefObjItem from SRO_VT_SHARD1.dbo._RefObjItem
That's for sure not working since the identity and also the key, i tried this method b4
11/30/2019 07:48 hoangphan7#5
INSERT INTO Shard.._Table Select * from Shard1.._Table
11/30/2019 19:45 alangomez2#6
Quote:
Originally Posted by hoangphan7 View Post
INSERT INTO Shard.._Table Select * from Shard1.._Table
You should read first, i've fixed but your method won't work since there is needed to set identity insert on and also the table has a pk key