Hi all,
I have created two tables as User_tb and consultant_tb in sql server.
I just wanna select data from this two tables for the login. Data in those tables are not unique.
There is an one login for both users and consultants. When i enter the email and password, it should validate from those two tables and redirect to the different pages.
Please let me know the Sql Query.
Thank you.
Table 1- User_tb
- CREATE TABLE [dbo].[User_tb](
- [ID] [int] IDENTITY(1,1) NOT NULL,
- [U_FirstName] [nvarchar](50) NULL,
- [U_LasName] [nvarchar](50) NULL,
- [U_EmailAddress] [nvarchar](50) NOT NULL,
- [U_Password] [nvarchar](50) NULL,
- [U_CurrentWeight] [float] NULL,
- [U_CurrentHeight] [float] NULL,
- [U_Gender] [nvarchar](10) NULL,
- [U_BirthDay] [date] NULL,
- [U_BMI] [float] NULL,
- CONSTRAINT [PK_User_tb] PRIMARY KEY CLUSTERED
- (
- [U_EmailAddress] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
Table 2 - Consultant_tb
- CREATE TABLE [dbo].[Consultant_tb](
- [ID] [int] IDENTITY(1,1) NOT NULL,
- [C_SurName] [nvarchar](50) NULL,
- [C_FirstName] [nvarchar](50) NULL,
- [C_MiddelName] [nvarchar](50) NULL,
- [C_NIC_Number] [nvarchar](10) NULL,
- [C_Gender] [nvarchar](10) NULL,
- [C_Nationality] [nvarchar](50) NULL,
- [C_Address] [nvarchar](100) NULL,
- [C_PostalCode] [nvarchar](50) NULL,
- [C_TelephoneNumber] [int] NULL,
- [C_MobileNumber] [int] NULL,
- [C_MedicalLicenceNumber] [nvarchar](50) NULL,
- [C_EmailAddress] [nvarchar](50) NOT NULL,
- [C_Password] [nvarchar](50) NULL,
- [C_DegreeName] [nvarchar](50) NULL,
- [C_University] [nvarchar](50) NULL,
- [C_YearObtained] [date] NULL,
- [C_AdditionalQualification] [nvarchar](500) NULL,
- [C_Experience] [nvarchar](500) NULL,
- [C_Evidence] [nvarchar](50) NULL,
- [C_Advertisement] [nvarchar](50) NULL,
- CONSTRAINT [PK_Consultant_tb] PRIMARY KEY CLUSTERED
- (
- [C_EmailAddress] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]