Triggers with data converstion
-
Hi can anybody give solution for my req i had a mastertable and i need to copy generated recordsd to my child table my code follows in this way: CREATE TRIGGER trigInsertion on GlobalScan AFTER insert as INSERT into GlobalScanNew SELECT * FROM inserted end but here in my mastertable coloums data type is different from child table now i need to convert this and place it in my new table plz can anybody give solution for this Regards padma padma
-
Hi can anybody give solution for my req i had a mastertable and i need to copy generated recordsd to my child table my code follows in this way: CREATE TRIGGER trigInsertion on GlobalScan AFTER insert as INSERT into GlobalScanNew SELECT * FROM inserted end but here in my mastertable coloums data type is different from child table now i need to convert this and place it in my new table plz can anybody give solution for this Regards padma padma
hi you can use convert() function for converting data type and insert it in to the child Table. eg: INSERT INTO CHILD SELECT CONVERT(VARCHAR,FIELD1) FROM INSERTED Regards Joe
-
hi you can use convert() function for converting data type and insert it in to the child Table. eg: INSERT INTO CHILD SELECT CONVERT(VARCHAR,FIELD1) FROM INSERTED Regards Joe
thanks for reply but in my master table i had 10 coloums and in that i need to check three coloums so how can i do it padma padma
-
thanks for reply but in my master table i had 10 coloums and in that i need to check three coloums so how can i do it padma padma
hi if you needs only 3 columns specify that columns in your select qry eg: INSERT INTO CHILDTABLE SELECT CONVERT(FIELD1),CONVERT(FIELD2),FIELD3 FROM INSERTED Regards Joe
-
hi if you needs only 3 columns specify that columns in your select qry eg: INSERT INTO CHILDTABLE SELECT CONVERT(FIELD1),CONVERT(FIELD2),FIELD3 FROM INSERTED Regards Joe
thank you