Calculating Survey Scores

Oct 16, 2007

I have surveys that I need to add weights to and was wondering if there was a way to convert the contents of a column.

select empid, ans_for_ql,
(if ans_for_ql = A then 0, B then 3, C then 5) as weightscore,
ans_for_q2,
(if ans_for_q2 = A then 8, B then 4, C then 2, D then 1, E then 0) as weightscore

Here is what the table looks like:

empid | Ans_for_Q1 | Ans_for_Q2
1001 A C
1002 B E

And these are the possible answers and what they need to be converted to:

Weights for answers to Question1
Q1_A = 0
Q1_B = 3
Q1_C = 5

Weights for answers to Question2
Q2_A = 8
Q2_B = 4
Q2_C = 2
Q2_D = 1
Q2_E = 0

View 3 Replies


ADVERTISEMENT

Fuzzy Lookup Transform Row Scores 'inconsistent' With Individual Column Scores

Sep 1, 2006

I am trying to interpret some of the results I observe when trying to match similar records using a fuzzy lookup transform, but it's not entirely clear how the overall row similarity score is calculated. In particular, sometimes rows with lower individual column similarity scores will achieve a higher similarity and confidence score than a matching row with higher individual column scores.

The transform is configured with 6 text fields set to fuzzy mapping and a minimum similarity of 0, and 3 additional numeric fields with an exact mapping. It is set to return a maximum of 2 matches per lookup and to do an exhaustive search of the reference table.

For example, from the following matching pair of records Match 1 is picked over Match 2 even though it's individual scores are lower.

Match 1 Match 2
----------------- -----------------
_similarity_author 1.0 1.0
_similarity_title 0.85344648 1.0
_similarity_headline 0.0125 0.0125
_similarity_summary 0.0125 0.0125
_similarity_picture 1.0 1.0
_similarity_caption 1.0 1.0

_similarity 7.8429267E-2 7.3196657E-2
_confidence 0.55728668 0.44271332

In another case both matching records have *identical* scores for every mapped column and yet their similarity and confidence scores are different.

Clearly there are other factors involved in calculating the overall row score. Anybody know what these are?


Fernando Tubio

View 2 Replies View Related

SQL Server ETL Survey: Take The Survey For A Chance To Win A 80GB Zune!

Nov 27, 2007

SQL Server Integration Services team would like to hear from you. Our goal is to understand your current Data Extract, Transform & Load (ETL) practices and prioritize features for future releases.

You will have a chance to win one of five 80GB Zunes. To win a Zune, you must fill out the survey by Dec. 20, 2007.

To participate in the survey, please click here: https://mscuillume.smdisp.net/Collector/Survey.ashx?Name=SqlETLSurvey2


Thank you,
SSIS Team

View 2 Replies View Related

Top 10 Scores - Row Query

Jul 12, 2004

I have a database that holds student details in one table and their scores in particular subjects in another. The tables are linked through ID. The subjects table looks like this. (example)

ID Sub1 Sub2 Sub3 Sub4 etc
1 2 4 2 6
2 5 5 1 3
3 7 4 2 5
etc

What I need to do is return a students details followed by their top 10 subjects in ascending order.
Student 1's results would look like this...

Student 1
details

Sub1 2
Sub3 2
Sub2 4
Sub4 6

This is driving me insane. Please help.

View 1 Replies View Related

Cluster Discrimination Scores

Aug 4, 2006



Dear all here:

I have a question about the cluster mining result.

In the discrimination tab shows the different between group 1 and group 2.

I just wonder how to calculate the discremination scores.

Do any expertise can answer the question?



Regards!



Jerry

View 1 Replies View Related

SQL 2012 :: Get Percentage Over Sum Of All Scores Over Last 90 Days

Sep 30, 2014

I am trying to build a query where I want to extract the sum of the scores for each code MCC and get the percentage over the sum of all the scores over the last 90 days

select MCC, sum(score) as total from scores
(select Datediff(day, creationdate, getdate()) as Q from scores
where Datediff(day, creationdate, getdate()) <90)
group by MCC

TABLE
ID creationdate score MCC
1 2014-08-02 30 7422
. . . .
. . . .
. . . .

View 4 Replies View Related

Find 90th Percentile Scores For Each Student

Sep 15, 2006

I am stumped on a set-based approach for this one.

A cursor approach is straightforward enough, but i want to avoid that.

Here's my table:

create table StudentScores
(
id int primary key identity(1,1),
student_id int not null,
score int not null
)

with some sample data:

insert into StudentScores (student_id, score)
select 1, 10 union all
select 1, 29 union all
select 1, 50 union all
select 1, 53 union all
select 1, 45 union all
select 1, 10 union all
select 1, 29 union all
select 1, 50 union all
select 1, 53 union all
select 1, 45 union all
select 1, 88 union all
select 2, 23 union all
select 2, 54 union all
select 2, 55 union all
select 2, 34 union all
select 2, 56 union all
select 2, 78 union all
select 2, 23 union all
select 2, 54 union all
select 2, 55 union all
select 2, 34 union all
select 2, 56 union all
select 2, 78 union all
select 2, 23 union all
select 2, 54 union all
select 2, 55 union all
select 2, 34 union all
select 2, 56 union all
select 2, 78 union all
select 2, 98


What I want is, for each student, what is their 90th percentile score?

For a given single student, one possibility would be:

declare @studentid int
set @studentid = 2
select top 1 @studentid as student_id, a.score as [90th percentile score]
from
(
select top 90 percent score from StudentScores
where student_id = @studentid order by score asc
) as a
order by a.score desc

But I want this for all students, and not use a cursor.

Any ideas?

Thanks!

View 6 Replies View Related

Select Last 20 Records By Date Then Sum Lowest 10 Scores???

Jan 21, 2004

I have a table and am usuing ASP to query the database, the connection is to a MS Access table at the moment but am working to convert to SQL Server.

Question:

I need to select the last 20 records, by a date field, then from those 20 records select the 10 lowest scores.

Example is a member logs on an that member has say 80 total records in the table. Then I need to select the last 20 records entered by the date field then select the lowest 10 scores out of those 20.

I am new to more compex SQL Statements any help would be mostly appreciated!

table = HC_ID
date field = date
member_id = member
score = ScoreHC

View 14 Replies View Related

Survey DB Schema

Dec 12, 2004

I am trying to modify a survey DB schema created by OOP(Object Oriented Programming) snobs who had their heads so far up their butts(in my opinion).
This is current schema created by them.

Diagram 1 (OOP snobs version)
http://us.f3.yahoofs.com/users/41a4fde6zcff655d9/a2ae/__sr_/2761.jpg?phsEJvBB3t1v7URD

Actually there aren't a several foreign keys as they are shown in the picture, but that's what they(OOP snobs) are doing to the table "Response". They are inserting question_collection_id and its name as well as question_id and its name to Response table. However, it was not ill-intended, "We just wanted to load the report quickly"(OOP snobs).
But I really recommend this schema, Because of its simplicity.

Diagram 2 (My version)
http://us.f3.yahoofs.com/users/41a4fde6zcff655d9/a2ae/__sr_/e890.jpg?phrEJvBBF0.lGY5Y

Yet I haven't proven that my schema will provide report just as quickly as OOP snobs' version. As mentioned earlier, since they don't have foreign key constraints accordingly, I do find quite number of discrepancy on values of "question" columns between "Question" and "Response" tables and "question_collection" columns between "question_collection" and "Response" table. I can provide schedule task to eliminate those problems. But I really prefer my schema than theirs. So far, I can explain mine is better just because of its simplicity and DBA's gut instinct. I'd like to hear Superior Expert's opinion which schema is better and why one is better than the other.

Attached is also zip files of schema images if you can't see them by those URL.

View 4 Replies View Related

Would You Like To Participate In The BI Survey?

Jun 16, 2007

The BI Survey is the largest independent survey of BI technology users worldwide. (It used to be known as the OLAP survey, but has expanded to cover a broader array of BI technologies.) The survey analyzes people's buying decisions, BI implementation cycles and business results achieved.



The BI Survey is strictly independent --- they ask vendors like us to ask our customers like you to participate, but we don't have any other involvement --- except closely reading the results, of course. The Survey will send all participants a summary of the full survey results and place them in a drawing for ten $50 Amazon vouchers.



You can complete the survey on-line by following these links:


English version - website: http://www.eu-survey.com/webprod/cgi-bin/askiaext.dll?Action=StartSurvey&T1=BI&lan=1&lin=20

German version: http://www.eu-survey.com/webprod/cgi-bin/askiaext.dll?Action=StartSurvey&T1=BI&lan=2&lin=67



Let your voice be heard!

View 2 Replies View Related

SQL Server DBA Salary Survey

Aug 29, 2006

I am going into salary negotiationyearly review next month after my week off and I am trying to determine what to ask for. I am thinking another 10K and an extra week off would not be unreasonable, but I wanted to get some idea of what you guys think I should ask for in terms of pay.I have been developing software for seven years and I have been a dba for a little over five. I live in pricey northern Virginia. On a fairly regular basis I do about 55 to 60 hour weeks. On my DBA team, I am the only one who can handle both development and production tasks. The others are strictly developers. Although I have been relieved of most of my customer support tasks by our newbie, the customer support manager still brings the nastier bits to me. It is my perception that the more complex tasks get assigned to me. I get told on a regular basis that I am the best dba this place has ever had and other embarrassing accolades are regularly thrown my way. After a year, other than my boss I am the dba that has been here the longest in high turnover high burnout company. This year as we try to move to a SAP model, it looks like we will be going to 24/7 support on a disaster recovery model I am designing and implementing, so I guess I am getting the pager.So how much money should I be asking for?you can PM me with a number if you want.

View 1 Replies View Related

Survey Statistic Query

Feb 5, 2007

Is there a possibility to express the text column with SELECT SQL command, to get AS column which will represent all values in the field?

I mean - to convert:


IDresult__IDquestion_answers
....
24______72_________178,180,191
25______77_________221,224
26______79_________291,298,301,302
27______84_________522,523,525
....


into:


IDresult__IDquestion_numberedanswers
....
24______72_________178
24______72_________180
24______72_________191
25______77_________221
25______77_________224
26______79_________291
26______79_________298
26______79_________301
26______79_________302
27______84_________522
27______84_________523
27______84_________525
....


Can SQL do that?

View 14 Replies View Related

Group Data For Survey

Feb 5, 2008

hi,

i'm having following data:


create table survey
(
clientID int not null,
questionID int not null,
Answer int not null
)

insert into survey (clientID, questionID, Answer) values (1, 1, 1)
insert into survey (clientID, questionID, Answer) values (1, 1, 2)
insert into survey (clientID, questionID, Answer) values (1, 1, 4)
insert into survey (clientID, questionID, Answer) values (1, 1, 5)
insert into survey (clientID, questionID, Answer) values (2, 1, 1)
insert into survey (clientID, questionID, Answer) values (2, 1, 5)
insert into survey (clientID, questionID, Answer) values (2, 1, 8)
insert into survey (clientID, questionID, Answer) values (3, 1, 2)
insert into survey (clientID, questionID, Answer) values (3, 1, 4)
insert into survey (clientID, questionID, Answer) values (3, 1, 6)
insert into survey (clientID, questionID, Answer) values (3, 1, 9)
insert into survey (clientID, questionID, Answer) values (4, 1, 8)
insert into survey (clientID, questionID, Answer) values (5, 1, 1)
insert into survey (clientID, questionID, Answer) values (5, 1, 5)
insert into survey (clientID, questionID, Answer) values (5, 1, 9)


and i want to get it out like this:

ClientIDQ1_1Q1_2Q1_3Q1_4
----------------------------------------
1|1|2|4|5|
2|1|5|8|0|
3|2|4|6|9|
4|8|0|0|0|
5|1|5|9|0|

but i get the following output:

clientID Q1_1 Q1_2 Q1_3 Q1_4
----------- ----------- ----------- ----------- -----------
1 12 12 12 12
2 14 14 14 14
3 21 21 21 21
4 8 8 8 8
5 15 15 15 15

(5 row(s) affected)

with this code:



SELECT

distinct(clientID)
,Q1_1
,Q1_2
,Q1_3
,Q1_4


from
(select
distinct(clientID)
,sum(case when QuestionID = 1 and Answer in (1,2,3,4,5,6,7,8,9,10) then Answer else 0 end) as Q1_1
,sum(case when QuestionID = 1 and Answer in (1,2,3,4,5,6,7,8,9,10) then Answer else 0 end) as Q1_2
,sum(case when QuestionID = 1 and Answer in (1,2,3,4,5,6,7,8,9,10) then Answer else 0 end) as Q1_3
,sum(case when QuestionID = 1 and Answer in (1,2,3,4,5,6,7,8,9,10) then Answer else 0 end) as Q1_4


from
dbo.survey

group by clientid) as x

group by
x.clientID
,x.Q1_1
,x.Q1_2
,x.Q1_3
,x.Q1_4


order by clientID asc


what am i doing wrong? Thank you

View 9 Replies View Related

Database Administration Survey

Jul 23, 2005

Hi,We are a systems research group at the Computer Science departmentatRutgers University, and are conducting a survey to understand detailsabout network, systems and database administration. We hope that thisinformation would help us recreate a realistic environment to helpresearch in 'systems management'.We request network, systems, and database administrators to take thissurvey. As an incentive, all surveys completed in their entirety willbeentered into a drawing of a number of $50 gift certificates (fromAmazon.com).We hope you have a few minutes to take the survey which is located at:http://vivo.cs.rutgers.edu/administration_survey.htmlResearch in our group:The goal of our research is to improve the overall availability andmaintainability of services. Since administrators form an integral partof these services, a key aspect of this work is to build environmentsand tools that ease the task of service administration. In particular,environments which would help administrators know how their actionsmight impact the real service (before performing them for real), webelieve would be useful in preventing inadvertent actions. This surveytries to understand the existing environments, what administrators docurrently to test the 'validity' of their actions, and the difficultiesthey face in doing so. The two specific systems we are looking at arenetworks and databases, as we believe these are important components ofmany services.If you have any questions regarding this survey or our work, feel freeto email us:Fabio Oliveira (fabiool at cs || rutgers || edu), orKiran Nagaraja (knagaraj at cs || rutgers || edu)Thanks for your time,Fabio OliveiraPhD student, Vivo Research Group (http://vivo.cs.rutgers.edu)Rutgers University

View 4 Replies View Related

International Motivation Survey

Jul 23, 2005

Dear Madam/Sir,You are invited to participate in an international research study. Thisresearch project is headed and led by Cambridge student Nico Baumgarten.What is it all about?It is a well-known fact that there exist many differences between cultures.However, how these differences effect motivation if there are effects atall is not yet clear. This survey is set out to change this. With yourhelp, it will be possible to achieve this.Therefore, we kindly ask you to spare only 10 minutes of your time andvisit the survey home page.Go to the survey http://crosscultural.research.yi.orgor if this does not work the direct link http://82.4.146.32Who participates?All over the world, people are chosen to participate in the survey.Although the survey is completely anonymous, each person is arepresentative of his/her country. Hence, it does not matter, which job aperson has, whether he/she is male or female, old or young. The more peoplechoose to participate the more accurate this survey is going to representand show cultural influences as well as similarities.So if you want to tell your friends about this survey - Please Do So! Justforward this email to your friends or use the feature on the survey homepage.What is in it for you?With your help your country will be represented in the survey.Of course, you can opt-in to receive the results of the study at the end ofthe survey.Any information you provide will be kept strictly confidential andanonymous.Thanking you in advance for you support I remain withKind regardsNico Baumgartenhttp://crosscultural.research.yi.orghttp://82.4.146.32

View 1 Replies View Related

Web Survey Database Design

Aug 26, 2005

I am a developer and I have a problem trying to design a system tomanage data coming from web surveys. Each section can potentially havedozens of questions, i.e., fields.I am focusing here only on the table(s) that will hold the survey data.I do not have any DDL as I am still trying to understand this!All the examples I have found so far in books and on the web seem todeal with fairly limited data, that is easily, or so it looks, brokendown in multiple tables.It seems that, from my research, having a wide table per survey sectionwith each field as a column, which has been suggested to me, is notproper design for many reasons - missing values for non-requiredquestions, table with 100s of possible columns, etc... - so I playedwith the idea of a single table where one of the columns would be theforeign key pointing to a questions table and another column would holdthe data (this is a simplified explanation.)The problem with this is that now this column will have to accomodateall types of data, from bits to large varchars, and that fieldvalidation seems now impossible jeopardizing data integrity.What do knowledgeable designers come up with in this case? Can someonepoint me in the right direction?Jerry

View 2 Replies View Related

DB Design Question - Survey System

Jul 23, 2005

I've written several survey systems in which the majority of the questionshave the same or similar responses (Yes/No, True/False, scale of 1 - 5,etc).But this latest survey system I'm working on has 8-10 sections, with avariety of question attributes and answer scales. Some items have just adescription and require a Yes/No answer, others have a description and anactive status and require a Yes/No and price answer, some require a comment,etc.Rather than build a separate response table for each survey section, I wasthinking of building one generic response table, and trying to force allsections to fit by adding columns - some of which won't apply to some items.Like this:Survey Category (will apply to all items)Survey Section (will apply to all items)Item Description (will apply to all items)Item YN (will apply to all items)Item Price (will apply to about 10% of the items)Item Points (will apply to about 10% of the items)Item Active YN (will apply to about 10% of the items)Item Fail YN (will apply to about 10% of the items)Item Comment (will apply to about 10% of the items)For instance, in the structure above the field "Item YN" would representmultiple types of answers: is the item in use?, is the item in place?, isthe item given away for free?, is the item on display?, etc. Basically,anywhere a Yes/No answer is used.The advantage is one source table (rather than 8) for storing answers, andit might be easier to query and report on.The disadvantages I see are 1) it's more difficult to understand the meaningof the responses when the answer field is named Item YN, and 2) you have anon-normalized table that's difficult for a 3rd party to understand.If I have the questions and responses in separate tables, I'll use nameslike "ItemComplimentaryYN" and "ItemUsedYN" depending on the question. It'seasier for others to learn the data.I actually don't like the "generic" approach, and probably won't use it, butI figured I'd try to get some input from others who've written surveysystems.Thanks

View 5 Replies View Related

Relational Database Usage Survey

Oct 15, 2005

Dear friendsI am conducting a survey on Relational Database usage and would likeyour help. The study is part of my MBA Dissertation.Could you kindly spare 5 minutes to take part in this survey?http://FreeOnlineSurveys.com/rendersurvey.asp?id=120816ThanksRajeev

View 11 Replies View Related

Using Nvarchar(max) For All Data Types In A Survey System

Apr 23, 2008

I am working on a survey system with another DB Engineer.Our current design includes 1 table per Question Type (Numeric, Boolean, Text), Response values are tightly coupled based on data being entered, to keep things simple assume there are only 6 tables in this this system (1 for each Question Type to define the "rules" of the data entered, and 1 for each Response collection).He is a former .Net programmer and has been talking with the .Net guys on the project and he is proposing that we abstract our Question Types to use one table and store the Input Values all as nvarchar(max).This obviously simplifies the DB design and reduces the amount of work I will need to do so I should be all for it. I guess I am a little concerned that we are no longer tightly coupling the data types and essentially leaving all the validation up to the application. Also should I be worried that a bunch of bit data will be stored as 1/0 in an nvarchar(max) column?Thanks,-John

View 13 Replies View Related

Design Responses Table In Survey Database

Mar 23, 2015

I have questions table and answers in survey database. Now I design responses table from users !

CREATE TABLE [dbo].[Response](
[ResponseId] [int] IDENTITY(1,1) NOT NULL,
[SurveyId] [int] NULL,
[QuestionId] [int] NULL,
[AnswerId] [int] NULL,
[VoterId] [int] NULL,

[Code] ...

My Questions : How can I store data if questions is multiply answers (checkbox type) ?What is best way ?

View 16 Replies View Related

Survey: Enterprise Architecture And Software Development

Aug 5, 2006

Several prominent researchers are conducting a survey and looking for500 respondents by Friday on the topic of enterprise architecture andsoftware development. Here is the link to the survey:http://www.surveymonkey.com/s.asp?u=845572436515After completing the survey, results are displayed immediately. A smalldonation will be made to a charitable organization after itscompletion.http://duckdown.blogspot.com/

View 3 Replies View Related

Design Question For Survey/questionnaire Type Application

Dec 20, 2007

I am a developer and I have a problem trying to design a system to
manage data coming from web surveys. On average each subject will take
part in more than one survey and each survey may potentially have 100+
questions.

I am focusing here only on the table(s) that will hold the survey
data.

I'm thinking about having a wide table storing each question in the
survey(s) as a column against the subjects. My main concerns with this
approach:

- the "yuckiness" and potentially other performance issues(?)
associated with a table with 100s of columns
- the 8kb size limit per row (unlikely to touch it, but possible)
- 1024 column limit (unlikely to touch it, but possible)

Another approach obviously is to have a single table where we have, in
a simplified version, 3 columns: person_id, question_id and data/
answer. The problem with this is that the "data" column will have to
accommodate
all types of data, from bits to varchars, and that field validation
seems now impossible jeopardizing data integrity, and most
importantly, you can't easily work with the data in filtering/
reporting etc.

What do knowledgeable designers come up with in this case? Can someone
point me in the right direction?

View 2 Replies View Related

Analysis :: Conditional Sum Based On Latest Survey Answer

Jul 24, 2015

Basically our cube contains two different Facts:

- Sales Volume: Information about sold articles to a customer incl. Selling date
- Survey: irregular answered survey questions about customers incl. date of answer
and three Dimensions:
- Customer
- Date
- Survey Answer: Information about possible Answer values (e.g. Yes / No)

Relations:
Fact: Sales Volume  ------>  Dim: Customer  <------  Fact: Survey   ------>  Dim: Survey Answer
                    '-------------->      Dim: Date       <----------------'

We would like to be able to determine the aggregated sales volume (sum) of a customer for a specific period depending on the latest survey answer within this period.

For example:
Selected Time period: Jan - Jul 2015
Sales Volume Customer X - Jan - Jul 2015: 1000 Litres
Sales Volume Customer Y - Jan - Jul 2015: 500 Litres

Surveys answered:

15th Jan 15: Customer X, Survey Question A: Yes
2nd Mar 15: Customer X, Survey Question A: No
20th Apr 15: Customer X, Survey Question A: Yes

10th Feb 15: Customer Y, Survey Question A: Yes
20th Jul 15: Customer Y, Survey Question A: No

Latest survey answer (Jan-Jul) Customer X, Question A: Yes
Latest survey answer (Jan-Jul) Customer Y, Question A: No

Excel Pivot should show something like this:

Question       |      Latest Answer:     Yes                |       No         |

------------------------------------------------------------------------------------
A                    |     1000 Litres     |    500 Litres    |

How this is possible and has to be implemented?

View 5 Replies View Related

T-SQL And Calculating A Sum

Sep 26, 2006

I want to sum up a column, but only summing up the top 25 quantites and then I want to subtract the sum of all quantities from the total of the top 25...how would this be done with t-sql?

View 3 Replies View Related

Calculating PK

Jul 2, 2001

SQL7

I am interested in your opinion on the creation of primary keys in a table - simple ones that is. It would be the replacement for an Identity column.

Some say calculate the value off a lookup table, others say use an external object like c++ dll reading/incrementing from a flat file.

Using an identity column reduces portability of the table.

Thoughts ?

Craig

View 2 Replies View Related

Help !!!calculating Age

Nov 15, 2001

Hi,
What the best way to calculate the age given two datetimes.
I tried using the DATEDIFF(yyy,startdate,enddate) but that seems to only compare the year and not look at the specific day.

I am looking for something that would return the following output


birthday= 12/6/1973
EndDate = 11/30/2001
then the age should be 27

If birthday = 12/6/1973
enddate = 12/11/1973
then the age should be 28

thanks in advance
Zoey

View 3 Replies View Related

Calculating RFM

Apr 17, 2007



I'm in the process of developing a Kimball-method CRM data warehouse and I'd like to have Recency, Frequency, Monetary "scores" at the customer level. Am I better off creating these in the relational database and feeding them to SSAS or have SSAS do the aggregations and assign the "scores"?



Also, has anyone located any SSIS transform scripts that would calculated RFM scores? This is probably a pretty easy task in VB.net but I haven't gone down that road yet.



Steve

View 1 Replies View Related

Calculating The Sum Of Columns...

Oct 31, 2006

It may be simple question, but how can i get the sum of column? with conditions like getting the some of clicks one user send and so...

View 5 Replies View Related

Calculating Ages

Jul 3, 2007

When users register with my site they give me their DoB, how can I work out an age from it. I was thinkin about doing it from the year, but that isnt very accurate. Can anyone help? thanks si! ps Id only want to work out how many years old they are. si! 

View 7 Replies View Related

Calculating ID Numbers

Mar 28, 2008

 I needed to come up with an algorithm to create unique user- friendly account numbers such as AC0000000001, AC0000000002, etc...Where they increment by 1. I created a SQL function that retrieves the previous number generated, adds 1 to it, inserts the new value into  the table, then returns the new value. I started thinking, what if the function is ran at the same time? What if function # 1 creates the new number, and function #2 creates a new number as well before function #1 inserts it? Is this a possible scenario? If so, how do I lock the process until the function completes to prevent this?  Thanks for any help you provide.

View 2 Replies View Related

Calculating The 3rd Value By The First 2's Selection

May 30, 2008

Hi,
First off, let me state that i am new to ASP.net... and have had to hit the ground running... I have looked on the net but have not found a suitable explanation on how to do this.
Let me explain what i am trying to do: In my aspx page, i have 2 dropdown boxes where the user will select a skill catagory, and then a skill. Based on that selection, i would like to compute what the Service line will be. There is a primary and foreign key on CatID on the skills and SkillCat tables. This data would need to be inserted into the another table aswell, and this would need to go into a report later.
How do i go about doing this? Some examples would be greatly appreciated. And if you know of a good link, please post it for me.
 Skills Table









CatID
SkillID
Skills
SL_ID

1
4
Skill 1
3

2
5
Skill 2
2

2
6
Skill 3
2

3
7
Skill 4
4

3
8
Skill 5
4

4
9
Skill 6
NULL

4
10
Skill 7
NULL

5
11
Skill 8
3

6
12
Skill 9
3

7
13
Skill 10
4

8
14
Skill 11
1

9
15
Skill 12
3

9
16
Skill 13
3

10
17
Skill 14
6

11
18
Skill 15
1
Skills Catagory








CATID
Org
Skillcat

1
Org1
Skill Category 1

2
Org2
Skill Category 2

3
Org3
Skill Category 3

4
Org4
Skill Category 4

5
Org5
Skill Category 5

6
Org6
Skill Category 6

7
Org7
Skill Category 7

8
Org8
Skill Category 8

9
Org9
Skill Category 9
 Service Line Table







SL_ID
Service_line

1
Service Line 1

2
Service Line 2

3
Service Line 3

4
Service Line 4

5
Service Line 5

6
Service Line 6

7
Service Line 7
 
Thanks for all your help in advance.
Dash

View 1 Replies View Related

Calculating Avg Rowsize In My Db...

Nov 23, 2001

Hi,

I'm using SQL Server 7.0 SP3.

I need to calculate the average size of a record in my database to assist in estimating growth.

Is there a quick and/or easy way of doing this?

Thanks in advance,
Darrin

View 1 Replies View Related

Help With Calculating Dates.

Aug 26, 2005

Hi,

I'm fairly new to MS SQL, but I'm trying to query the time elapse between two dates. Example below...

Select
dbo.res.book_date,
dbo.res.arrive_date,
Cast (dbo.translog.systemdate as datetime)
From
dbo.res
Where
dbo.res.resid > '500'

The third line is where I need help with a statement. I need the elapse time. Ex. if the book date is 20050820100000 and the arrive date is 20050820120000, I would like the third Select statement to return 2:00 hours or something similar. Thanks.

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved