plz help me ,i have to update a table "temp" where a temp_id is dyanamically change by 1 everytime and there are another table "Master" which contains id(int) and user_id(varchar). User_id is like 'FMS00' and the temp_id is dynamicaly change using code ..... and store into 'id' also and the user_id is changed to FMS001 , FMS002 and so on...

This has to be done using ASP.NET using C#.

Plz give me some coding for that.

Recommended Answers

All 2 Replies

Write sql in the following way:

SELECT MAX(CONVERT(INT,RIGHT(user_id,3)))+1 from master

Will give you the incremented number Now pad FMS & 0 if required by using length of your max func return value.

Thanks a lot....................

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.