Home How many lines are executed after IF?
Reply: 0

How many lines are executed after IF?

user529
1#
user529 Published in July 18, 2018, 10:30 pm

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

If 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.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309479 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO