473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How can change retrieved data in storedProcedure

1
Hello,

I have a small problem,

I have table:

data
-------
id | er|
----------
1 | 4|
2| 5|

I would like to retrevied this data, which is simply easy
select * from data,

but at the same time i would lket to change er values to strings : 4= OK, 5=BAD , that the query would return :

data
-------
id | er|
----------
1 | OK|
2| BAD|

but database would stay unchanged...

any ideas? is it possible at all?
Oct 9 '07 #1
3 1148
debasisdas
8,127 Expert 4TB
Question moved to SQL Server forum
Oct 9 '07 #2
debasisdas
8,127 Expert 4TB
use CASE statment for the purpose.
Oct 9 '07 #3
iburyak
1,017 Expert 512MB
Try this:


select id,
case when er = 4 then 'OK'
when er = 5 then 'BAD'
else ''
End ER
from data
Oct 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Adam Getchell | last post by:
Hello all, I'm writing a Parameter class (following Fowler's "Introduce Parameter Object") that accepts a stored procedure and key-value pairs to be passed to a data access class that will parse...
9
by: Mike L | last post by:
I tried a sample of code in MSDN magazine, but now I'm stuck. What code has the best performance to populate a Data Grid with a SP? Below is the code I have, which might be completing the wrong...
2
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row...
3
by: Rashapoo | last post by:
I have just completed a basic course in Access. I have some relational b/g in DB2 and Cobol. I have a question my instructor couldn't answer (or maybe I didn't explain myself) I design a...
2
by: Hrvoje Voda | last post by:
I'm using this store procedure to return data from sql server. SqlDataReader sqlRead = null; System.Data.SqlClient.SqlCommand ProfileBLOBSelect = new System.Data.SqlClient.SqlCommand(); ...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
5
nmm32
by: nmm32 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. I have another procedure which adds another row to the...
0
by: cms3023 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. The table inside the database has data that matches with...
2
by: ashish1985s | last post by:
using System.IO; using System.Data; using System.Collections; using System.Configuration; using System.Xml; using System.Data.SqlClient; using System; using log4net; using log4net.Config;
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.