how to generate unique number
-
i have a gridview which is storing a record .i want to generate a unique no while saving one record. the format should be like (pscode(2place),year(4place)and num(4place)) example:--01-2007-0001 where ps_code is char(2), year come form date-which is of date and time datattype and the last 4 place are char(4), where ps_code and date are the field of my data base.i want retrive ps_code and year from my database to generate the unique number. can tell me how will i do it? i am devloping a web applcation where the backend is vb.net2005.
-
i have a gridview which is storing a record .i want to generate a unique no while saving one record. the format should be like (pscode(2place),year(4place)and num(4place)) example:--01-2007-0001 where ps_code is char(2), year come form date-which is of date and time datattype and the last 4 place are char(4), where ps_code and date are the field of my data base.i want retrive ps_code and year from my database to generate the unique number. can tell me how will i do it? i am devloping a web applcation where the backend is vb.net2005.
select Max last number of Unique code and increament it by 1 Best Regard Pathan
---------------------------------------------------
-
i have a gridview which is storing a record .i want to generate a unique no while saving one record. the format should be like (pscode(2place),year(4place)and num(4place)) example:--01-2007-0001 where ps_code is char(2), year come form date-which is of date and time datattype and the last 4 place are char(4), where ps_code and date are the field of my data base.i want retrive ps_code and year from my database to generate the unique number. can tell me how will i do it? i am devloping a web applcation where the backend is vb.net2005.
Hi u generate unique no thr sqlserver , there identity proper is there u changed as true then u can generate... steps 1.open ur table thr Sqlserver enterprise manages then open ur table below ur table that identity option is there Reg Nantha
-
select Max last number of Unique code and increament it by 1 Best Regard Pathan
---------------------------------------------------
Hi first u create one column for that no,then if u enable identity as true then below that they put increment as 1 by default , if u need increment by 2 or any value u can put , u ref that increment value to that column (ie new column for that no) , then that no's stored in that column u can ref that column u can easly fetch that no Reg Nanthakumar
-
Hi u generate unique no thr sqlserver , there identity proper is there u changed as true then u can generate... steps 1.open ur table thr Sqlserver enterprise manages then open ur table below ur table that identity option is there Reg Nantha
What is 'ur' table?
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
-
i have a gridview which is storing a record .i want to generate a unique no while saving one record. the format should be like (pscode(2place),year(4place)and num(4place)) example:--01-2007-0001 where ps_code is char(2), year come form date-which is of date and time datattype and the last 4 place are char(4), where ps_code and date are the field of my data base.i want retrive ps_code and year from my database to generate the unique number. can tell me how will i do it? i am devloping a web applcation where the backend is vb.net2005.
If I understand your problem you need a unique integer when saving your record. Why not just use an identity column in your table and return that through an output parameter in your save procedure? Another approach I've seen often is using GUID. You can generate that at the time your object is created and it (is supposed to) be unique. HTH
J
Make the logo bigger