Jul 23, 2007 #1 emoongq IS-IT--Management Jun 3, 2004 23 MX Hello I'm creating a view in which I need to replace values in a field named status from 'M' to 'C', is it possible, how? Tks
Hello I'm creating a view in which I need to replace values in a field named status from 'M' to 'C', is it possible, how? Tks
Jul 23, 2007 1 #2 AlexCuse Programmer Apr 13, 2006 5,416 US Instead of selecting the status column, select something like this: Code: case status when 'M' then 'C' else status end For more info, look up CASE in BOL. Hope it helps, Alex Ignorance of certain subjects is a great part of wisdom Upvote 0 Downvote
Instead of selecting the status column, select something like this: Code: case status when 'M' then 'C' else status end For more info, look up CASE in BOL. Hope it helps, Alex Ignorance of certain subjects is a great part of wisdom
Jul 23, 2007 Thread starter #3 emoongq IS-IT--Management Jun 3, 2004 23 MX I'm not able to save the view or even run it on a DTS, any idea? Tks Upvote 0 Downvote
Jul 23, 2007 #4 AlexCuse Programmer Apr 13, 2006 5,416 US Ah, seems you are using enterprise mangler. I believe I have run into this problem before (unable to use CASE to create a view). What you will need to do is create your view from query analyzer. It will be something like this: Code: create view myView as --enter your query here select * from someTable The query you type should of course use the CASE statement. For more info look up CREATE VIEW in BOL. Hope this helps, Alex Ignorance of certain subjects is a great part of wisdom Upvote 0 Downvote
Ah, seems you are using enterprise mangler. I believe I have run into this problem before (unable to use CASE to create a view). What you will need to do is create your view from query analyzer. It will be something like this: Code: create view myView as --enter your query here select * from someTable The query you type should of course use the CASE statement. For more info look up CREATE VIEW in BOL. Hope this helps, Alex Ignorance of certain subjects is a great part of wisdom