primary key as foreign key


I have set a table in which the primary key(auto incremented) is also the foreign key, which references another primary key in the parent table.

Despite I have made some insertion queries without problem I really do not know if the above logic is correct-problems may arise in the future, which I cannot predict now, cause of course I have not operated the db in other scenarios, unless of course-as already mentioned- insertion queries.

I must say, that I intend referencing the specific table, with other child tables too-with foreign keys from there.
Posted On: Sunday 30th of December 2012 11:17:48 PM Total Views:  214
View Complete with Replies

RELATED TOPICS OF Microsoft SQL Server PROGRAMMING LANGUAGE




Force primary ID

How to force the primary key for a table to begin at a set Primary Id and not standard count (1,2,3,4,5..10,11,12) etc. Pretty much how to force it being on number I would like to begin.
VIEWS ON THIS POST

72

Posted on:

Thursday 25th October 2012
View Replies!

Bigint type primary key

I'm using Sql Server 2000/7 for my projects. How to handle the situation if a primary key (a field set as identity) of type bigint gives an overflow problem Is there any way to reuse identities if a primary key field is set as identity from the database settings (we can do this if we donot set the primary key field as identity from the datbase and handle it from front end) please help
VIEWS ON THIS POST

82

Posted on:

Friday 26th October 2012
View Replies!

Problem with a complex query

Hi guyz, I guess there is a very simple solution to this but i cant think logically no more.. i have gone alllll blank i would really appreciate it if someone can help me real quick. I run a query in vbscript that fills up my recordset from multiple tables. Its actually gettin userid, firstname and email address of users:::: SELECT PersonalInfo.firstname AS Expr2, PersonalInfo.email AS Expr3, SurveyAns.answer AS Expr4 FROM PersonalInfo INNER JOIN SurveyAns ON PersonalInfo.userid = SurveyAns.userid INNER JOIN SurveyQue ON SurveyAns.surveyid = SurveyQue.surveyid AND SurveyAns.questionid = SurveyQue.questionid where (SurveyAns.answer LIKE '%" & value11 & "%' AND SurveyQue.name='" & value12 & "') the variables value11 and value12 come from a dynamic drop down lists. Now i need an option to be able to further narrow down that is filter from this recordset set of usernames, and user ids with SurveyAns.answer = something and SurveyQue.name = something else. I hope i was able to explain the question well..
VIEWS ON THIS POST

155

Posted on:

Wednesday 7th November 2012
View Replies!

hourly query with export to hourly different filename.csv

Can anyone tell me how to get a different filename every hour after doing the same query. The query has to output a file like this, name.date.time.csv. The date and/or time differ every query. I hope there is someone who can help me.
VIEWS ON THIS POST

180

Posted on:

Saturday 10th November 2012
View Replies!

Dumbest question ever, where is my SQL database?

I've installed the latest SQL server, ODBC, etc, and installed a program called Bullzip, which converts Access DB's to MySql. The program works great, but where is the database it generates I can't find it anywhere. I looked in the MySQL folder, nothing. I have another program called Dreamcoder for opening the databases and editing fields, it lists the database and all the fields, but I have no idea where it's getting it from. I need to upload the MySQL database to my server so that I can begin converting my Access based ASP code. Where do I find it, and where would I upload it to on a godaddy server
VIEWS ON THIS POST

254

Posted on:

Sunday 11th November 2012
View Replies!

SQL update statement needed

hey all. can anyone provide an SQL example for an update statement that is, i am attempting to write an [event procedure] in MS Access that updates [Assisgnment Count] to a table (tbl_Employee_LifeCycle), along with the other data from a report. Overall i needed to obtian a running Sum for a group in my query results. The only way i found to do this was in a report. therefore, I now all of the deed data (from the query) and the Assignment Count associated by Employee (from the running sum function) in a MS Access report. I would like to now update all of this info to a table. there are two fields in the report, the Assignment Count field, called lbl_RecordCount in the report and Employee Name (lbl_Employee).
VIEWS ON THIS POST

118

Posted on:

Tuesday 20th November 2012
View Replies!