During the Kaihuang and Renshou periods of the Sui Dynasty, Wang Shao wrote an 80-volume "Book of Sui," which was organized by category and divided into chapters. However, it did not follow the common biographical format found in official histories (which lists events and biographies by time and person).
In the fifth year of the Wude period of the Tang Dynasty, Palace Attendant Linghu Defen suggested compiling the "History of the Five Dynasties" (referring to the Liang, Chen, Qi, Zhou, and Sui dynasties). In December of that year, the emperor ordered the Minister of the Imperial Library, Feng Deyi, and Palace Attendant Yan Shigu to compile the "History of Sui." After several years of effort, the project remained unfinished.
In the third year of the Zhenguan period, the emperor again ordered the Secretary of State, Wei Zheng, to compile the "History of Sui," with Left Chancellor Fang Qiao responsible for supervision. Wei Zheng also proposed the establishment of a Secretariat within the Imperial Secretariat, where the former Minister of the Imperial Secretariat, Yan Shigu, Censor Kong Yingda, and Director of the Imperial Library Xu Jingzong would write the "History of Sui" together. Wei Zheng oversaw the overall editing, making many revisions to ensure simplicity and accuracy. Wei Zheng wrote the preface and all the commentary in the book. In the end, it was completed with five volumes of imperial biographies and fifty biographical sketches. On the Renzi day in the first month of the tenth year of Zhenguan, Wei Zheng and his team presented the book to the emperor.
In the fifteenth year of Zhenguan, the emperor again ordered Left Chancellor Yu Zhining, Imperial Historian Li Chunfeng, Director of the Imperial Library Wei Anren, and Assistant in the Imperial Office Li Yanshou to compile the "Records of the Five Dynasties," totaling thirty volumes across ten chapters. On the day of Jimao in the fifth month of the first year of Xianqing, Grand Commandant Sun Wuji and his team presented the book to the emperor, who ordered it to be kept in the imperial library. Later, this work was later included in the "Book of Sui," though it was kept separately and referred to as the "Records of the Five Dynasties."
(There are some inconsistencies here: Wei Zheng's biography states that he became an Imperial Attendant in the seventh year of the Zhenguan era, completed the "Records of the Five Dynasties" in the tenth year of Zhenguan, was granted the title Duke of Zhengguo, and was appointed as a Special Advisor upon his retirement. Many versions now refer to him as a Special Advisor. However, the "Catalog of Classics" only mentions him as an Imperial Attendant and the Duke of Zhengguo, as recorded by Wei Zheng. The biography of Changsun Wuji states that he was only appointed to supervise the editing in the third year of Yonghui, which raises doubts as to whether it had already been completed before, and Changsun Wuji just submitted the completed work. Currently, the biographical accounts are attributed to Wei Zheng, whereas the historical records credit Changsun Wuji, based on the majority of versions. Some biographical versions also state it was written by the Prince's Tutor Xu Jingzong. However, the biography of Xu Jingzong indicates that he became a clerk in the eighth year of Zhenguan, participated in the editing of national history, and was later promoted to the Imperial Secretariat. In the tenth year of Zhenguan, he was sent to Hongzhou as a military officer. It was not until the third year of Longshuo that he became the Prince's Tutor. This does not align with the dates and official titles recorded in the text, possibly altered by later generations. Fang Qiao and Yu Zhining were initially appointed to participate in the editing. The biography of Li Yanshou states that he was ordered to edit the "Records of the Five Dynasties" together with the Assistant Clerk Jing Bo. Li Yanshou was ordered in the third year of Zhenguan to edit the "Sui History" with Yan Shigu, but he resigned that year due to a family funeral. Many current versions omit the names of Fang Qiao and others. The "Treatise on Astronomy," "Treatise on Calendar," and "Treatise on the Five Elements" were all written by Li Chunfeng alone. The preface of the "Treatise on the Five Elements" is attributed to Chu Suiliang in many versions, but this is not mentioned in his biography, indicating that he probably only wrote a preface, so his name is not included here.)
In the second year of the Tian Sheng era of the Song Dynasty, on the 11th day of the 5th month, the Imperial Pharmacist Lan Yuan was instructed to deliver a copy of the "Sui History" from the palace to the Chongwen Institute. On the fifth day of the sixth month, the emperor ordered officials to proofread (at that time, officials Chen Shou and Chen Ye were responsible for supervision, and Right Imperial Historian Zhang Guan and others were responsible for proofreading. Zhang Guan later became the judge of the Ministry of Revenue and was subsequently replaced by Huang Jian), and then to publish it.