Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

getting dynamic column values in sql server

$
0
0

i have a table with columns

LeaveRequestId, employeeid

i want to generate leaverequestid dynamically at this type

when i enter employeeid=1

leaverequestid should generate LMS1001

lms1(here 1 means employeeid)001(here 1 means first time we enter)

again we enter employeeid=1

leaverequestid should generate LMS1002

when we enter employeeid=1 10th time

leaverequestid should generate LMS1010

when we enter employeeid=10

leaverequestid should generate LMS1001

my output should come

like this

LeaveRequestId   employeeid

lms1001               1

lms1002               1

lms2001               2

lms11001              11

lms11002              11       

I have to solve this by the end of the day

Help Me


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>