문제

With this code:

command.CommandText = "CREATE TABLE InventoryItems (Id nvarchar(50) NOT NULL, PackSize smallint NOT NULL, Description nvarchar(255), DeptDotSubdept float, UnitCost float, UnitList float, UPCCode nvarchar(50), UPCPackSize smallint, CRVId int);"
command.ExecuteNonQuery();

command.CommandText = "CREATE INDEX idxUnitCost ON InventoryItems (UnitCost) ASC";
command.ExecuteNonQuery();

...I get, "There was an error parsing the query .... Token in error = ASC"

Is my "ASC" in the wrong location, or...???

도움이 되었습니까?

해결책

CREATE [CLUSTERED| NONCLUSTERED] INDEX idxUnitCost --<-- Type of Index [CLUSTERED OR NONCLUSTERED] 
ON InventoryItems (UnitCost ASC)         --<-- Order Inside the Parenthesis
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top