문제

I create a table variable with an identity column in my script, I want to reseed this column. Can I use below script?

DBCC CHECKIDENT (tableVariableName, reseed, @NewStartSeedValue)
도움이 되었습니까?

해결책

You cannot reseed a table variable's identity column, you would need to use a temp table instead. Depending on what you want to do, the ranking functions (row_number()) may be of use.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top