Viewing 9 posts - 16 through 24 (of 24 total)
Hi there Hussain,
Try something like this
-- Generate testdata
DECLARE @T TABLE (id int, title4 varchar(20), value varchar(50))
INSERT @T (id, title4, value)
VALUES(63, 'Name', 'XYZ')
INSERT @T (id, title4, value)
VALUES(63, 'RollNo', '1011190')
INSERT @T (id,...
October 31, 2010 at 3:50 pm
It would only store the "last" deleted record and ignore the others. I followed the example from the beginning stating that one record at at time would be deleted from...
October 31, 2010 at 3:11 pm
Trigger would look something like this, I omitted the datetime fields since I don't know how you'd want them presented
CREATE TRIGGER Employee_CaptureDelation
ON Employee
AFTER DELETE
AS
DECLARE @DeletedRecord VARCHAR(4000)
SELECT @DeletedRecord = 'ID,' +...
October 31, 2010 at 2:59 pm
Sorry, just realized spaces occured in the first table
UPDATE B
SET B.L_ID = A.ID
FROM TableB B
INNER JOIN TableA A
ON REPLACE(A.Snumber, ' ', '') = REPLACE(B.Snumber, ' ', '')
AND A.add =...
October 31, 2010 at 2:02 pm
If the problem is with the spaces, and addresses are actually matching, the following should work
UPDATE B
SET B.L_ID = A.ID
FROM TableB B
INNER JOIN TableA A
ON A.Snumber = REPLACE(B.Snumber, '...
October 31, 2010 at 1:30 pm
Hi,
For this purpose you'd be better off implementing a trigger that fires on the deleted event of the table. Within the trigger you could forward the information you'd like to...
October 31, 2010 at 1:12 pm
Hi there,
Syntax is as below:
I don't really understand on what criteria you would like to link the data together though?
UPDATE B
SET B.L_ID = A.ID
FROM TableB B
INNER JOIN TableA...
October 31, 2010 at 10:42 am
Hi Scott and welcome back 😉
Basically, what you're trying to do through your query is returning all employees having the same gender as a name of a department.
INNER JOINING two...
October 31, 2010 at 6:03 am
Hi there,
You can join columns from different tables no matter if they are defined or "linked" to each other as keys or not. Moreover, the tables do not have to...
October 29, 2010 at 3:38 pm
Viewing 9 posts - 16 through 24 (of 24 total)