Find Missing Identity - SQL in Sixty Seconds 195

preview_player
Показать описание
Learn How to Find Missing Identity from Table.

Script used in this blog post:

0:00 Intro
0:11 Real-World Story
0:40 Find Missing Identity
1:37 Final Note

Join this channel to get access to perks:

#SQLServer #PerformanceTuning #SQLAuthority
Рекомендации по теме
Комментарии
Автор

Such a simple script that can save you a lot of time and effort. Thanks Pinal

frankzelazko
Автор

Hey Pinal, thanks for the vids man, really informative!
Is it possible to do data forecasting with TSQL?

jasonbrad
Автор

Hi Pinal,

Thankyou so much for this video. Really helpful.

Can we also find the missing dates as well?

surajviswakarma
Автор

Kindly please make a video where we want to know which section runs first.
There is a interview question been asked that which portion will run first and second last

Select * from Table where Col = '' and Col1 = ''...

Select * from Table 1 Group by Having ....

namangupta
Автор

Would it be possible to replace the table being search with a variable so this could be turned into a stored procedure that you pass the schema name and table name to and it searches for missing IDs?

ChristopherSalisburySalz
Автор

Good video 👍👌👌 any idea how to recover the identity values along with data after delete was performed

harishkumarreddy
Автор

Does this assume that we have a reference table that contains all the identity values? I mean does it match the table with missing identity values with the reference table that contains all (and hence super set) the identity values to find out the missing values?

savananjaria
Автор

SELECT DISTINCT id +1
FROM mytable
WHERE id + 1 NOT IN (SELECT DISTINCT id FROM mytable);

legend__ay
Автор

please copy the script here. I don't see any script here.

SunilKumar-iyhh