为什么 Teradata Identity 列有负值? [英] Why does Teradata Identity column have negative values?

查看:41
本文介绍了为什么 Teradata Identity 列有负值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Teradata 非常陌生(1 周),我的主要技能是 SQL Server.我正在将数据从 TeraData 表之一提取到 SQL Server 表,而 TD 表有一个带有负值的标识列.我查看了该表的 DDL,它没有提到以值开头和结尾.

I am very new to Teradata (1 week) and my primary skillset is SQL Server. I am pulling data from one of the TeraData tables to SQL Server table and the TD table has an Identity column with negative values. I looked at the DDL for that table and it does not mention a start with and end with values.

那么,TeraData 中的负值是如何产生的?此外,如果我将其转移到 SQL Server,我应该创建一个新的标识列还是应该只保留从 TeraData 获得的标识值?

So, how does TeraData have the negative values in there? Also, if I pull this over to SQL Server, should I create a new Identity Column or should I just maintain the Identity values I get from TeraData?

推荐答案

如果列被定义为 GENERATED BY DEFAULT 负值可能已被直接插入.

If the column is defined as GENERATED BY DEFAULT the negative values might have been inserted directly.

如果它是 GENERATED ALWAYS 没有 NO CYCLE 并且已经达到 MAXVALUE 它将在 MINVALUE 重新开始>,默认情况下,最小值和最大值基于数据类型的可能范围.

If it's GENERATED ALWAYS without NO CYCLE and the MAXVALUE has been reached it will start again at the MINVALUE, by default min and max are based on the possible range of the datatype.

Teradata 中几乎不使用 IDENTITY 列,请根据您的需要决定是否需要保留它们.

IDENTITY columns are hardly used in Teradata, decide based on your needs if you need to keep them.

这篇关于为什么 Teradata Identity 列有负值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆