Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
AnswerRe: Querying SQL2005 in C# on Current DateTime Pin
Pete O'Hanlon21-Mar-07 5:41
mvePete O'Hanlon21-Mar-07 5:41 
AnswerRe: Querying SQL2005 in C# on Current DateTime Pin
Laxman Auti21-Mar-07 5:50
Laxman Auti21-Mar-07 5:50 
QuestionIs there and difference between .mdf file in MSSQL & SQLEXPRESS? Pin
sir_moreno21-Mar-07 1:38
sir_moreno21-Mar-07 1:38 
AnswerRe: Is there and difference between .mdf file in MSSQL & SQLEXPRESS? Pin
Colin Angus Mackay21-Mar-07 4:57
Colin Angus Mackay21-Mar-07 4:57 
GeneralRe: Is there and difference between .mdf file in MSSQL & SQLEXPRESS? Pin
sir_moreno21-Mar-07 5:18
sir_moreno21-Mar-07 5:18 
GeneralRe: Is there and difference between .mdf file in MSSQL & SQLEXPRESS? Pin
Pete O'Hanlon21-Mar-07 5:23
mvePete O'Hanlon21-Mar-07 5:23 
GeneralRe: Is there and difference between .mdf file in MSSQL & SQLEXPRESS? Pin
sir_moreno21-Mar-07 6:09
sir_moreno21-Mar-07 6:09 
QuestionHow to avoid primary key violation error Pin
JeyKey21-Mar-07 0:15
JeyKey21-Mar-07 0:15 
I Have a MS SQL Store proc, which takes max value of a field from the table for a day ( That field has got date part )and adds 1 if it exists or creates new if it does not exists.

Logic is like this

select a = max ( ID) where ID like (20070321%) /*Denotes March 21 2007*/
if (a is null ) set 200703210001
else a = a+1

insert into table (ID,....) values (a,....)

I am getting primary key violation error occassionaly.
I would like to know, How the SQL Server handles concurrent request for executing storedprocedures.

For example if it is sequential my logic should work fine
else
There can be duplicate values for ID fields.

Please help.


I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some - it won't hurt you'..... - Christian Graus on Code Project outages
AnswerRe: How to avoid primary key violation error Pin
Pete O'Hanlon21-Mar-07 0:39
mvePete O'Hanlon21-Mar-07 0:39 
GeneralRe: How to avoid primary key violation error Pin
JeyKey21-Mar-07 0:45
JeyKey21-Mar-07 0:45 
GeneralRe: How to avoid primary key violation error Pin
Pete O'Hanlon21-Mar-07 2:43
mvePete O'Hanlon21-Mar-07 2:43 
AnswerRe: How to avoid primary key violation error Pin
scottgp21-Mar-07 3:12
professionalscottgp21-Mar-07 3:12 
QuestionInsert into SQL Problem Pin
Memo Soso20-Mar-07 23:13
Memo Soso20-Mar-07 23:13 
AnswerRe: Insert into SQL Problem Pin
N a v a n e e t h20-Mar-07 23:15
N a v a n e e t h20-Mar-07 23:15 
GeneralRe: Insert into SQL Problem Pin
Colin Angus Mackay20-Mar-07 23:25
Colin Angus Mackay20-Mar-07 23:25 
GeneralRe: Insert into SQL Problem Pin
Memo Soso20-Mar-07 23:30
Memo Soso20-Mar-07 23:30 
GeneralRe: Insert into SQL Problem Pin
Colin Angus Mackay20-Mar-07 23:37
Colin Angus Mackay20-Mar-07 23:37 
GeneralRe: Insert into SQL Problem Pin
N a v a n e e t h21-Mar-07 0:42
N a v a n e e t h21-Mar-07 0:42 
GeneralRe: Insert into SQL Problem Pin
Pete O'Hanlon21-Mar-07 2:46
mvePete O'Hanlon21-Mar-07 2:46 
GeneralRe: Insert into SQL Problem Pin
Colin Angus Mackay21-Mar-07 4:54
Colin Angus Mackay21-Mar-07 4:54 
AnswerRe: Insert into SQL Problem Pin
Colin Angus Mackay20-Mar-07 23:27
Colin Angus Mackay20-Mar-07 23:27 
QuestionSELECT TOP x field FROM Pin
joon vh.20-Mar-07 22:56
joon vh.20-Mar-07 22:56 
AnswerRe: SELECT TOP x field FROM Pin
Colin Angus Mackay20-Mar-07 23:23
Colin Angus Mackay20-Mar-07 23:23 
GeneralRe: SELECT TOP x field FROM Pin
joon vh.20-Mar-07 23:25
joon vh.20-Mar-07 23:25 
GeneralRe: SELECT TOP x field FROM Pin
Colin Angus Mackay20-Mar-07 23:28
Colin Angus Mackay20-Mar-07 23:28 

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.