question

VijayKumar768 avatar image
0 Votes"
VijayKumar768 asked EchoLiu-msft commented

Datatype limit in SQL Server 2016

Hi team,


 some tables in our prodDB are running close or over PKID

 given it maybe INT or BIGINT

 so in the past we ran over in 2 tables

 one being INT, so have to change the type to BIGINT

 one being BIGINT have to truncate table

 **so the ask is to identiy tables that are close to their limit on their data type on the Identity column**


sql-server-generalsql-server-transact-sql
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have any update?
Please also remember to accept the answers if they helped. Your action would be helpful to other users who encounter the same issue and read this thread.

Echo

0 Votes 0 ·
TheDBLearningGuy avatar image
0 Votes"
TheDBLearningGuy answered

Hi @VijayKumar768,

so the ask is to identiy tables that are close to their limit on their data type on the Identity column**

If you are looking for something like integer columns which are defined as identity and want to know how much percentage is being used, perhaps you should start here and check this -

https://vyaskn.tripod.com/sql_server_check_identity_columns.htm

Please let me know if I misunderstood you.


Thanks.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GuoxiongYuan-7218 avatar image
0 Votes"
GuoxiongYuan-7218 answered

You can find out the ranges of int, bigint, smallint, and tinyint.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EchoLiu-msft avatar image
0 Votes"
EchoLiu-msft answered EchoLiu-msft edited

Hi @VijayKumar768,

Sorry, I don't seem to understand your needs very well. If you want to know the length range of data types in sql server, then you can refer to the link provided by Guoxiong. If you want to know the data type of the columns in your table, then you can execute the following code:

 sp_help yourtable

If none of these suggestions solve your problem, please provide more details.
If you have any question, please feel free to let me know.


Regards
Echo


If the answer is helpful, please click "Accept Answer" and upvote it.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.