顯示具有 IT Database 標籤的文章。 顯示所有文章
顯示具有 IT Database 標籤的文章。 顯示所有文章

7/24/2016

將資料以Unicode 方式存入SQL Server資料庫


作法是在字串前方加上N的字元。
  •  Insert
  • Insert into material_code ( code, name ) values ( 'A0001', N'塑膠' )

  • Update 
  • Update material_code set name = ( N'木材' ) where code = 'A0001'
     
參考資料 https://msdn.microsoft.com/en-us/library/ms177523.aspx

6/25/2012

允許修改已經使用的SQL 2008 Tabel 的方法

Microsoft SQL Server Management Studio預設狀況下要修改已經建置好的Table時,會發生如下的錯誤訊息。









這時的解決辦法是到 Tools / Options / Designers / Table and Database Designers 項目,將Prevent Saving changes that require table re-reation 的功能關閉。



這時執行儲存修改動作,會出現下面警告畫面。但是請注意,可能會發生資料遺失問題,所以最好是要事先作好備份工作。