Click here to Skip to main content
15,891,431 members
Home / Discussions / Database
   

Database

 
AnswerRe: Where do i start? Pin
Colin Angus Mackay10-Jul-06 20:17
Colin Angus Mackay10-Jul-06 20:17 
AnswerRe: Where do i start? Pin
Eric Dahlvang11-Jul-06 6:04
Eric Dahlvang11-Jul-06 6:04 
QuestionFirst record in list creates 'System.Data.DataRowView' Pin
Glen Harvy10-Jul-06 15:31
Glen Harvy10-Jul-06 15:31 
QuestionConnecting to SQL Server Express 2005 using C# Pin
Cadence2.010-Jul-06 14:20
Cadence2.010-Jul-06 14:20 
AnswerRe: Connecting to SQL Server Express 2005 using C# Pin
Paul Conrad10-Jul-06 14:39
professionalPaul Conrad10-Jul-06 14:39 
QuestionWhich local datasource to use? [modified] Pin
Rashar10-Jul-06 13:44
Rashar10-Jul-06 13:44 
AnswerRe: Which local datasource to use? Pin
god_bless_the_world10-Jul-06 13:56
god_bless_the_world10-Jul-06 13:56 
QuestionError with INSERT statement Pin
leckey10-Jul-06 11:09
leckey10-Jul-06 11:09 
I have an asp.net project in which I pass a part number, and a part description to the stored proc.

What I want to insert (in table Parts)in the end is the part number, and the part type ID. I get that part type ID from table PartType.ID.

So my syntax is correct in that Enterprise manager makes no fuss, but when I actually do the insert I get the error "Cannot insert the value NULL into column 'PartTypeId',
table 'PartsDB.dbo.Parts'; column does not allow nulls.
INSERT fails. The statement has been terminated." I am not sure what is wrong with the code here.

CREATE PROCEDURE [dbo].[UpdatePart_Step_1]<br />
@PartNumber varchar (15),<br />
@PartType varchar (60) <br />
<br />
AS<br />
declare @pt_id integer<br />
<br />
if NOT EXISTS (Select * from Parts where PartNumber = @PartNumber)<br />
BEGIN<br />
<br />
SELECT  @pt_id = pt.ID FROM PartTypes pt <br />
<br />
INNER JOIN Parts p on pt.ID = p.PartTypeID<br />
<br />
WHERE pt.Description = @PartType<br />
<br />
insert into Parts<br />
(PartNumber, PartTypeID)<br />
<br />
VALUES<br />
(<br />
@PartNumber,<br />
@pt_id<br />
)<br />
END<br />
return 0<br />
GO


Does anyone see my problem?
AnswerRe: Error with INSERT statement Pin
Colin Angus Mackay10-Jul-06 12:13
Colin Angus Mackay10-Jul-06 12:13 
QuestionGetting the SUM of two field values [modified] Pin
Nino_110-Jul-06 9:06
Nino_110-Jul-06 9:06 
AnswerRe: Getting the SUM of two field values Pin
Eric Dahlvang10-Jul-06 9:16
Eric Dahlvang10-Jul-06 9:16 
GeneralRe: Getting the SUM of two field values Pin
Nino_110-Jul-06 11:44
Nino_110-Jul-06 11:44 
GeneralRe: Getting the SUM of two field values Pin
Eric Dahlvang10-Jul-06 12:00
Eric Dahlvang10-Jul-06 12:00 
GeneralRe: Getting the SUM of two field values Pin
Nino_111-Jul-06 7:04
Nino_111-Jul-06 7:04 
Questionusing BETWEEN in sql2005 Pin
toink toink9-Jul-06 21:29
toink toink9-Jul-06 21:29 
AnswerRe: using BETWEEN in sql2005 Pin
Colin Angus Mackay9-Jul-06 23:39
Colin Angus Mackay9-Jul-06 23:39 
Questionhow to use now() function in the Access when I write SQL Pin
KSCsoft9-Jul-06 3:33
KSCsoft9-Jul-06 3:33 
AnswerRe: how to use now() function in the Access when I write SQL Pin
kumarprabhakar7410-Jul-06 1:14
kumarprabhakar7410-Jul-06 1:14 
AnswerRe: how to use now() function in the Access when I write SQL Pin
kumarprabhakar7410-Jul-06 1:15
kumarprabhakar7410-Jul-06 1:15 
QuestionData Source Reconciliation (Sybase) Pin
SSLaks9-Jul-06 1:41
SSLaks9-Jul-06 1:41 
Questionplease help me!!! Pin
kicap8-Jul-06 17:29
kicap8-Jul-06 17:29 
AnswerRe: please help me!!! Pin
Paul Conrad8-Jul-06 19:11
professionalPaul Conrad8-Jul-06 19:11 
AnswerRe: please help me!!! Pin
Eric Dahlvang10-Jul-06 3:26
Eric Dahlvang10-Jul-06 3:26 
Questionhow to update dataset after session cache? Pin
Ed 548-Jul-06 12:40
Ed 548-Jul-06 12:40 
AnswerRe: how to update dataset after session cache? Pin
Igor Sukhov9-Jul-06 0:24
Igor Sukhov9-Jul-06 0:24 

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.