In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Post SQL Create statement

Hamder83
11 - Bolide

Hi 

i'm trying to add a primary key and set an index upon output.

My code is like this, but I get an syntax error. And I don't know how to correct it?

ALTER TABLE UNIFY_DK_POST_CH
ALTER COLUMN ID int NOT NULL;

ALTER TABLE UNIFY_DK_POST_CHUNIFY_DK_GLS_DE
ADD PRIMARY KEY (ID)

CREATE INDEX IX_ParcelNumberPurchase
ON dbo.UNIFY_DK_POST_CHUNIFY_DK_GLS_DE
(
ParcelNumberPurchase
)
GO

2 REPLIES 2
mceleavey
17 - Castor
17 - Castor

HI @Hamder83 ,

 

Can you post a screenshot of the error?

 

M.



Bulien

Hamder83
11 - Bolide

If i use this code:

ALTER TABLE UNIFY_DK_POST_CH
ALTER COLUMN ID int NOT NULL;

ALTER TABLE UNIFY_DK_POST_CH
ADD PRIMARY KEY (ID);

CREATE INDEX IX_ParcelNumberPurchase
ON dbo.UNIFY_DK_POST_CH
(
ParcelNumberPurchase
)
GO

 

 

 

I get:
Start: Designer x64: Started running C:\Users\dennis.schlein.HEARTCORP\OneDrive - Heartland AS\Desktop\UNIFY\POST CH\UNIFY POST CH FLOW.yxmd at 05/25/2021 14:43:04
Error: Output Data (51): Executing PostSQL: "CREATE INDEX IX_ParcelNumberPurchase
ON dbo.UNIFY_DK_POST_CH
(
ParcelNumberPurchase
)
GO;" : [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near ';'.
Error: Output Data (51): Error running PostSQL on "UNIFY_DK_POST_CH": [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near ';'.
End: Designer x64: Finished running UNIFY POST CH FLOW.yxmd in 2,3 seconds with 2 errors and 11 warnings

Labels
Top Solution Authors