You've already forked ssms-addin
mirror of
https://github.com/alex-bochkov/ssms-addin.git
synced 2025-11-23 22:04:53 +02:00
15 lines
475 B
MySQL
15 lines
475 B
MySQL
|
|
sp_msforeachdb N'
|
||
|
|
USE [?];
|
||
|
|
PRINT ''USE [?]'';
|
||
|
|
With AllIdent as (SELECT
|
||
|
|
CAST(last_value as bigint) + 1 as NextValue, OBJECT_NAME(T.object_id) as TName, SCHEMA_NAME(T.schema_id) as SName
|
||
|
|
FROM sys.identity_columns IC
|
||
|
|
inner join sys.tables T on IC.object_id = T.object_id
|
||
|
|
where last_value is not null
|
||
|
|
)
|
||
|
|
select
|
||
|
|
''DBCC CHECKIDENT ('' + QUOTENAME(SName +''.''+ TName, '''''''') + '', RESEED, '' + CAST(NextValue as VARCHAR(15))+ ''); ''
|
||
|
|
FROM AllIdent
|
||
|
|
where DB_ID() > 4
|
||
|
|
'
|