I have code like this:
IF (@schema NOT IN (SELECT TABLE_SCHEMA
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_CATALOG = 'Testowa'
))
BEGIN
declare @sql nvarchar(MAX) = 'create schema ' +@schema+ ''
EXEC sp_executesql @sql
EXEC(@Sql1)
EXEC(@Sql2)
EXEC(@Sql3)
EXEC(@Sql4)
EXEC(@Sql5)
EXEC(@Sql6)
EXEC(@Sql7)
EXEC(@Sql8)
END
ELSE
It makes everything in one moment, I want to make some breaks after @sql and after @sql6 I tried with 'GO', but 'GO' stops IF. 'Breaks' = First do @sql After that Make @sql1-6 After that @Sql7-8. How should I make it?