Hi All,
I want to get the values of the column in variables.
For example: select Username, Amount Into Uname, amt from Table1
Here, username is varchar(50) and amount is in decimal but doesn't give me the value of any decimal column. If I will do query for only username it give me the value but not decimal column
Can anyone help out with this?
Thanks in advance!!
Loading

Vijay YadavPosted May 14, 2013, 2:22 AM
Vijay YadavPosted Jan 23, 2013, 1:35 AM
Thanks for your reply.
Aaah! I came to know the problem, actually i was using the variable same as the Column name in the stored procedure.
Now it is working fine..:)
Jignesh TrivediPosted Jan 22, 2013, 11:14 PM
correct me! you want to store column data in to some varible in SQL server.
I have try with below code.
Create table #temp(UserName varchar(50), Amount decimal(10,6))
insert into #temp values('Jignesh', 23.63)
insert into #temp values('Tejas', 25.63)
insert into #temp values('Rakesh', 27.63)
Declare @Username varchar(50)
declare @Amount decimal(10,6)
select @Username = UserName, @Amount = Amount from #temp where UserName = 'Jignesh'
Print @Username
print @Amount
Let me know, you required more help.
hope this will help you.