Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 getting values for one variable from table

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-06-25 : 06:46:33
how can i get the set of values from one table based on condition

into one variable in sqlserver 2008 tables

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-06-25 : 06:55:55
Can you give more detailed information ?
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-06-25 : 08:48:38
Do you need this?

Declare @var varchar(10)

Select @var =column_name from table_name where primary_key_col=value

Select @var

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-06-25 : 09:32:23

MY TABLE STRUCTURE IS:

ID CALENDARNAME LOC MON TUE WED THU FRI SAT SUN

1 AAA BLR FD FD FD FD FD WE WE
2 BBB CHN FD FD WE WE FD FD FD

FOR THIS TABLE
I WANT TO WRITE STORED PROCEDURE FOR INSERT

WHERE CALENDARNAME IS DROPWDOWN LIST COMING FROM MASTER TABLE
AND THEN MON,TUE,WED,THU,FRI,SAT,SUN COLUMN VALUES ALSO COMING FROM DROPDOWNLIST FROM SOME TABLE


HOW TO WRITE SP TO INSERT FOR THIS TABLE ?


Go to Top of Page
   

- Advertisement -