The forum will be down for maintenance at some point between Friday, September 25, 2020 at 5pm PDT and Sunday, September 27, 2020 at 11:59 PDT. Downtime is unknown but will be minimized.

Hi Sir,

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

asked 06 Aug, 05:35

Sankar's gravatar image

Sankar
414
accept rate: 0%

edited 06 Aug, 15:09

Breck%20Carter's gravatar image

Breck Carter
30.8k496680992


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, 15:42

Breck%20Carter's gravatar image

Breck Carter
30.8k496680992
accept rate: 20%

Thank you Sir

(08 Aug, 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, 05:35

question was seen: 98 times

last updated: 08 Aug, 11:27

Related questions