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
 HTML to SQL

Author  Topic 

clinton_eg
Yak Posting Veteran

60 Posts

Posted - 2010-02-21 : 08:16:02
Hi,
I have a HTML web page which has a set of 10 Audit Questions. Lets say Question 1 to Queston 10. and 3 marking options as Yes, No, and N/A, where Yes = 4, No = -4, and N/A = 0 (for each quetion).
I also have an SQL Table "Audit Scores".
Please could you let me know what is the Query i could use to get the data enterred into the HTML page to insert into the mentioned SQL table.

Appreciate your help.

Ewan Gilby

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-21 : 08:44:59
whats your table name? what all fields does it have currently?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

clinton_eg
Yak Posting Veteran

60 Posts

Posted - 2010-02-21 : 09:53:29
My SQL table name is "Audit Scores"
Columns:
Employee ID int,
Q1_Score int,...., Q10_score int,
Total_Score int,
Audit_Percentage float

quote:
Originally posted by visakh16

whats your table name? what all fields does it have currently?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





Ewan Gilby
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-21 : 10:21:44
is the page showing all the questions in a grid?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

clinton_eg
Yak Posting Veteran

60 Posts

Posted - 2010-02-21 : 10:58:57
Hi visakh16,

Yes i have the Questions in a html file using a table.

quote:
Originally posted by visakh16

is the page showing all the questions in a grid?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





Ewan Gilby
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-21 : 11:01:39
why have you designed table in this way? wouldnt it be better to store them rowwise? so that in future if you've more questions you dont need to add new column each time?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

clinton_eg
Yak Posting Veteran

60 Posts

Posted - 2010-02-21 : 11:29:54
im sorry but im not sure i understood

quote:
Originally posted by visakh16

why have you designed table in this way? wouldnt it be better to store them rowwise? so that in future if you've more questions you dont need to add new column each time?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





Ewan Gilby
Go to Top of Page

clinton_eg
Yak Posting Veteran

60 Posts

Posted - 2010-02-26 : 05:59:04
How do i go about storing data row wise, any examples or links where i could refer?

quote:
Originally posted by clinton_eg

im sorry but im not sure i understood

quote:
Originally posted by visakh16

why have you designed table in this way? wouldnt it be better to store them rowwise? so that in future if you've more questions you dont need to add new column each time?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





Ewan Gilby



Ewan Gilby
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-26 : 08:07:24
you will have questionno field in your table as well as marking option. then store them in rows like

Question No marking option
Question 1 Yes
Question 2

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-26 : 08:07:25
you will have questionno field in your table as well as marking option. then store them in rows like

Question No marking option
Question 1 Yes
Question 2 No

...

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

clinton_eg
Yak Posting Veteran

60 Posts

Posted - 2010-03-12 : 06:18:10
Can i do this using the CREATE TABLE syntax?

or are you refering to the HTML table format. If that is the case, then yes in the HTML table i have the Questions is a Row, not column.
and Marking options as another column respectively.

Question ' # ' Ans ' Mark
Question1 ' 1 ' Yes ' 4
Question2 ' 2 ' No ' -4
etc...

so based on the selection of Yes, No or N/A the mark is applied and on hitting a button which says Submit i want the data to create a record in the SQL table.

This is where im confused and dont know how to proceed (to create a record in an SQL Table).

quote:
Originally posted by visakh16

you will have questionno field in your table as well as marking option. then store them in rows like

Question No marking option
Question 1 Yes
Question 2 No

...

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





Ewan Gilby
Go to Top of Page
   

- Advertisement -