我正在将数据库从Sql Server 2008迁移到Teradata ,并且遇到了一个问题:
在Sql Server中,表列的ddl中的定义如下:
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL约束[DF_Address_rowguid]默认(NEWID())如果用户未提供,此列将使用newid()函数生成并在[rowguid]列中插入随机varchar值任何输入。
Teradata中没有类似的函数可以生成该值。
可以代替什么为Teradata创建类似的表ddls时,Sql Server的NEWID()函数的作用? Teradata中的/ UUID。 Teradata确实提供了IDENTITY列来提供自动递增列。 IDENTITY列并非没有细微差别,我鼓励您阅读第5章-创建表 .cfm?itemid = 102320036 rel = nofollow> SQL数据定义语言-详细主题,其中有一节解释了身份列。
从SQL Server迁移到Teradata的一部分,您将需要了解如何通过表的主索引在Teradata中分发数据的概念。这可能需要您检查现有的数据模型并重新设计它在Teradata中的物理实现方式。
I am migrating a database from Sql Server 2008 to Teradata and I am facing a problem:
In Sql Server in the ddl of a table column is defined as follows:
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT [DF_Address_rowguid] DEFAULT (NEWID())This column uses newid() function to generate and insert random varchar value in the column [rowguid] if the user doesnt provide any input.
There is no similar function in Teradata to generate this value.
What can be used instead of of NEWID() function of Sql Server while creating similar table ddls for Teradata?
解决方案There is no native equivalent for a GUID/UUID in Teradata. Teradata does offer an IDENTITY column to provide an auto-incrementing column. The IDENTITY column does not come without its own nuances and I would encourage you to read the Chapter 5 - Create Table in the SQL Data Definition Language - Detailed Topics which has a section explaining Identity Columns.
However, as part of your migration from SQL Server to Teradata you will need to understand the concept of how data is distributed in Teradata by means of the table's primary index. This may require that you review your existing data model and re-engineer how it is physically implemented in Teradata.
更多推荐
我正在将数据库从sql server 2008迁移到teradata
发布评论