select * from news where type='zxcx' --查询最新车讯
select * from news where type='xwzx' --查询新闻资讯
select * from news where type='cgzb' --查询采购招标
select * from news where type='zcfg' --查询政策法规
select * from news where type='yszs' --查询运输学院
select * from news where type='sygj' --查询实用工具
select * from news where type='rdwz' --查询热点文章
select * from news where type='hydt' --查询行业动态
--在表re_company中查询
select * from re_company --查询运输黄页
--数据库HaoYun123中的news
-- tittle detail ispicture time type
--数据库ZGJT中的ZGJT_information
-- biaoti neirong img shijian type
--最新车讯
insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='zxcx'
update ZGJT_information set pid=21 where type='zxcx'--修改父ID
update ZGJT_information set img='' where type='zxcx'--修改图片
update ZGJT_information set fangshi='不限' where type='zxcx'--修改方式
select * from ZGJT_information
delete from ZGJT_information where type='zxcx'
--插入的是新闻
insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='xwzx'
update ZGJT_information set pid=2 where type='xwzx'--修改父ID
update ZGJT_information set img='images/newsimg/1.jpg' where type='xwzx'--修改图片
update ZGJT_information set fangshi='不限' where type='xwzx'--修改方式
select * from ZGJT_information
--delete from ZGJT_information where type='xwzx'
--热点文章
insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='rdwz'
update ZGJT_information set pid=10 where type='rdwz'--修改父ID
update ZGJT_information set img='images/newsimg/1.jpg' where type='rdwz'--修改图片
update ZGJT_information set fangshi='不限' where type='rdwz'--修改方式
select * from ZGJT_information
delete from ZGJT_information where type='rdwz'
--采购招标
insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='cgzb'
update ZGJT_information set pid=28 where type='cgzb'--修改父ID
update ZGJT_information set img='images/newsimg/1.jpg' where type='cgzb'--修改图片
update ZGJT_information set fangshi='不限' where type='cgzb'--修改方式
select * from ZGJT_information
delete from ZGJT_information where type='cgzb'
----政策法规
--insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
--select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='cgzb'
--
--update ZGJT_information set pid=28 where type='cgzb'--修改父ID
--
--update ZGJT_information set img='images/newsimg/1.jpg' where type='cgzb'--修改图片
--
--update ZGJT_information set fangshi='不限' where type='cgzb'--修改方式
--
--select * from ZGJT_information
--运输学院
insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='yszs'
update ZGJT_information set pid=13 where type='yszs'--修改父ID
update ZGJT_information set img='images/newsimg/1.jpg' where type='yszs'--修改图片
update ZGJT_information set fangshi='不限' where type='yszs'--修改方式
select * from ZGJT_information
delete from ZGJT_information where type='yszs'
----实用工具
--insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
--select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='sygj'
--
--update ZGJT_information set pid=13 where type='sygj'--修改父ID
--
--update ZGJT_information set img='images/newsimg/1.jpg' where type='sygj'--修改图片
--
--update ZGJT_information set fangshi='不限' where type='sygj'--修改方式
--
--select * from ZGJT_information
--行业动态
insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
select title, detail ,ispicture, time ,type from HaoYun123.dbo.news where type='hydt'
update ZGJT_information set pid=11 where type='hydt'--修改父ID
update ZGJT_information set img='images/newsimg/1.jpg' where type='hydt'--修改图片
update ZGJT_information set fangshi='不限' where type='hydt'--修改方式
select * from ZGJT_information
delete from ZGJT_information where type='hydt'
--运输黄页
--insert into ZGJT_information(biaoti, neirong ,img, shijian ,type)
--select title, detail ,ispicture, time ,type from HaoYun123.re_company where type='hydt'
--
--update ZGJT_information set pid=11 where type='hydt'--修改父ID
--
--update ZGJT_information set img='images/newsimg/1.jpg' where type='hydt'--修改图片
--
--update ZGJT_information set fangshi='不限' where type='hydt'--修改方式
--
--select * from ZGJT_information
DUMP TRANSACTION ZGJT WITH NO_LOG
BACKUP LOG ZGJT WITH NO_LOG
DBCC SHRINKDATABASE(ZGJT)
select top(1)* from ZGJT_information order By ID desc
select top(1)* from news order By ID desc
select max(pid) from ZGJT_information group by pid