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 |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2004-11-02 : 06:54:14
|
| I have an exisiting database and a field which can contain REQ, OUT or IN.I need to construct a stored procedure to select one of these but I am having problems as IN and OUT seem to be reserved words. How can I get round this ? Here's my stored procedure.@strRMUStatus comes from a radiobutton list on my webform@strRMURequestNo int,@strRMUStatus integer ASIf @strRMUStatus = 1BEGINSELECT * from vwetblFilesWHERE vwetblFiles.MovementId = @strRMURequestNoand vwetblFiles.Status =N'REQ'ENDIf @strRMUStatus = 2BEGINSELECT * from vwetblFilesWHERE vwetblFiles.MovementId = @strRMURequestNoand vwetblFiles.Status = N'OUT'ENDIf @strRMUStatus =3BEGINSELECT * from vwetblFilesWHERE vwetblFiles.MovementId = @strRMURequestNoand vwetblFiles.Status =N' IN'ENDGO |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-11-02 : 07:08:47
|
| What's wrong with it?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2004-11-02 : 07:09:10
|
| Resolved |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2004-11-02 : 07:11:11
|
Space after the quote 'IN' - how embarassing ! |
 |
|
|
|
|
|