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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to retrieve value from table

Author  Topic 

spshindagi
Starting Member

11 Posts

Posted - 2008-01-10 : 07:31:21
Hi every one,

here is my table: MVPTABLE
columnName: Accsno JanMail JanVisit JanPhone JanComments FebMail..upto DecMail DecVisit DecPhone DecComments.

eg: table with values:
Accsno JanMail JanVisit JanPhone JanComments FebMAil FebVisit
A234 1 2 3 yes jim 0 2
A234 0 2 0 No Comments 1 2
As34 0 0 0 No Comments 1 2
A235 1 2 3 yes jim 0 2
A235 0 2 0 No Comments 1 2
As35 0 0 0 No Comments 1 2

am sending 2 parameter as
1> @param1= A234
2> @param2= 'JanMail,JanVisit,JanPhone,FebMail,FebVisit,FebPhone,MarMail,MarVisit,MarPhone,AprMail,AprVisit,AprPhone,MayMail,MayVisit,MayPhone,JunMail,JunVisit,JunPhone,JulyMail,JulyVisit,JulyPhone,AugMail,AugVisit,AugPhone,SepMail,SepVisit,SepPhone,OctMail,OctVisit,OctPhone,NovMail,NovVisit,NovPhone,DecMail,DecVisit,DecPhone

based on these 2 parameter i wanted to retrieve respective Comments
say, if @param1 Ac234
@param2= JanMail,JanVisit,JanPhone,MarMail
if the value of JanMail or FebMAil....DecMail = 1,then retieve respective comments
if the value of JanVisit,FebVisit..........DecVisit=2,then retrieve respective comments
if the value of JanPhone,or FebPhone,.....DecPhone=3 then retive respective comments

thanks in advance

love all

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-01-10 : 09:52:26
Seems like a really bad db design. What does @param2 specify?
Go to Top of Page

spshindagi
Starting Member

11 Posts

Posted - 2008-01-14 : 01:56:29
quote:
Originally posted by visakh16

Seems like a really bad db design. What does @param2 specify?

.

in the front end, i allow user to make enteries as following

months mail visit phone comments
-----------------------------------------
january chkbox chkbox chkbox textbox
febuary chkbox chkbox chkbox textbox
march chkbox chkbox chkbox textbox
april chkbox chkbox chkbox textbox
may chkbox chkbox chkbox textbox
jun chkbox chkbox chkbox textbox
july chkbox chkbox chkbox textbox
August chkbox chkbox chkbox textbox
September chkbox chkbox chkbox textbox
october chkbox chkbox chkbox textbox
november chkbox chkbox chkbox textbox
december chkbox chkbox chkbox textbox

in which all 48 enteries are to be made,
if mail checkbox is selected am storing 1 if not selected am storing 0,
if visit is checked am inserting 2 else 0
if phone is checked am inserting 3 else o
if coments is enter,am inserting text, else no comments.
as all 48 enteries has to done, am inserting 48 values. then how do u say bad designing of table[justify]


love all
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2008-01-14 : 13:40:10
Look here for "Bad design" justification : http://en.wikipedia.org/wiki/First_normal_form

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -