1.
----------------------------------------------------------------------------------
-----code:start
----------------------------------------------------------------------------------
EXEC
(
'if EXISTS (
select * from INFORMATION_SCHEMA.tables
WHERE table_name = ''Cabang_1''
)
SELECT ''-----Table:Cabang_1 is available '' '
)
----------------------------------------------------------------------------------
-----code:end
----------------------------------------------------------------------------------
Result Messages:
----------------------------------
-----Table:Cabang_1 is available
(1 row(s) affected)
2.
----------------------------------------------------------------------------------
-----code:start
----------------------------------------------------------------------------------
if EXISTS
(
SELECT * FROM INFORMATION_SCHEMA.tables
WHERE table_name ='Cabang_1'
)
SELECT '-----Table:Cabang_1 is available-----'
----------------------------------------------------------------------------------
-----code:end
----------------------------------------------------------------------------------
Result Messages:
-------------------------------------
-----Table:Cabang_1 is available-----
(1 row(s) affected)