Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hi Sir,

I want to delete the folder, IF its already exists in Sybase sql anywhere 10 version.

asked 06 Aug '20, 05:35

Sankar's gravatar image

Sankar
906611
accept rate: 0%

edited 06 Aug '20, 15:09

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050


BEGIN
DECLARE @folder    LONG VARCHAR;
DECLARE @sql       LONG VARCHAR;
SET @folder = '"C:\\temp1"';
SET @sql = STRING ( 'xp_cmdshell ( '' IF EXIST ', @folder, ' RD /S /Q ', @folder, ''' )' );
EXECUTE IMMEDIATE @sql;
END;
permanent link

answered 06 Aug '20, 15:42

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

Thank you Sir

(08 Aug '20, 11:27) Sankar
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1

question asked: 06 Aug '20, 05:35

question was seen: 706 times

last updated: 08 Aug '20, 11:27

Related questions