Consider a part of a SQL script like this:
IF OBJECT_ID('dbo.tableName', 'U') IS NOT NULL
ALTER TABLE [dbo].[tableName]
DROP CONSTRAINT PK_tableName
DROP TABLE dbo.tableName
tableName exists, are all three lines executed? What about the rest of my script further down (not included - it creates the table); Is there a way to limit how many lines get executed after the
IF statement? I can't find an answer on this as it's quite an ambiguous search.