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 |
|
ComputerMike
Starting Member
18 Posts |
Posted - 2009-04-23 : 13:47:44
|
| Hi, I want to write a procedure that calls one of two select statements depending on a parameter. For example.......CREATE PROCEDURE x @Section int ASBEGINcase @Sectionwhen 1 thenSelect Date, Customer, SalesAmount from SalesWhen 2 thenSelect date, vendor, PurchaseAmount, Tax from PurchasesendENDGOIt seems it should be easy, but I don't have alot of experience with this.Thanks,Mike |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-23 : 13:53:29
|
CREATE PROCEDURE x@Section int ASBEGINIF @Section = 1Select Date, Customer, SalesAmount from Salesif @section = 2Select date, vendor, PurchaseAmount, Tax from Purchasesgo E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|