How can apply any login in side sql database

Posted by Bhuwan87rawat under Sql Server on 8/22/2012 | Points: 10 | Views : 746 | Status : [Member] | Replies : 4
Hi
In my application i want to some login inside database like as if client post is manager than his salary increment 15% if post programmer them salary increment 10%.......................
this is possible in database and also asp.net




Responses

Posted by: Pandians on: 8/22/2012 [Member] [MVP] Silver | Points: 25

Up
0
Down
Kindly post your requirement more detail!

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhuwan87rawat on: 8/22/2012 [Member] Starter | Points: 25

Up
0
Down
In my application a table name emp it contains id name designation,salary
i want to update table
if designation=manager then i want to add 15% of salary to current salary,
if programmer then add 10% of salary to current salary
how it is possible in sql server

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopesh9 on: 8/22/2012 [Member] Starter | Points: 25

Up
0
Down
@bhuwan

take all the values of the Table in the dataset using dataadapter... i.e. da.fill(da)
now all the changes you want to do, do it in the dataset.
after that when the changes is finished i.e. increasing the salary in your case... update the table using da.update();

where da is the object of DataAdapter and ds is the object of DataSet.

G. S.
.Net Developer

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pandians on: 8/22/2012 [Member] [MVP] Silver | Points: 25

Up
0
Down
Check It Out!
Create Table Emp

(
id Int,
name Varchar(50),
designation Varchar(50),
salary Int
)
Go

Insert Emp Values(100,'Aequea','Developer',45000)
Insert Emp Values(101,'Salino','Senior Developer',45000)
Insert Emp Values(102,'Calcalino','Admin',75000)
Insert Emp Values(103,'Setaceo','SA',40000)
Insert Emp Values(104,'Socaprio','SSA',56500)
Insert Emp Values(105,'Alumin','Analyst',41000)
Insert Emp Values(106,'Vitriolic','Developer',46000)
Go

Select Id, Name, designation, Salary [Actual Salary],
Salary + (Salary *
Case designation When 'Developer' then 0.10 /*10%*/
When 'Senior Developer' then 0.12 /*12%*/
When 'Admin' then 0.21 /*21*/
When 'SA' then 0.11 /*11%*/
When 'SSA' then 0.16 /*16%*/
When 'Analyst' then 0.18 End) [Enhanced Salary]
from Emp
Go


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response