-1

How to handle U-SQL error (E_CSC_USER_DDLENTITYOFNEITHERTYPEEXISTS) if the table not exists.

How to use IF object_id('table1') Is not null in U-SQL?

T-SQL example: if object_id('table1') Is not null Select empName, empStoreNum, empSales, 'East' As SalesDistrict FROM store1 UNION ALL if object_id('table2') is not null Select empName, empStoreNum, empSales, 'East' As SalesDistrict FROM store2 UNION ALL if object_id('table3') is not null Select empName, empStoreNum, empSales, 'East' As SalesDistrict FROM store3

starh
  • 1
  • 1
  • Can you please rephrase your question so it is clear what you would like to accomplish? As is, the question is a mixture of questions and statements with no formatting and a link... – Michael Rys Jun 05 '18 at 11:21
  • Hi Michael, sorry for the confusion. I have rephrase the question above. Thanks – starh Jun 05 '18 at 15:35

1 Answers1

0

U-SQL currently offers FILE.EXISTS and PARTITION.EXISTS but not TABLE.EXISTS.

I added it to our backlog. Please file a feature request (or upvote an existing one if present) at http://aka.ms/adlfeedback.

Current workarounds would be to code gen the script based on the table name using the usql.tables catalog view and then execute the code generated script, or keep the tables existing, just have them empty if they are not "existing".

Michael Rys
  • 6,684
  • 15
  • 23