Click here to Skip to main content
16,012,316 members
Home / Discussions / Database
   

Database

 
GeneralRe: Adding a new row to a DataTable Pin
Stephen McGuire23-Aug-06 5:34
Stephen McGuire23-Aug-06 5:34 
GeneralRe: Adding a new row to a DataTable Pin
dptalt23-Aug-06 16:48
dptalt23-Aug-06 16:48 
QuestionAddnew not working inside a Class Library Pin
Charleboy21-Aug-06 5:53
Charleboy21-Aug-06 5:53 
AnswerRe: Addnew not working inside a Class Library Pin
Colin Angus Mackay21-Aug-06 9:01
Colin Angus Mackay21-Aug-06 9:01 
GeneralRe: Addnew not working inside a Class Library Pin
Charleboy21-Aug-06 14:03
Charleboy21-Aug-06 14:03 
GeneralRe: Addnew not working inside a Class Library Pin
Charleboy22-Aug-06 1:40
Charleboy22-Aug-06 1:40 
AnswerRe: Addnew not working inside a Class Library Pin
Keith Malwitz21-Aug-06 17:51
Keith Malwitz21-Aug-06 17:51 
QuestionAbout Begin and commit transaction in SQL Server 2000 Pin
selvaraj S.Kaliyappan20-Aug-06 23:07
selvaraj S.Kaliyappan20-Aug-06 23:07 
Hi friends. This is selvaraj.K. My requirement is When i updated data in Master table(Parent) and at the same time i inserted data in detail table(Child table).Some time the data updated in Master table but not inserted in detail table,that time we suffer a lot(So i need when the data not inserted in detail table, the master table data will be deleted automatically(i mean rollback the task).I hope u have catch my point.I have given below my stored procedure.Please find out and give assistance to me As soon as possible.


My stored procedure is
----------------------
CREATE PROCEDURE spCallerUpdation (@strHdrID VARCHAR(30),@strClaimID VARCHAR(50),@strUser VARCHAR(30),@strCode varchar(30),@strComments varchar(2000),@FollowupDate varchar(30))
AS
BEGIN
--IF @strDtlID = ''
BEGIN ----- Generate DETAIL ID
--PRINT @strDtlID
DECLARE @strDtlID VARCHAR(30)
DECLARE @maxid VARCHAR(30)
SET @maxid = CONVERT(BIGINT,(SELECT MAX(SUBSTRING(MCD_DtlID, 4 ,LEN(MCD_DtlID)-3)) FROM MARMS_Claim_DTL WHERE MCD_DtlID LIKE '%C%' AND SUBSTRING(MCD_DtlID,2,2)=RIGHT(DATEPART(YEAR,GETDATE()),2)))
--PRINT @maxid
IF @maxid IS NULL
SET @strDtlID = 'C' + RIGHT(DATEPART(YEAR,GETDATE()),2) + '0000000000001'
ELSE
BEGIN
SET @maxID = @maxID + 1
SET @strDtlID = 'C' + RIGHT(DATEPART(YEAR,GETDATE()),2) + STUFF('0000000000000',13-LEN(@maxid)+1,LEN(@maxid),@maxid)
END

DECLARE @SeqNo INT
SELECT @SeqNo = MAX(MCD_SeqNo) FROM MARMS_Claim_Dtl WHERE MCD_ClaimID = @strClaimID
IF @SeqNo IS NULL
BEGIN
SET @SeqNo = 1
END
ELSE
BEGIN
SET @SeqNo = @SeqNo + 1
END
IF @FollowupDate = ''
BEGIN
SET @FollowupDate = NULL
END

UPDATE MARMS_Claim_Hdr SET MCH_User = @strUser, MCH_LastUpdateDate = GETDATE(), MCH_SeqID = @SeqNo,
MCH_Comments = @strComments,MCH_StatusCodeID = @strCode,MCH_FollowupDate=@FollowupDate
WHERE MCH_ClaimID = @strClaimID

INSERT INTO MARMS_Claim_Dtl(MCD_DtlID, MCD_MCH_HdrID, MCD_ClaimID, MCD_Date,
MCD_User, MCD_SeqNo, MCD_Status_Code, MCD_Comments, MCD_Caller,MCD_FUDATE)
VALUES(@strDtlID, @strHdrID, @strClaimID, GETDATE(), @strUser, @SeqNo, @strCode, @strComments, @strUser,@FollowupDate)
END
END
AnswerRe: About Begin and commit transaction in SQL Server 2000 Pin
Colin Angus Mackay20-Aug-06 23:41
Colin Angus Mackay20-Aug-06 23:41 
GeneralRe: About Begin and commit transaction in SQL Server 2000 Pin
selvaraj S.Kaliyappan21-Aug-06 0:53
selvaraj S.Kaliyappan21-Aug-06 0:53 
QuestionTip about Queries ? Pin
faviochilo20-Aug-06 16:07
faviochilo20-Aug-06 16:07 
AnswerRe: Tip about Queries ? Pin
Eric Dahlvang21-Aug-06 7:59
Eric Dahlvang21-Aug-06 7:59 
GeneralRe: Tip about Queries ? Pin
i.j.russell22-Aug-06 2:58
i.j.russell22-Aug-06 2:58 
QuestionOnline articles on Data warehousing Pin
WillemM20-Aug-06 8:44
WillemM20-Aug-06 8:44 
QuestionSqlDateTime overflow Pin
Paddy Boyd20-Aug-06 0:44
Paddy Boyd20-Aug-06 0:44 
Questionstore picture as binary Pin
Mohammed Elkholy19-Aug-06 7:44
Mohammed Elkholy19-Aug-06 7:44 
AnswerRe: store picture as binary [modified] Pin
Colin Angus Mackay19-Aug-06 8:06
Colin Angus Mackay19-Aug-06 8:06 
GeneralRe: store picture as binary Pin
Jerry Hammond19-Aug-06 18:44
Jerry Hammond19-Aug-06 18:44 
QuestionHow to quickly write a datatable into sql server? Pin
steven_wong19-Aug-06 4:21
steven_wong19-Aug-06 4:21 
AnswerRe: How to quickly write a datatable into sql server? Pin
steven_wong19-Aug-06 4:42
steven_wong19-Aug-06 4:42 
QuestionCreate DB and Tables Script Pin
japel19-Aug-06 1:16
japel19-Aug-06 1:16 
AnswerRe: Create DB and Tables Script Pin
Rob Graham19-Aug-06 3:04
Rob Graham19-Aug-06 3:04 
QuestionAdding new rows to a BindingSource? Pin
monrobot1318-Aug-06 19:59
monrobot1318-Aug-06 19:59 
AnswerRe: Adding new rows to a BindingSource? Pin
Keith Malwitz19-Aug-06 16:18
Keith Malwitz19-Aug-06 16:18 
GeneralRe: Adding new rows to a BindingSource? Pin
monrobot1330-Aug-06 10:23
monrobot1330-Aug-06 10:23 

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.