I've got a huge SQL script (184,000 lines) updating various functions, sps, inserts data, updates data etc that was given to me and I want to put it inside a transaction for obvious reasons.
Here's the start to it:
SET XACT_ABORT ON
SET NOCOUNT ON;
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON
alter FUNCTION dbo.FunctionNamedRemoved
but I get:
Msg 111, Level 15, State 1, Line 21
'ALTER FUNCTION' must be the first statement in a query batch.
Msg 137, Level 15, State 2, Line 46
Must declare the variable '@uid'.
Why could I be getting this?