Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
QuestionC# code is only inserting a few records. Pin
Norris Chappell25-Jun-15 7:15
Norris Chappell25-Jun-15 7:15 
AnswerRe: C# code is only inserting 1 record. Pin
F-ES Sitecore25-Jun-15 7:23
professionalF-ES Sitecore25-Jun-15 7:23 
AnswerRe: C# code is only inserting 1 record. Pin
Dave Kreskowiak25-Jun-15 7:31
mveDave Kreskowiak25-Jun-15 7:31 
GeneralRe: C# code is only inserting 1 record. Pin
Norris Chappell25-Jun-15 9:12
Norris Chappell25-Jun-15 9:12 
GeneralRe: C# code is only inserting 1 record. Pin
Dave Kreskowiak25-Jun-15 10:20
mveDave Kreskowiak25-Jun-15 10:20 
GeneralRe: C# code is only inserting 1 record. Pin
Norris Chappell25-Jun-15 13:05
Norris Chappell25-Jun-15 13:05 
GeneralRe: C# code is only inserting 1 record. Pin
Sascha Lefèvre25-Jun-15 14:25
professionalSascha Lefèvre25-Jun-15 14:25 
AnswerRe: C# code is only inserting a few records. Pin
Richard Deeming25-Jun-15 8:47
mveRichard Deeming25-Jun-15 8:47 
Norris Chappell wrote:
IF NOT EXISTS (SELECT * FROM StaffTrackingFTEData) INSERT INTO StaffTrackingFTEData (...

When you execute the query the first time, if there are no rows in the table, then the first row will be inserted.

For every subsequent row, that IF NOT EXISTS(...) condition will be false, since there will be at least one row in the table. Therefore, your INSERT statement will not be executed.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell25-Jun-15 9:16
Norris Chappell25-Jun-15 9:16 
GeneralRe: C# code is only inserting a few records. Pin
Richard Deeming25-Jun-15 9:29
mveRichard Deeming25-Jun-15 9:29 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell25-Jun-15 11:03
Norris Chappell25-Jun-15 11:03 
GeneralRe: C# code is only inserting a few records. Pin
Sascha Lefèvre25-Jun-15 14:08
professionalSascha Lefèvre25-Jun-15 14:08 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell25-Jun-15 15:20
Norris Chappell25-Jun-15 15:20 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell29-Jun-15 3:44
Norris Chappell29-Jun-15 3:44 
GeneralRe: C# code is only inserting a few records. Pin
Richard Deeming29-Jun-15 3:49
mveRichard Deeming29-Jun-15 3:49 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell29-Jun-15 4:42
Norris Chappell29-Jun-15 4:42 
GeneralRe: C# code is only inserting a few records. Pin
Richard Deeming29-Jun-15 4:44
mveRichard Deeming29-Jun-15 4:44 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell29-Jun-15 5:04
Norris Chappell29-Jun-15 5:04 
GeneralRe: C# code is only inserting a few records. Pin
PIEBALDconsult25-Jun-15 10:10
mvePIEBALDconsult25-Jun-15 10:10 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell25-Jun-15 10:35
Norris Chappell25-Jun-15 10:35 
GeneralRe: C# code is only inserting a few records. Pin
Sascha Lefèvre25-Jun-15 14:14
professionalSascha Lefèvre25-Jun-15 14:14 
GeneralRe: C# code is only inserting a few records. Pin
Norris Chappell25-Jun-15 15:49
Norris Chappell25-Jun-15 15:49 
GeneralRe: C# code is only inserting a few records. Pin
PIEBALDconsult29-Jun-15 15:36
mvePIEBALDconsult29-Jun-15 15:36 
QuestionFile permissions when writing a file to FTP server using FtpWebRequest Pin
DanDan_T25-Jun-15 6:47
DanDan_T25-Jun-15 6:47 
AnswerRe: File permissions when writing a file to FTP server using FtpWebRequest Pin
Pete O'Hanlon25-Jun-15 9:28
mvePete O'Hanlon25-Jun-15 9: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.