Alteryx Designer Desktop Discussions

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

Delete All Rows except headers from SQL table using Alteryx

Puneet13
8 - Asteroid

Hi Everyone

 

Can anybody help me to provide SQL query which deletes all records except headers from SQL Table,

 

Thanks

5 REPLIES 5
SGolnik
11 - Bolide
11 - Bolide

What type of database do you need SQL for? i.e. MS SQL Server, Oracle, etc.

Puneet13
8 - Asteroid

MS SQL server

SGolnik
11 - Bolide
11 - Bolide

To delete all of the data, but keep the table use this code changing target_table to your table name: DELETE FROM target_table;

Puneet13
8 - Asteroid

I Have tried but it giving the attached error.

SGolnik
11 - Bolide
11 - Bolide

Normally when I receive that error, there is a spacing issue in the SQL related to copy/pasting. Try deleting all of the spaces and adding them back. 

Labels