We do create variables to store column data, like below
DECLARE @Name VARCHAR(300)
SELECT @Name = Name,
@Age = Age
FROM [Employee]
Here, we give size as VARCHAR(300)
in a assumption that length defined in table is 300
.
And this happens across store procedures.
What if the size is increased in table ? (eg. 500). Is there a easy way to update the size across stored procedures ? or any better way of creating variables ?