How Do I Create A Relationship In DB Diagrammer ?
Hi Folks,
When I try to create a Relationship between two Tables I find the Relationship is always created from the Table I start with to itself.
I seem to have to select a Table to enable the Create Relationship option, and then when I 'Add' it creates a recursive Relationship to that Table.
I guess it must be possible to do what I am trying to do ?
I'd appreciate any advice.
Thanks.
Barry
View Complete Forum Thread with Replies
Related Forum Messages:
How Can I Create A One-to-one Relationship In A SQL Server Management Studio Express Relationship Diagram?
How can I create a one-to-one relationship in a SQL Server Management Studio Express Relationship diagram? For example: I have 2 tables, tbl1 and tbl2. tbl1 has the following columns: id {uniqueidentifier} as PK name {nvarchar(50)} tbl2 has the following columns: id {uniqueidentifier} as PK name {nvarchar(50)} tbl1_id {uniqueidentifier} as FK linked to tbl1.id If I drag and drop the tbl1.id column to tbl2 I end up with a one-to-many relationship. How do I create a one-to-one relationship instead? mradlmaier
View Replies !
Trying To Create A Relationship
Here is the error I am getting'role' table saved successfully'users' table- Unable to create relationship 'FK_users_role'. ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_users_role'. The conflict occurred in database 'raintranet', table 'role', column 'role_id'.table rolerole_id intname varchar 50table usersusers_id introle_id inTrying to get table.role_id to be related to role.role_idAny help would be appreciated
View Replies !
How To Create A Relationship?
How do I create a relationship between two tables when the two columns that should connect each table have different names? i.e. Table Person Column Name < -- > Table Employee Column Person Name The two columns actually contain the same data type but different field name and size. I know this involves a series of steps. What are they? Could you please include some sample code.
View Replies !
Best Way To Create The Relationship
Hi - SQL beginer here.... SQL2005 I have a table dbo.server Compid - 1 Name PK - Server1 Make - HP etc... I have just created a new table dbo.ProcessorInfo with the following columns: Name BrandName ProcessorCoreCount etc.... This table will have more than 1 record for each name: Server1 Intel 2 Server1 Intel 2 Server2 Intel 1 Server2 Intel 1 and so on. What is the best way to relate the name in dbo.server and name in dbo.ProcessorInfo so this is a one to many? Obviously I can't set the name column as a PK as I have more than 1 record of the same value in it. Help much appreciated!
View Replies !
How To Create A One-to-one Relationship
hello all, I am new to SQL server and dont have a clue on how to create a one-to-one relationship in sql server2000. Say, I have a table 'A' with a PK <customer_id> and another table 'B' with a PK <order_id>. Now to define a one-to-one relation between them how to do that? thanks in advance. -tanveer
View Replies !
Create Trigger For Relationship
Hi, I need help in creating a trigger before delete. The trigger should be in such a way that it should display a message, if there is any relationship with other table. For example I have a table with employee details which have empid as primary key. I have another table with employee salary details where empid is foreign key. The trigger should check the relationship with these two tables. If I try to delete an emploeyee from employee details table and if there is a relationship of that employee with the salary table then the trigger should print a message. If there is no relationship then the trigger should perform the deletion. I want to create a trigger like this. Please help!!!!!!!!!!!!!!!!
View Replies !
How T Create Relationship B/w Two Tables
Hi I have two database as Malathi,Indoo In Malathi database i have Employee Table AS ---------------------- Eid Int (PK) Enam varchar(50) In Indoo Database I have Job table as Eid int (FK) Jid Int (PK) Now how can i create relation b/w two tables of different database Any One can help for this query Malathi Rao
View Replies !
Create Table With Many-to-many Relationship...
Hi, I come back again. Can anyone help me to create table with many-to-many relationship. Here is my three tables tbl_Networks ( NID int identity(1,1) primary key, NetworkName nvarchar(256) ) tbl_Categories ( CID int identity(1,1) primary key, CateName nvarchar(256), NID int ) tbl_Sim ( SID int identity(1,1) primary key, NID int, CID int, NameOfSim nvarchar(256) ) My problem is 1 value in tbl_Sim may have multiple values in table tbl_Categories and vice versal. And I don't know how to organise them So I need some help...
View Replies !
Unable To Create Relationship FK
Hi. I get this error when i try to create a relationship in a db diagram (sql 2005) "'tblActivedir' table saved successfully 'tblClient' table - Unable to create relationship 'FK_tblClient_tblActivedir1'. Introducing FOREIGN KEY constraint 'FK_tblClient_tblActivedir1' on table 'tblClient' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint. See previous errors." What i have is 2 tables. 1 named client 1 named activedir In the client table the columns i want to bind with activedirtable are FR1 and DC1 I want to bind them in the ID of the activedir table (both, in different fk relationships) so that they get the id of activedir. Fr1 has an fk relationship with activedir (pk is activedir' id) and DC1 exactly the same in another fk. So i want both columns to comunicate with activedir. If p.e. activedir has 3 elements (a,b,c) when i delete element a then werever FR1 or DC1 have this element(binded to it's id) then the element will also be deleted (id of the element) from both FR1 and DC1 I don't want to set Delete and Update action to none because i want the element changed or deleted from activedir, to do the same on Fr1 or DC1 or both. Any help? Thanks.
View Replies !
How To Create A Datagrid For Two No Relationship Tables
Hi, I am trying to create a create for two table A and table B which have no relationship each time. For TableA, there are 3 columns like ID, APoints1, APoint2. For Table B, there are also 3 columns as ID, Qty, BPoints. There is no internal relationship for these two tables. But there may be same ID inside A and B for some records. Now I want to create a datagrid for displaying the information as : ID, Sum(A.APoints1 + A.APoints2) - Sum(B.Qty * B.BPoints) WHERE A.ID = B.ID Please Notice that I can't use directly SQL script as following from table A and table B because there is no relationship for Table A and Table B, otherwise the recult set would be wrong: Select A.ID, Sum(A.APoints1 + A.APoints2) - Sum(B.Qty * B.BPoints) WHERE A.ID = B.ID group by A.ID May I know is there solution for it? Thank you very much!
View Replies !
Create Table With Recursive Relationship
I am fairly new to SQL and I am currently trying to createa SQL table (using Microsoft SQL) that has a recursiverelationship, let me try to explain:I have a piece of Data let's call it "Item" wich may again contain onemore "Items". Now how would I design a set of SQL Tables that arecapable of storing this information?I tried the following two approaches:1.) create a Table "Item" with Column "ItemID" as primary key, somecolums for the Data an Item can store and a Column "ParentItemID". Iset a foreign key for ParentItemID wich links to the primarykey"ItemID" of the same table.2.) create separate Table "Item_ParentItem" that storesItemID-ParentItemID-pairs. Each column has a foreign key linked toprimary key of the "Item" Column "ItemID".In both approaches when I try to delete an Item I get an Exceptionsaying that the DELETE command could not be executed because itviolates a COLUMN REFERENCE constraint. The goal behind these FK_PKrelations is is that when an Item gets deleted, all childItems shouldautomatically be deleted recursively.How is this "standard-problem" usually solved in sql? Or do I inned toimplement the recursive deletion myself using storedprocedures or something ?
View Replies !
Create A View For One-to-many Relationship Table
hi.. I would like to create a view for two tables which have a one-to-many relationship. Code: Table: Supplier Supp_ID 1 Table:Supplier_category Supp_ID,StockCategoryID 1,56 1,57 1,90 How can i create a view that has columns like below: Supp_ID, Stock 1,[56,57,90] Thanks in advance.
View Replies !
How To Use The Create Relationship Function At MS SQL Server
hi all, For those who will celebrate the chinese new year, Gong Xi Fa Cai!!! I now using microsoft SQL server to manage my database. To manage the database, I have go through the SQL Server Enterprise Manager To create my database. Now I am the stage create the relationship for my relations. So when I drag the foreign key from one relation to primary key at another relation, vice versa, it will pop up the 'Create Relationship' form. What I can saw is there are three check boxes. one check boxes have 2 sub check boxes. Quote: Checkbox 1 - [Check existing data on creation] Checkbox 2 - [Enforce relationship for replication] Checkbox 3 - [Enforce relationship for INSERTs and UPDATEs] Checkbox 3.1 - [Cascade Update Related Fields] Checkbox 3.2 - [Cascade Delete Related Records] Usually the Checkbox 1, 2, 3 had been checked. but the check box 3.1 and 3.2 is display as uncheck by default. Another question is when I linked up the relationship between two of the relations will appear a asterisk(*) beside the relation's name. Why? But I not very understand to the check boxes means and the asterisk. Can someone give me some guidelines!!Thanks Thanks in billions.... Best regards John Ang
View Replies !
Stored Procedue 2 Create A Relationship.
i have a table where the feilds are 1.fromtable 2.fromfeild 3.fromcategory 4.totable 5.tofeild 6.tocategory. i have write a stored proceduer for creating 2 relationship between fromfeild & tofeild from the same value in from category & in tocategory. there r around 465 records in a table. so anyone can comeout for solution of this. hope soon i get a solution for this.
View Replies !
Create Or Show Relationship Digram
Dear sir or madam I have a problem related to create or show relationship digram in sql server 2005. Especially, I want to show relationship diagram that I established in sqlserver 2000 in sql server 2005 but I can't and I don't how to do it. I look forward to hearing. Thank you in advance! Best regard, seyha moth
View Replies !
Create Relationship With Tables In A Linked Server
I need to create a relationship between a local table and tables on alinked server. I used the design table wizard and selected therelationship property wizard. In the reslationship property wizard,the tables that I need to get the keys from in the linked server do notshow up. Is there a way to do this, or I simply don't have enoughpermission to tables in the linked server. On the local server, theSecurity tab of linked server property has Local Loging "sa", RemoteUser "sa" and Remote Password "****". Thanks for your help.
View Replies !
Failing To Create Relationship (SQL Server Claims Table Lacks PK For Some Reason ?)
I tried to create a relationship in EM's diagram pane inSQL Server 2000 (I'd list the version of EM, but About gives methe MMC version, which is probably not relevant.)(The database itself is SQL Server 2000 SP3.)I got an error that I don't understand (because, at leastat first blush, it appears to be quite untrue). Note thatI have never clicked before on the diagrams child of thedatabase; this was entirely experimental."Primary key or UNIQUE constraint must be defined fortable 'xxx' before it can participate in a relationship."http://msdn.microsoft.com/library/d...cantbepktbl.asp1) My table already had a primary key; why is MS SQL Server apparentlyclaiming otherwise ? (I don't think I can define a second primary keyon the same table. I could perhaps define an additional unique indexon top of the primary key, but, I'm not sure.)2) What does it mean: table '<0s>' ? That is, what does 0s mean ?
View Replies !
Import Csv Data To Dbo.Tables Via CREATE TABLE && BUKL INSERT:How To Designate The Primary-Foreign Keys && Set Up Relationship?
Hi all, I use the following 3 sets of sql code in SQL Server Management Studio Express (SSMSE) to import the csv data/files to 3 dbo.Tables via CREATE TABLE & BUKL INSERT operations: -- ImportCSVprojects.sql -- USE ChemDatabase GO CREATE TABLE Projects ( ProjectID int, ProjectName nvarchar(25), LabName nvarchar(25) ); BULK INSERT dbo.Projects FROM 'c:myfileProjects.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '' ) GO ======================================= -- ImportCSVsamples.sql -- USE ChemDatabase GO CREATE TABLE Samples ( SampleID int, SampleName nvarchar(25), Matrix nvarchar(25), SampleType nvarchar(25), ChemGroup nvarchar(25), ProjectID int ); BULK INSERT dbo.Samples FROM 'c:myfileSamples.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '' ) GO ========================================= -- ImportCSVtestResult.sql -- USE ChemDatabase GO CREATE TABLE TestResults ( AnalyteID int, AnalyteName nvarchar(25), Result decimal(9,3), UnitForConc nvarchar(25), SampleID int ); BULK INSERT dbo.TestResults FROM 'c:myfileLabTests.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '' ) GO ======================================== The 3 csv files were successfully imported into the ChemDatabase of my SSMSE. 2 questions to ask: (1) How can I designate the Primary and Foreign Keys to these 3 dbo Tables? Should I do this "designate" thing after the 3 dbo Tables are done or during the "Importing" period? (2) How can I set up the relationships among these 3 dbo Tables? Please help and advise. Thanks in advance, Scott Chang
View Replies !
Why I Got The Message As You Need To Create The Many-to-one Relationship Between The Case Table And The Nested Table?
Hi, all experts here, Thank you very much for your kind attention. I am trying to create a new mining structure with case table and nested table, the case table (fact table) has alread defined the relationships with the nested table(dimension table), and I can see their relationship from the data source view. But why the wizard for creating the new mining structure showed that message? Why is that? And what could I try to fix it? Hope it is clear for your help. Thanks a lot for your kind advices and I am looking forward to hearing from you shortly. With best regards, Yours sincerely,
View Replies !
How To Set A Relationship Here?
How to create a relation between gf_game and gf_gamegenre here? gf_gamegenre is responsible for the relation between a game and it's genre(s). The relationship between gf_genre and gf_gamegenre worked. (http://img361.imageshack.us/my.php?image=relationzl9.jpg) When I try to set a relationshop between gamegenre and game I'm getting this error: 'gf_game' table saved successfully'gf_gamegenre' table- Unable to create relationship 'FK_gf_gamegenre_gf_game'. The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_gf_gamegenre_gf_game". The conflict occurred in database "gamefactor", table "dbo.gf_game", column 'gameID'. Thanks for any help!
View Replies !
Need Help With Relationship
I have this situation in my DB: tblClients, ClientID(pk) 1---M tblDocuments, DocumentID(pk), ClientID(fk), DocumentTypeID M---1 tblDocumentTypes, DocumentTypeID(pk)(this is a lookup table) If a client is deleted I want to cascade and delete that clients documents from tblDocuments. When I set the relationships delete and update to cascade on tblDocuments it is also set to cascade on the lookup table (tblDocumnetTypes). Why is this and how do I make it stay the way I want it?
View Replies !
Many To One Relationship
Hello I have need to write a query that I can pass in a bunch of filter criteria, and return 1 result....it's just ALL of the criteria must be matched and a row returned: example: Transaction table: id, reference attribute table: attributeid, attribute transactionAttribute: attributeid, transactionid Example dat Attribute table contains: 1 Red, 2 Blue, 3 Green Transaction table contains: 1 one, 2 two, 3 three transactionAttribute contains: (1,1), (1,2), (1,3), (2,3), (3,1) If I pass in Red, Blue, Green - I need to be returned "one" only If I pass in Red - I need to be returned "three" only If I pass in Red, Green - nothing should be returned as it doesn't EXACTLY match the filter criteria If anyone's able to help that would be wonderful! Thanks, Paul
View Replies !
One To One Relationship
I created 2 tables with one to one relationship. if I add a record intable A, how does table B record get created? Does SQL do thisautomatically because it is one to one relationship? or do I need tocreate a trigger? if i need a trigger, how do I get the ID of newrecord to create the same ID in table B?thanks for any help.Joe Klein
View Replies !
One-One Relationship
Hi,Do you guys know what's wrong with a one-to-one relationship?The reason I want to make it like this is that at the very end of the chain,the set of keys is huge. I want to limit the number of columns to be thekey. i.e. the [company] table has 1 column as the key. The [employee]table will have 2 columns as the key.e,g,If I add a [sale] table to the [company]-[employee] relationship, the thirdtablewill have 3 columns as the key -- "company id", "employee id", and "saleid".(e.g.)I have a company with many employees and computers. But instead of classifyall these, I just want to call all these as an entity. A company is anentity. An employee is just another entity. etc.So, instead of a one-to-many:[company]---*[employee]---*[sale]||*[computer]I make it one-to-one.[entity]---*[entity]If I want to know the name and address of the entity "employee", I will havea 1-to-1 table [employee] to look up the information for this employeeentity.[entity]---*[entity]||[company]||[employee]||[computer]||[sale]--[color=blue]> There is no answer.> There has not been an answer.> There will not be an answer.> That IS the answer!> And I am screwed.> Deadline was due yesterday.>> There is no point to life.> THAT IS THE POINT.> And we are screwed.> We will run out of oil soon.[/color]
View Replies !
ER Relationship
For a weak relationship, will 0 and 1 in the ER diagram represent partialand total participations of the 2 entities sets respectively or vice versa.
View Replies !
One To One Relationship
Can anyone provided insight on how to create a one-to-one relationship between SQL tables? Every time I try to link two tables that should be one-to-one, the link says one-to-many. How can I specify one-to-one when SQL Server automatically thinks it is a one-to-many? Thanks, Kellie
View Replies !
Fk Relationship
Hi. I get this error when i try to create a relationship in a db diagram (sql 2005) "'tblActivedir' table saved successfully 'tblClient' table - Unable to create relationship 'FK_tblClient_tblActivedir1'. Introducing FOREIGN KEY constraint 'FK_tblClient_tblActivedir1' on table 'tblClient' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint. See previous errors." What i have is 2 tables. 1 named client 1 named activedir In the client table the columns i want to bind with activedirtable are FR1 and DC1 I want to bind them in the ID of the activedir table (both, in different fk relationships) so that they get the id of activedir. Fr1 has an fk relationship with activedir (pk is activedir' id) and DC1 exactly the same in another fk. So i want both columns to comunicate with activedir. If p.e. activedir has 3 elements (a,b,c) when i delete element a then werever FR1 or DC1 have this element(binded to it's id) then the element will also be deleted (id of the element) from both FR1 and DC1 I don't want to set Delete and Update action to none because i want the element changed or deleted from activedir, to do the same on Fr1 or DC1 or both. Any help? Thanks.
View Replies !
ERD 1:1 Relationship
I am trying to create a 1:1 relationship, but not primary key to primary key. In table 1 I have a uniqueidentifier as a primary key. In table 2 I have an int as the primary key and a column that takes the uniqueidentifier from table 1. Everytime I drag and drop the relationship line and link table 1 to table 2 it creates a 1:N relationship: ie. tbl1.primarykey links to tbl2.column2. So I'm not linking primary key to primary key however I still want a 1:1 relationship. How do I do that? Thanks in advance.
View Replies !
One-To-Many Relationship
SQLServer 2005 - I have two tables. One has a field defined as a Primary Unique Key. The other table has the same field, but the Index is defined as non-Unique, non-clustered. There is no primary key defined on the second table. I want to set up a one-to-many relationship between the two, but am not allowed. This should be simple. What am I doing incorrectly?
View Replies !
Relationship Between A AND ( B OR C )
I have a fact table with 2 fields : "Dim Code 1" and "Dim Code 2" that I want to link with a Dim table. I don't want to create two dimensions Dim1 and Dim2 but only one dimension with something like : Code Snippet Dim.Code=Fact.DimCode1 OR Dim.Code=Fact.DimCode2 Is it possible to do this ? Thanks in advance
View Replies !
ERD Relationship
hi, I've draw the ERD for my database in management studio express but I have a question regarding the relationship between tables. How can I define the cardinality of the relationship between two tables? by default in managemet studio is it the relationship is only one-to-many relationship?
View Replies !
Relationship
Hi. (Sorry if i am not posting this in the right forum) well i am learning to create a small software and have come up with four tables which are as follows; Client date <!--[if !vml]--><!--[endif]-->client_id name address contact_num Smoking smoking_id client_id meas_arm meas_neck meas_shoulder Color_code description Trousers trousers_id client_id meas_leg meas_hips meas_waist color_code description Shirt shirt_id client_id meas_arm meas_neck meas_shoulder color_code description My question Is it possible to have a relationship linking one single table to other several one. For example i wanted to relate the field client_id from table client which is the primary to tables shirt,trousers and smoking with the client_id field which is the foreign key ? thanks
View Replies !
Key Relationship
This is the message that i get when trying to assign keys when creating diagrams in visual express: 'tbh_Polls' table saved successfully 'tbh_PollOptions' table - Unable to create relationship 'FK_tbh_PollOptions_tbh_Polls'. The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_tbh_PollOptions_tbh_Polls". The conflict occurred in database "C:USERSSTICKERDOCUMENTSMY WEB SITESPERCSHARPAPP_DATAASPNETDB.MDF", table "dbo.tbh_Polls", column 'PollID'. PollID is my primary key in tbh_Polls And PollID is in tbh_PollOptions table No matter what I do, I get this message, I'm Lost! Help plz. Thanks
View Replies !
One To One Relationship
How do I create a one to one relationship in a SQL2005 Express database? The foreign key needs to be the same as the primary key so it can't just increment to the next number.
View Replies !
FK - PK Relationship Problems
HiI have a FK to PK relationship problem. I have 2 tablesQuickLinks<PK>QuickLinkItems<FK>So what I had this is I made a relationship. I put in the relationship options this. I turned off "enforce FK contraint" and I put for the delete rule "cascade". So I turned off the FK contraint since I don't think with it on the cascade delete would work. So now I tried it out. I launched my website and tried to delete something but no cascading happened. I then went to MS SQL and added some new values in and tried to delete it there(by clicking on the column and hitting delete). No cascadeing happened. What am I doing wrong?
View Replies !
What Relationship To Use Between These Two Table?
Hi I have two tables: 1.) Operator-OperatorID{PK, int, not null}-OperatorName{varchar(100), not null}-Enabled{bit, not null}-PasswordChange{bit, not null}-BirthDate{datetime, not null} 2.) Password-PasswordID{PK, int, not null}-Password{varchar(50), not null}-ExpirationDate{datetime, not null} I'm not sure how to design and layout these two tables. The layout of these two tables is completely flexible as the application has not been deployed. I'm open to any good suggestions. For each Operator I want to stored up to 3 previous passwords plus their current password. The password change field is so that if the operator's password expires or gets reset, they will be forced to enter a new password. This is a simple internal company application, so password encrypting is not necessary. The ExpirationDate indicates the date that the password will expire. Hope to hear from someone soon! Thank you!
View Replies !
Simple DB Relationship
hi there, after a lot of fussing about i found it would be a lot easier to use an SQLDS and a gridview to display my data rather than code it. However i cant for the life of me work out how to replace some of the numbers (IDs) with their accompanying names. so i have a QTY which is an INT and a Location1 which is an INT in tbl_stock_location and in tbl_locations i have the appropiate 1 = shop etc this is what i came up with for my string SELECT tbl_stock_part_multi_location.stock_part_multi_location_ID, tbl_stock_part_multi_location.stock_ID, tbl_stock_part_multi_location.Description, tbl_stock_part_multi_location.Qty1, tbl_stock_part_multi_location.Location1, tbl_stock_part_multi_location.Qty2, tbl_stock_part_multi_location.Location2, tbl_stock_part_multi_location.Qty3, tbl_stock_part_multi_location.Location3, tbl_stock_part_multi_location.Qty4, tbl_stock_part_multi_location.Location4, tbl_stock_part_multi_location.Qty5, tbl_stock_part_multi_location.Location5 FROM tbl_stock_part_multi_location INNER JOIN tbl_location ON tbl_stock_part_multi_location.Location1 = tbl_location.Location_ID AND tbl_stock_part_multi_location.Location2 = tbl_location.Location_ID AND tbl_stock_part_multi_location.Location3 = tbl_location.Location_ID AND tbl_stock_part_multi_location.Location4 = tbl_location.Location_ID AND tbl_stock_part_multi_location.Location5 = tbl_location.Location_ID WHERE (tbl_stock_part_multi_location.stock_ID = @stock_ID)" I used the query builder for this but it just dosnt seem to work and throws an error at me. Any help would be great!
View Replies !
How To Add Data Into A PK To FK Relationship?
HiI have 2 tables one is called QuickLinks and another called QuickLinkItemsQuickLinksQuickLinkID<PK> UserID QuickLinkName-------------------------- ----------- ------------------------1 111-111-111-111 QuickLink12 111-111-111-111 QuickLink23 222-222-222-222 QuickLink1 QuickLinkItemsQuickLinkID <FK> CharacterName CharacterImagePath---------------------- ------------------------------- ---------------------------------------- 1 a path11 b path22 d path32 e path43 a path14 b path 2 So thats how I see the data will look like in both of these tables the problem however I don't know how to write this into Ado.net code. Like I have made a PK to FK relationship on QuickLinkID(through the relationship builder thing). I am just not sure how to I do this. For the sake of an example say you have 5 text boxes 2 text boxes for inserting the character names and 2 text boxes for inserting the CharacterImagePath. Then one for the Name of the QuickLink. So how would this be done? Like if it was one table it would be just some Insert commands. Like if this was all one table I would first get the userID from the asp membership table then grab all the values from the textBoxes and insert them where they go to and the QuickLinkID would get filled automatically. The thing that throws me off is the QuickLinkID since it needs to be the same ID as in the QuickLink table. So do I have to first insert some values into the QuickLink table then do a select on it and grab the ID then finally continue with the inserts Into the QuickLinkItems table? Or do I have to join these tables together?Thanks
View Replies !
Join One To Many Relationship
hi all geeks, I have a problem regarding joins. I have 2 tables, Customer ( Customer_code, Agent1, Agent2, Agent3) Agent( Agent_Code, Agent_name) and data is like this: Customer_code Agent1 Agent2 Agent3 1 1 2 3 2 2 3 4 3 1 4 3 Agent Table Agent_Code Agent_name 1 X 2 Y 3 Z 4 P 5 Q Now I want to retrieve all customer_code with their corresponding agent names, like 1 X Y Z2 Y Z P3 X P Z, any suggestions please,thanks a lot.
View Replies !
Relationship Diagram
Hi there, I just set up my AppData and i'm trying to connect the Membership to a tbl_Profile that i created.I notice there's an application_id and a user_id which are uniqueidentifiers. I've been trying create a relationship to tbl_Profile's user_id column but it won't let me saying it's not compatible. Am i suppose to set tbl_Profile's user_id column to int or uniqueidentifier? I've tried both and it won't let me... THanks!
View Replies !
|