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.
| Author |
Topic |
|
liangtp@hotmail.com
Starting Member
27 Posts |
Posted - 2008-10-05 : 22:35:22
|
| Hi Guys,I have 2 statements below:SET @StartDate = (SELECT StartDate FROM tblA WHERE ID = 1)SET @EndDate = (SELECT EndDate FROM tblA WHERE ID = 1)Can I combine the two statements to become one statement such as below?SET @StartDate = StartDate, @EndDate = EndDate FROM tblA WHERE ID = 1(this one doesn't work)Thanks. |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-10-05 : 23:40:57
|
select @StartDate = StartDate, @EndDate = EndDate FROM tblA WHERE ID = 1 elsasoft.org |
 |
|
|
liangtp@hotmail.com
Starting Member
27 Posts |
Posted - 2008-10-05 : 23:56:32
|
| Thanks jezemine. It worked. |
 |
|
|
|
|
|