Click here to Skip to main content
15,905,414 members

Comments by sabbi26 (Top 18 by date)

sabbi26 12-Nov-12 6:43am View    
Hi shahzads,

I almost used same logic

Declare @Id varchar(8) = ''
Select @Id = 'P' + RIGHT('0000000' + Cast((CAST(SUBSTRING(lastGeneratedId, 2, (LEN(lastGeneratedId) - 1)) as int) + 1) as varchar(7)), 7) from
(
Select MAX(ID) as lastGeneratedId
from MyTable
) as A

but it's not working.
problem is before inserting my generated ID it's inserting by another user from another session.
So i am assuming Scope_Identity or Identity_Current will solve my problem?
sabbi26 12-Nov-12 6:43am View    
Deleted
Hi shahzads,

I almost used same logic

Declare @Id varchar(8) = ''
Select @Id = 'P' + RIGHT('0000000' + Cast((CAST(SUBSTRING(lastGeneratedId, 2, (LEN(lastGeneratedId) - 1)) as int) + 1) as varchar(7)), 7) from
(
Select MAX(PatientID) as lastGeneratedId
from MyTable
) as A

but it's not working.
problem is before inserting my generated ID it's inserting by another user from another session.
So i am assuming Scope_Identity or Identity_Current will solve my problem?
sabbi26 15-Nov-11 23:42pm View    
Check the user have permissions to read and write the file in file server.
sabbi26 7-Nov-11 5:36am View    
Thank u i tried it before for entire folder it's not worked. but now i tried for particular file it's work like charm.
sabbi26 3-Nov-11 3:01am View    
Create usercontrol of type DateTimePicker and use in the application.