This is a discussion on Stored procedure within the SQL Server forums, part of the Microsoft SQL Server category; --> hi im fairly new to sql more rusty than new but anyway here is my prob i need to ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| hi im fairly new to sql more rusty than new but anyway here is my prob i need to create a stored procedure to create a primary key in a table this key should be 1st position Current yeary 2004 i use the the 4th number "4" 2nd position is 0-9 or A-Z ascii 48-57 and 65-90 3rd thru 8position Position is 6digit number in 999999 example 000001,000002 final output will look like this 4A000010 // alll beginning numbers Will have a number Where A is.... this gives me many millions of medical claims per year and this is a fairly small number used in Medical Claim COB's from insurance companies so and examples or any help or suggestions how i should accomplish this will be greatly Appriciated Dave |
| ||||
| Hi It is always better to post DDL (Create table statements etc..) and example data (as insert statements) to remove any ambiguities that arise from descibing this in words. It may be better to do your processing in the front end application, but without more information and knowledge of the business rules (such as "how do you know a record that a needs a begining number?" etc...) there are too many unknowns to give more advice. John "davep" <dvs_bis@sbcglobal.net> wrote in message news:XFDJc.20682$QC2.14899@newssvr27.news.prodigy. com... > hi im fairly new to sql more rusty than new but anyway > here is my prob > > i need to create a stored procedure to create a primary key in a table > this key should be > 1st position Current yeary 2004 i use the the 4th number "4" > 2nd position is 0-9 or A-Z ascii 48-57 and 65-90 > 3rd thru 8position Position is 6digit number in 999999 example > 000001,000002 > final output will look like this > 4A000010 // alll beginning numbers Will have a number Where A is.... > > this gives me many millions of medical claims per year and this is a fairly > small number used in > Medical Claim COB's from insurance companies > > so and examples or any help or suggestions how i should accomplish this > will be greatly Appriciated > > Dave > > > |