2012-02-08 40 views

回答

0

假設你想要的MMS_Contact_IDContact_ID值,你可以做這樣的:

CREATE TRIGGER updcol BEFORE INSERT ON tablename 
    FOR EACH ROW BEGIN 
    SET NEW.MMS_Contact_ID = 'MMSC' + LPAD(convert(varchar, NEW.Contact_ID), 6, '0'); 
    END;