I am assigning a value to a variable and it should be bound to a specific column.
Whether I need.
1. Assign the value and bind it to a column or Whether this one will work
2. Bind to a column and afterwards assign it to a column. Whether this one will work
Lets make a try,
Now, am declaring a variable and binding it to a column and afterwards am trying to set the variable. OOPs, the value is not reflecting.
declare @a varchar(10)
select @a "ColumnName"
set @a='venkat'
print @a
Let's try for an alternative, assign the value and bound it to the column.
declare @a varchar(10)
set @a='venkat'
select @a "ColumnName"
print @a
Yes, its working. As a basic foundation thoughts, the variables should be assigned with a value and afterwards we need to bound it to a columnname.
Happy Learning!!!
Regards,
Venkatesan Prabu .J
No comments:
Post a Comment