Quantcast
Channel: SQL.ru: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 7251

Как передить данные в новую таблицу с identity?

$
0
0
Есть таблица с полем identity

create table s1
(
id int identity(1,1)
string mvarchar(2000),
hash int
)

Надо перелить данные в новую таблицу, но чтобы id стал bigint identity
типа такого:

select cast(id as bigint) as bigid, string, hash into newtable from s1;
?

или все-таки надо создать таблицу и в нее делать

insert ...
select...
?

Viewing all articles
Browse latest Browse all 7251

Trending Articles