Click here to Skip to main content
15,888,454 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 19:26
Framework .l.11-Dec-11 19:26 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Mycroft Holmes11-Dec-11 19:40
professionalMycroft Holmes11-Dec-11 19:40 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 20:47
Framework .l.11-Dec-11 20:47 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Mycroft Holmes11-Dec-11 22:13
professionalMycroft Holmes11-Dec-11 22:13 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 22:34
Framework .l.11-Dec-11 22:34 
AnswerRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Eddy Vluggen12-Dec-11 8:37
professionalEddy Vluggen12-Dec-11 8:37 
Questiongenerate specific format in sql table Pin
sk_ko11-Dec-11 15:46
sk_ko11-Dec-11 15:46 
AnswerRe: generate specific format in sql table Pin
Mycroft Holmes11-Dec-11 19:00
professionalMycroft Holmes11-Dec-11 19:00 
I suspect this is a BAD idea, I also suspect you are using this field as a primary key. If so the DON'T it is a BAD design.

To do this you will need to query the table to find out how many inserts there are for this year, build your string and insert the record. There are a number of alternatives to this process that include triggers and stored procedures.

Here is the reason it is a bad idea. What happens if another user inserts a record during this process, BOOM one busted database.

I suggest you insert the datetime for Created then query filtered on the year and ordered by the created date. If you need an incremental number you can use ROW_NUMBER() assuming you are using sql server
Never underestimate the power of human stupidity
RAH

GeneralRe: generate specific format in sql table Pin
sk_ko11-Dec-11 21:20
sk_ko11-Dec-11 21:20 
GeneralRe: generate specific format in sql table Pin
Mycroft Holmes11-Dec-11 22:11
professionalMycroft Holmes11-Dec-11 22:11 
AnswerRe: generate specific format in sql table Pin
PIEBALDconsult12-Dec-11 1:54
mvePIEBALDconsult12-Dec-11 1:54 
GeneralRe: generate specific format in sql table Pin
sk_ko12-Dec-11 2:57
sk_ko12-Dec-11 2:57 
AnswerRe: generate specific format in sql table Pin
jschell12-Dec-11 8:51
jschell12-Dec-11 8:51 
AnswerRe: generate specific format in sql table Pin
Eddy Vluggen12-Dec-11 10:15
professionalEddy Vluggen12-Dec-11 10:15 
Questionupdate and view news headline Pin
Jassim Rahma10-Dec-11 21:48
Jassim Rahma10-Dec-11 21:48 
AnswerRe: update and view news headline Pin
Wayne Gaylard10-Dec-11 22:26
professionalWayne Gaylard10-Dec-11 22:26 
QuestionGet start date Pin
Elizabeth Rani7-Dec-11 23:50
Elizabeth Rani7-Dec-11 23:50 
AnswerRe: Get start date Pin
Hum Dum8-Dec-11 0:11
Hum Dum8-Dec-11 0:11 
GeneralRe: Get start date Pin
Elizabeth Rani8-Dec-11 0:25
Elizabeth Rani8-Dec-11 0:25 
AnswerRe: Get start date Pin
SilimSayo8-Dec-11 10:49
SilimSayo8-Dec-11 10:49 
QuestionHow to Call A web service inside SQL server Pin
yousefshokati7-Dec-11 17:30
yousefshokati7-Dec-11 17:30 
AnswerRe: How to Call A web service inside SQL server Pin
David Skelly7-Dec-11 22:26
David Skelly7-Dec-11 22:26 
GeneralRe: How to Call A web service inside SQL server Pin
yousefshokati8-Dec-11 0:28
yousefshokati8-Dec-11 0:28 
AnswerRe: How to Call A web service inside SQL server Pin
SilimSayo8-Dec-11 8:27
SilimSayo8-Dec-11 8:27 
QuestionExporting and Importing data from and into SQL Server 2008 Pin
SQL Ed7-Dec-11 2:58
SQL Ed7-Dec-11 2:58 

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.