Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 12th, 2015, 12:42 PM
Zvi Zvi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 3 Zvi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 18 sec
Reputation Power: 0
Proceeding char to primary key int

I'm creating a new database to a VB software program I make years ago. I'm pretty sure the answer to my question will be "no" but I must ask to be sure...

Very simple question about the primary key on a clients table. The seed will start at 1001 and will increase by 1. In my software I want the id of a client to be displayed as ID-1001. It's no biggie to code this into VB at every display or print but I wanted to know if the SQL database itself has an option to automatically add a 'char' prefix to the 'int' index whenever doing a query on the table.

Reply With Quote
  #2  
Old May 28th, 2016, 10:49 AM
informer informer is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2016
Posts: 10 informer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 33 m 52 sec
Reputation Power: 0
Hi Zvi

to display idClient with ID-icClientNumber, proceed as follows
Code:
SELECT idClient, 'ID-' & idClient as code FROM...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Proceeding char to primary key int


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap