MSSQL 用不同資料庫的資料表
今天想在同一個MSSQL SERVER 下用不同資料庫的資料表新增記錄時,一直不能成功,後來找了MSSQL SERVER 線上說明才完成,SQL 語法如下:
INSERT INTO HSDB.dbo.BSTD_SEME
SELECT * FROM HSDB_BAK.dbo.BSTD_SEME c
WHERE c.STDNO = '6350147'
如紅色字部份,原來資料庫名後還要加 dbo 才可以加資料表名 也就是 資料庫名.dbo.資料表名
其實主要是 HSDB 資料庫,而 HSDB_BAK 是10天前資料的資料庫,因為誤刪了 HSDB 下 BSTD_SEME 下某位學生的記錄,追查結果發現十天前的備份檔有這些記錄,所以用備份檔產生了 HSDB_BAK 的資料庫,再將資料表中學生誤刪的記錄增加進原來的資料庫內,這樣就不會影響到其它的記錄
迴響
我只是愛你的有趣博客
我想說,你真的幫助我理解的主題 MSSQL ?????????? | ??
MSSQL 用不同資料庫的資料表 | 豬窩
What's Taking place i am new to this, I stumbled upon this I have discovered It absolutely helpful and
it has helped me out loads. I hope to give a contribution & aid other users like
its helped me. Good job.
MSSQL 用不同資料庫的資料表 | 豬窩
Hello there! I know this is kinda off topic but I'd figured I'd ask.
Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?
My blog goes over a lot of the same topics as yours and I feel we could
greatly benefit from each other. If you're interested feel free to
shoot me an e-mail. I look forward to hearing from you!
Terrific blog by the way!
MSSQL 用不同資料庫的資料表 | 豬窩
WOW just what I was searching for. Came here by searching for web hosting reviews