简体   繁体   English

创建从Oracle到SQL Server的等效索引

[英]Create Index equivalent from Oracle to SQL Server

I have a current index that I have pulled from Oracle and I am trying to add to SQL Server. 我有一个当前的索引,该索引是我从Oracle中提取的,正尝试添加到SQL Server中。 As far as I can tell, I will have to remove the double quotes and use WITH(... However, I cannot find the Maxtrans and other keywords equivalent in SQL Server, especially the M_ROW$$ , which I was thinking it would be the ROW_NUMBER . 据我所知,我将必须删除双引号并使用WITH(...但是,我找不到SQL Server中等效的Maxtrans和其他关键字,尤其是M_ROW$$ ,我以为是ROW_NUMBER

CREATE UNIQUE INDEX ""MYDB"".""I_SNAP$MYTABLE"" ON 
""MYDB"".""MYTABLE"" (""M_ROW$$"")          
PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING COMPUTE STATISTICS             
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645           
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)            
TABLESPACE ""IL_MIS_INDX""          

Any help will be greatly appreciated. 任何帮助将不胜感激。

Thank you! 谢谢!

I'm guessing you don't need all the options. 我猜您不需要所有选择。 So, just use the default syntax: 因此,只需使用默认语法:

CREATE UNIQUE INDEX <MYDB.I_SNAP$MYTABLE> ON MYDB.MYTABLE (<M_ROW$$>)     

Of course, the table name and column name needs to be the actual names in SQL Server. 当然,表名和列名必须是SQL Server中的实际名称。

I am speculating that you don't need the index options in SQL Server. 我推测您在SQL Server中不需要索引选项。 If you do, you will need to optimize the index for that database, rather than assuming that what works in Oracle will automatically work in SQL Server. 如果这样做,则需要优化该数据库的索引,而不是假设在Oracle中有效的将在SQL Server中自动起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM