Unix Technical Forum

Stored procedure

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 04:37 AM
davep
 
Posts: n/a
Default Stored procedure

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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 04:38 AM
John Bell
 
Posts: n/a
Default Re: Stored procedure

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
>
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com