tsql - SQL Server sync size of variable used in stored procedures or functions -


we create variables store column data, below

    declare @name varchar(300)      select  @name = name,             @age = age     [employee] 

here, give size varchar(300) in assumption length defined in table 300.

and happens across store procedures.

what if size increased in table ? (eg. 500). there easy way update size across stored procedures ? or better way of creating variables ?

i believe want oracle %type:

the oracle %type attribute adapts code table definitions change. %type attribute provides datatype of variable or database column. if column's type changes, variable uses correct type @ run time. provides data independence , reduces maintenance costs.

microsoft sql server not support , has no equivalent of oracle %type.

sql server not suppport mechanism. possible solutions:


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -