Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
7
Reply
need help as soon as possible
Carnation Flowers
Mar 14 2017 2:13 PM
259
Reply
i create database and all relations
i have Session table
USE [OnCall]
GO
/****** Object: Table [dbo].[Sessions] Script Date: 03/14/2017 21:08:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Sessions](
[SessionID] [int] NOT NULL,
[PatFileID] [int] NULL,
[DocID] [int] NULL,
[Date] [datetime] NULL,
[PickupOfvistLocation] [nvarchar](max) NULL,
[SessionFees] [decimal](18, 0) NULL,
[MCFees] [decimal](18, 0) NULL,
[DoctorFees] [decimal](18, 0) NULL,
[AppFees] [decimal](18, 0) NULL,
[PeriodOfsession] [nvarchar](50) NULL,
[DescriptionOfSession] [nvarchar](max) NULL,
[LabTestID] [nvarchar](50) NULL,
[XaryTestID] [nvarchar](50) NULL,
[MedisionName] [nvarchar](50) NULL,
[InjuctionName] [nvarchar](50) NULL,
[Others] [nvarchar](max) NULL,
[NotesAr] [nvarchar](max) NULL,
[NotesEng] [nvarchar](max) NULL,
[NumOfVisit] [int] NULL,
CONSTRAINT [PK_Sessions] PRIMARY KEY CLUSTERED
(
[SessionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Sessions] ADD CONSTRAINT [DF_Sessions_NumOfVisit] DEFAULT ((1)) FOR [NumOfVisit]
GO
------------------
be side it i have rate table
MCID int
Rate Decimal
----------------------
what i need??
seeions table has these fields
[SessionFees]
[MCFees]
[DoctorFees]
[AppFees]
wanna when user enter seeion fees the other three columns be auto compouted
like this
[MCFees]=[SessionFees]*Rate from table rate/100
[DoctorFees]=[SessionFees]*Rate from table rate/100
[AppFees]=[SessionFees]*Rate from table rate/100
need to finish this as soon as possible
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
Creating a table in SQL using values of two table with some
divide by zero error encountered