Click here to Skip to main content
15,896,726 members
Home / Discussions / Database
   

Database

 
Questionms access Pin
hrishiS25-Feb-09 0:34
hrishiS25-Feb-09 0:34 
AnswerRe: ms access Pin
Wendelius25-Feb-09 1:13
mentorWendelius25-Feb-09 1:13 
GeneralRe: ms access Pin
hrishiS25-Feb-09 2:10
hrishiS25-Feb-09 2:10 
GeneralRe: ms access Pin
Wendelius25-Feb-09 5:05
mentorWendelius25-Feb-09 5:05 
GeneralRe: ms access Pin
hrishiS25-Feb-09 20:10
hrishiS25-Feb-09 20:10 
QuestionCovert Data in .DBF files to MS Sql Pin
pavanip24-Feb-09 22:23
pavanip24-Feb-09 22:23 
AnswerRe: Covert Data in .DBF files to MS Sql Pin
Wendelius25-Feb-09 1:19
mentorWendelius25-Feb-09 1:19 
Questioncan't crate trigger in stored procedure Pin
papy-boom24-Feb-09 22:22
papy-boom24-Feb-09 22:22 
hi all,
i want to create a trigger on table through a stored procedure but i got error in excuting the script
it say syntax problem near word TRIGGER

CREATE PROCEDURE CreateMyTrigger
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

CREATE TRIGGER [dbo].[InsertQuestionTrigger]
ON [dbo].[Question]
FOR INSERT AS
UPDATE child
-- set the depth of this "child" to be the
-- depth of the parent, plus one.
SET depth = ISNULL(parent.depth + 1,0),
-- the lineage is simply the lineage of the parent,
-- plus the child's ID (and appropriate '/' characters
lineage = ISNULL(parent.lineage,'/') + LTrim(Str(child.QuestionId)) + '/'
-- we can't update the "inserted" table directly,
-- so we find the corresponding child in the
-- "real" table
FROM Question child INNER JOIN inserted i ON i.QuestionId=child.QuestionId
-- now, we attempt to find the parent of this
-- "child" - but it might not exist, so these
-- values may well be NULL
LEFT OUTER JOIN Question parent ON child.IdParent=parent.QuestionId
END
GO
Any Idea and how can create trigger using function or stored procedure.
Thank you in advance!
AnswerRe: can't crate trigger in stored procedure Pin
Wendelius24-Feb-09 22:44
mentorWendelius24-Feb-09 22:44 
GeneralRe: can't crate trigger in stored procedure Pin
Riaan Booyzen24-Feb-09 23:57
Riaan Booyzen24-Feb-09 23:57 
QuestionHow to Select the Next 20 records in SQL server? Pin
star_platinum24-Feb-09 19:25
star_platinum24-Feb-09 19:25 
AnswerRe: How to Select the Next 20 records in SQL server? Pin
Wendelius24-Feb-09 19:30
mentorWendelius24-Feb-09 19:30 
GeneralRe: How to Select the Next 20 records in SQL server? Pin
star_platinum24-Feb-09 22:19
star_platinum24-Feb-09 22:19 
GeneralRe: How to Select the Next 20 records in SQL server? Pin
Wendelius25-Feb-09 0:01
mentorWendelius25-Feb-09 0:01 
AnswerRe: How to Select the Next 20 records in SQL server? Pin
Riaan Booyzen24-Feb-09 23:55
Riaan Booyzen24-Feb-09 23:55 
QuestionSP Optimization Pin
Guvera24-Feb-09 19:20
Guvera24-Feb-09 19:20 
AnswerRe: SP Optimization Pin
Wendelius24-Feb-09 19:34
mentorWendelius24-Feb-09 19:34 
GeneralRe: SP Optimization Pin
Guvera24-Feb-09 19:38
Guvera24-Feb-09 19:38 
QuestionMega Pole - What is Your Favorite Database? Pin
pinaldave24-Feb-09 19:18
pinaldave24-Feb-09 19:18 
AnswerRe: Mega Pole - What is Your Favorite Database? Pin
Colin Angus Mackay25-Feb-09 14:19
Colin Angus Mackay25-Feb-09 14:19 
GeneralRe: Mega Pole - What is Your Favorite Database? Pin
pinaldave25-Feb-09 14:31
pinaldave25-Feb-09 14:31 
GeneralRe: Mega Pole - What is Your Favorite Database? Pin
Colin Angus Mackay25-Feb-09 21:19
Colin Angus Mackay25-Feb-09 21:19 
QuestionRaising events in stored procedure Pin
Guvera24-Feb-09 19:04
Guvera24-Feb-09 19:04 
AnswerRe: Raising events in stored procedure Pin
Wendelius24-Feb-09 19:26
mentorWendelius24-Feb-09 19:26 
GeneralRe: Raising events in stored procedure Pin
Guvera24-Feb-09 19:40
Guvera24-Feb-09 19:40 

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.