View Single Post
  #5 (permalink)  
Old January 9th, 2007, 08:56 AM
AzlanAziz AzlanAziz is offline
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AzlanAziz
Default

Well about the combo boxes... i actually thought of different scenario
(i change the primary key of the student table to be autoincremented).
well the issue now is what if i create a new table which is empty? (eg: the user can freely insert any clubname in the textbox.... the student can be associated with 2-3 clubs)
is the procedure below the right way to it?... sorry to trouble u much but i'm kinda stuck right now..

INSERT INTO student
                      (studentname)
VALUES ('cassidy')
INSERT INTO Club(studentid, Clubname)
VALUES (SCOPE_IDENTITY(), 'history')

__________________________________________________ _____


CREATE TABLE [student] (
    [studentid] INTEGER IDENTITY(0,1) NOT NULL,
    [studentname] VARCHAR(40),
    CONSTRAINT [PK_student] PRIMARY KEY ([studentid])
)

CREATE TABLE [Club] (
    [studentid] INTEGER,
    [Clubnameid] INTEGER IDENTITY(0,1) NOT NULL,
    [Clubname] VARCHAR(40),
    CONSTRAINT [PK_classname] PRIMARY KEY ([classid])
)
GO


Reply With Quote