Hello I would like to know is is possible to drop all tables in database what was created under custom schema for example DBO1...with one sql query or special script.
T
Also building on @Kevo's answer, I added the following while loop for an issue I was having with TSQL Print statement. A message string can be up to 8,000 characters long. If greater than 8,000 the print statement will truncate any remaining characters.
DECLARE @SqlLength int
, @SqlPosition int = 1
, @printMaxLength int = 8000
SET @SqlLength = LEN(@Sql)
WHILE (@SqlLength) > @printMaxLength
BEGIN
PRINT SUBSTRING(@Sql, @SqlPosition, @printMaxLength)
SET @SqlLength = @SqlLength - @printMaxLength
SET @SqlPosition = @SqlPosition + @printMaxLength
END
IF (@SqlLength) < @printMaxLength AND (@SqlLength) > 0
BEGIN
PRINT SUBSTRING(@Sql, @SqlPosition, @printMaxLength)
END