Click here to Skip to main content
15,887,256 members
Home / Discussions / Database
   

Database

 
GeneralRe: Do we need to promote SP's anymore? Pin
Jörgen Andersson29-Sep-11 8:16
professionalJörgen Andersson29-Sep-11 8:16 
AnswerRe: Do we need to promote SP's anymore? Pin
Eddy Vluggen25-Sep-11 10:39
professionalEddy Vluggen25-Sep-11 10:39 
GeneralRe: Do we need to promote SP's anymore? Pin
PIEBALDconsult25-Sep-11 14:20
mvePIEBALDconsult25-Sep-11 14:20 
GeneralRe: Do we need to promote SP's anymore? Pin
Mycroft Holmes25-Sep-11 16:07
professionalMycroft Holmes25-Sep-11 16:07 
GeneralRe: Do we need to promote SP's anymore? Pin
Eddy Vluggen26-Sep-11 12:19
professionalEddy Vluggen26-Sep-11 12:19 
QuestionMySQL 5.2.34 CE Pin
Emejulu JVT24-Sep-11 8:34
Emejulu JVT24-Sep-11 8:34 
AnswerRe: MySQL 5.2.34 CE Pin
André Kraak24-Sep-11 8:55
André Kraak24-Sep-11 8:55 
Questiongenerating IDs with IDENTITY() in sql server 2005 Pin
Danzy8321-Sep-11 11:59
Danzy8321-Sep-11 11:59 
Hi wonderful experts, this problem has become a headache to me and so I consult you.

I need to generate IDs that are unique for records. I want the IDs to include the year in which the record is added to a table. So for instance, the first record will have an actual value of say

10001


but because i want the year to be part of the ID and where for instance the record is added in the year 2011, I will want the ID to be

201110001


The subsequent records to follow will have IDs as

201110002
201110003
201110004
201110005
.........
.........
.........


where the numbers have been stuck to the year to generate the IDs. Then during the next year which will be 2012, the first record in that year will start the count from 10001, and when stuck to the year, subsequent IDs will be

201210001
201210002
201210003
201210004
.........
.........
.........


I want all these records to be in the same table. I have been thinking of ways around this but I don't get a way of achieving this. Please help if there are ways to do this. I'm using Microsoft SQL Server 2005. Thanks.
AnswerRe: generating IDs with IDENTITY() in sql server 2005 Pin
PIEBALDconsult21-Sep-11 14:25
mvePIEBALDconsult21-Sep-11 14:25 
AnswerRe: generating IDs with IDENTITY() in sql server 2005 PinPopular
Mycroft Holmes21-Sep-11 16:09
professionalMycroft Holmes21-Sep-11 16:09 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
David Skelly21-Sep-11 22:37
David Skelly21-Sep-11 22:37 
JokeRe: generating IDs with IDENTITY() in sql server 2005 Pin
Mycroft Holmes21-Sep-11 23:10
professionalMycroft Holmes21-Sep-11 23:10 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
David Skelly22-Sep-11 1:38
David Skelly22-Sep-11 1:38 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
PIEBALDconsult22-Sep-11 3:19
mvePIEBALDconsult22-Sep-11 3:19 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
David Skelly22-Sep-11 6:04
David Skelly22-Sep-11 6:04 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
Mycroft Holmes22-Sep-11 12:53
professionalMycroft Holmes22-Sep-11 12:53 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
Danzy8322-Sep-11 14:17
Danzy8322-Sep-11 14:17 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
Mycroft Holmes22-Sep-11 16:11
professionalMycroft Holmes22-Sep-11 16:11 
AnswerRe: generating IDs with IDENTITY() in sql server 2005 Pin
Tim Carmichael23-Sep-11 4:52
Tim Carmichael23-Sep-11 4:52 
GeneralRe: generating IDs with IDENTITY() in sql server 2005 Pin
PIEBALDconsult23-Sep-11 10:03
mvePIEBALDconsult23-Sep-11 10:03 
QuestionFetching of data w.r.t the time limits in Sql Server2000 Pin
praveengb20-Sep-11 22:58
praveengb20-Sep-11 22:58 
AnswerRe: Fetching of data w.r.t the time limits in Sql Server2000 Pin
PIEBALDconsult21-Sep-11 2:45
mvePIEBALDconsult21-Sep-11 2:45 
GeneralRe: Fetching of data w.r.t the time limits in Sql Server2000 Pin
praveengb24-Sep-11 1:01
praveengb24-Sep-11 1:01 
AnswerRe: Fetching of data w.r.t the time limits in Sql Server2000 Pin
David Skelly21-Sep-11 4:25
David Skelly21-Sep-11 4:25 
QuestionHow to convert from (Sybase Or Access) database to Mysql Pin
zigzagooo20-Sep-11 22:40
zigzagooo20-Sep-11 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.