Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
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