GO
--============================================================ TEST START
declare @ScriptFileName varchar(2000)
-- get the script file name from the cmd shell
SELECT @ScriptFileName = '$(ScriptFileName)'
SELECT @ScriptFileName + ' --- TEST START ========================================='
declare @TableName varchar(200)
select @TableName = 'WriteHereTableName'
SELECT 'SELECT name from sys.tables where name =''MetaTable'''
SELECT name from sys.tables
where name = @TableName
DECLARE @TableCount INT
SELECT @TableCount = COUNT(name ) from sys.tables
where name =@TableName
if @TableCount=1
SELECT ' TEST PASSED. The Table ' + @TableName + ' EXISTS '
ELSE
SELECT ' TEST FAILED. The Table ' + @TableName + ' DOES NOT EXIST '
SELECT @ScriptFileName + ' --- TEST END ========================================='
--============================================================ TEST END
GO
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!