I am busy with a web page that allows the user to capture a new
Appointment
, represented by this table:
CREATE TABLE [Appointment](
[Id] [int] IDENTITY(1,1) NOT NULL,
[ClientName] [nvarchar](100) NOT NULL,
[ClientId] [int] NULL,
[DateTime] [smalldatetime] NOT NULL,
[Hours] [int] NULL,
[Subject] [nvarchar](100) NULL
) ON [PRIMARY]
The reason I have column
ClientName
is to make the capture process for a new appointment as quick and smooth as possible, even for a client that does not yet exist. If I had a non-nullable ClientId, the user would have to create a new client before continuing.
Then, the app should run a task to identify appointments with null
ClientId
values, and prompt the user into either capturing a new client, or assigning the correct existing client to the appointment.
Am I barking up the wrong tree here with this approach, and if so, what would you recommend?