Click here to Skip to main content
15,922,155 members
Home / Discussions / Database
   

Database

 
QuestionOleDB or Sql? Pin
Alexandru Savescu19-Aug-03 22:28
Alexandru Savescu19-Aug-03 22:28 
AnswerRe: OleDB or Sql? Pin
Brad Sokol22-Aug-03 2:58
Brad Sokol22-Aug-03 2:58 
GeneralNO_DATA - no error information available Pin
bpchia19-Aug-03 20:10
bpchia19-Aug-03 20:10 
GeneralRe: NO_DATA - no error information available Pin
bpchia22-Aug-03 1:43
bpchia22-Aug-03 1:43 
Generalstumped Pin
Shotgun19-Aug-03 18:34
Shotgun19-Aug-03 18:34 
GeneralRe: stumped Pin
Rocky Moore19-Aug-03 22:58
Rocky Moore19-Aug-03 22:58 
GeneralRe: stumped Pin
Shotgun20-Aug-03 1:44
Shotgun20-Aug-03 1:44 
GeneralHelp with sql trigger Pin
Ista19-Aug-03 11:32
Ista19-Aug-03 11:32 
I have a sql trigger in that on each updated row I need to up the the schedule table using the scheduleid recorded in the checkinout table, i create a user defined function but I cant get it to work right. Yes I have tested the UDF and it works fine.

<br />
ALTER FUNCTION [Convert].IsOrderCompleted<br />
	(<br />
	/*<br />
	@parameter1 datatype = default value,<br />
	@parameter2 datatype<br />
	*/<br />
	@OrderNumber varchar(10)<br />
	)<br />
RETURNS bit<br />
AS<br />
	BEGIN<br />
		DECLARE @FoundNull bit<br />
		<br />
		SET @FoundNull = 1<br />
		<br />
		SELECT @FoundNull = CASE WHEN CompletedDate IS NULL THEN 0 END FROM OrderDetail WHERE OrderNumber = @OrderNumber<br />
		<br />
		/* sql statement ... */<br />
	RETURN @FoundNull<br />
	END<br />


the trigger
<br />
CREATE TRIGGER CheckInOut_ValidatedTrigger<br />
ON dbo.CheckInOut<br />
FOR UPDATE<br />
AS<br />
	IF UPDATE(Validated)<br />
		BEGIN<br />
			IF ( Validated = 1 )<br />
				BEGIN<br />
					SET NOCOUNT ON<br />
					<br />
					UPDATE Schedule<br />
						<br />
						SET CompletedDate = GETDATE(),<br />
							CompletedOrderMainStatus = ( CASE [Convert].IsOrderCompleted(/* The error is here */SELECT TOP 1 inserted.OrderNumber FROM inserted) WHEN 0 THEN 3 ELSE 5 END )<br />
END<br />
END<br />


Please help someone.
I need this bad.

nick

I'm not an expert yet, but I play one at work. Yeah and here too.
GeneralRe: Help with sql trigger Pin
Jason McBurney21-Aug-03 4:54
Jason McBurney21-Aug-03 4:54 
GeneralRe: Help with sql trigger Pin
Ista21-Aug-03 4:56
Ista21-Aug-03 4:56 
GeneralRe: Help with sql trigger Pin
Mike Dimmick22-Aug-03 4:04
Mike Dimmick22-Aug-03 4:04 
GeneralRe: Help with sql trigger Pin
Ista22-Aug-03 4:11
Ista22-Aug-03 4:11 
QuestionHELP!!! why it's so hard to insert a row to Database by ADO.NET? Pin
yyf19-Aug-03 9:20
yyf19-Aug-03 9:20 
AnswerRe: HELP!!! why it's so hard to insert a row to Database by ADO.NET? Pin
yyf19-Aug-03 10:25
yyf19-Aug-03 10:25 
GeneralRe: HELP!!! why it's so hard to insert a row to Database by ADO.NET? Pin
Tom Archer25-Aug-03 15:42
Tom Archer25-Aug-03 15:42 
Generalhelp with common ASP/SQL speed issues Pin
kaht19-Aug-03 7:20
kaht19-Aug-03 7:20 
GeneralRe: help with common ASP/SQL speed issues Pin
Jason McBurney21-Aug-03 4:57
Jason McBurney21-Aug-03 4:57 
GeneralRe: help with common ASP/SQL speed issues Pin
Mike Dimmick22-Aug-03 5:04
Mike Dimmick22-Aug-03 5:04 
GeneralRe: help with common ASP/SQL speed issues Pin
kaht25-Aug-03 3:03
kaht25-Aug-03 3:03 
GeneralJet OLEDB:Format Pin
Anthony988719-Aug-03 5:52
Anthony988719-Aug-03 5:52 
QuestionHow to make smaller ACCESS initial file ? Pin
vgrigor19-Aug-03 4:15
vgrigor19-Aug-03 4:15 
GeneralTransactions with Access Pin
Jerome Conus19-Aug-03 2:43
Jerome Conus19-Aug-03 2:43 
GeneralRe: Transactions with Access Pin
RichardGrimmer19-Aug-03 5:21
RichardGrimmer19-Aug-03 5:21 
GeneralRe: Transactions with Access Pin
Steve S19-Aug-03 22:15
Steve S19-Aug-03 22:15 
GeneralMacro to update data from excel file Pin
PrasadD18-Aug-03 14:07
PrasadD18-Aug-03 14:07 

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.