Toad World® Forums

DDL Creation generates code to drop Schema, which when run Fails on Toad-ss 5.5 (17-June-2011)-007 [2 Attachments]

[ Attachment(s) from Hank_Freeman included below]

When creating a DDL to test the functionality and everything was selected, the
Toad-SS application created the If exist schema for deletion which is shown
below, which did not work. See error message below.

Necessary script to create the database and the objects included.

Hank Freeman

Senior SQL Server DBA/Data & Systems Architect

hfreeman@msn.com

678-414-0090 my cell Primary

hank.freeman50 via Skype

IF (

( SELECT *

FROM sys.schemas

WHERE name = N ‘db_accessadmin’ ))

BEGIN

DROP SCHEMA [db_accessadmin]

END

GO

/**

Category Timestamp Duration Message Line Position

Error 6 / 17 / 2011 7 : 51 : 22 PM 0 : 00 : 00.000 -

SQL Server Database Error: An expression of non - boolean type

specified in a context where a condition is expected, near ‘BEGIN’ . 11 0

**/

CREATE SCHEMA [db_accessadmin]

AUTHORIZATION [db_accessadmin]

GO

Attachment(s) from Hank_Freeman

2 of 2 File(s)

Script_Create_RE_Admin_Test_Database.sql

Script_Create_Objects_in_RE_Admin_Test.sql

image001.gif

image002.jpeg

Hank,

Can you please confirm that it is purely generated script.
the script is incorrect due to missed keyword EXISTS, however next batch contains needed keyword. I guess you may have incidentally remove the keyword by mistake, so need your confirmation.

IF ( “EXISTS SHOULD BE HERE”

( SELECT *