新聞中心
以下的文章主要介紹的是MySQL select into 與 SQLServer select into,我們大家都知道MySQL數(shù)據(jù)庫是對Select Into 語句的直接備份表的結(jié)構(gòu)與相關(guān)實際應(yīng)用數(shù)據(jù)是不支持的,由于工作中的需要在網(wǎng)上找到一種方法可以代替, 也有其它方法可以處理,總結(jié)如下:

讓客戶滿意是我們工作的目標,不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:空間域名、虛擬主機、營銷軟件、網(wǎng)站建設(shè)、沙市網(wǎng)站維護、網(wǎng)站推廣。
方法1:
MYSQL不支持:
- Select * Into new_table_name from old_table_name
替代方法:
- Create table new_table_name (Select * from old_table_name);
方法2:
1.先備份表結(jié)構(gòu)和數(shù)據(jù)
導(dǎo)出命令 -u用戶名 -p密碼 -h主機IP地址 數(shù)據(jù)庫名 表名1 > 導(dǎo)出文件.sql
- mysqldump -uroot -proot -h192.168.0.88 ok_db oktable2 > ok_db.sql
2.修改備份表的名字
3.登錄MySQL
4.選擇數(shù)據(jù)庫
5.執(zhí)行: Source 備份表的路徑 如:Source d:\ok_db.sql 回車即可。
6.完成.
SQLServer支持 MySQL Select into語句
1.備份表直接執(zhí)行如下就可以了。
- Select * Into new_table_name from old_table_name;
MySQL Select into outfile用于導(dǎo)出指定的查詢數(shù)據(jù)到文件如下:
1.導(dǎo)出表中所有數(shù)據(jù)到C盤根目錄outfile.txt中如下:
- Select * into outfile 'c:\\outfile.txt' from test;
2.導(dǎo)出表中指定查詢條件2005-06-08號的數(shù)據(jù)到C盤根目錄outfile1.txt中如下:
- Select * into outfile 'c:\\outfile.txt' from test where beginDate='2008-06-08';
來源:百度
當前名稱:MySQL select into,SQLServer select into
當前地址:http://m.fisionsoft.com.cn/article/dhjhhip.html


咨詢
建站咨詢
