sql declare variable single line

Solutions on MaxInterview for sql declare variable single line by the best coders in the world

showing results for - "sql declare variable single line"
Faustine
01 Jan 2018
1-- Old clunky way of doing things prior to SQL Server 2008
2DECLARE @myVar VARCHAR(100);
3SET @myVar = 'Some Value';
4
5-- New, amazing way of declaring variables
6DECLARE @myVar VARCHAR(100) = 'Some Value';