MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 17th, 2004, 09:15 AM
sql asp sql asp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: UK
Posts: 259 sql asp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 51 sec
Reputation Power: 4
anutomatically generated number but with prefix

Hi,

I need to automatically create a reference number (using an ID column) but it needs to have a prefix such as ABC... so the ref would be ABC<number> Is this actually possible?

Thanks

Reply With Quote
  #2  
Old August 17th, 2004, 11:53 AM
sql asp sql asp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: UK
Posts: 259 sql asp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 51 sec
Reputation Power: 4
automatically!!

Lol I should learn to spell.

One thing I forgot to mention was that I want to be able to select different prefixes depending on a value selected from a drop down box in a web form... So if the user selects ABC then the ref would be ABC123 for example....

Thanks

Reply With Quote
  #3  
Old August 19th, 2004, 09:42 AM
sql asp sql asp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: UK
Posts: 259 sql asp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 51 sec
Reputation Power: 4
Hi, does anyone have any idea at all about this? I've tried searching and can't find anything worthwhile... I'd really appreciate any help anyone can offer, thanks

Reply With Quote
  #4  
Old August 26th, 2004, 05:16 PM
Blase Blase is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 11 Blase User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
String concatenation using single-quotes(') with the plus sign (+), and a randomizing function (RAND()).

You could create this at the user-interface, or do the same with SQL. Depends on your application and the volumes of data you're dealing with.

-Blasé

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > anutomatically generated number but with prefix


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway