我在我的SQL Server數據庫中有一個現有的列。我試過了我能想到的所有內容,但無法將默認值添加到列中。什麼適用於其他數據庫是如何將默認值添加到已存在的列中?
alter table mytable
alter column mycolumn set default(now()) --mycolumn is a datetime
如何在SQL Server中執行此操作?
我得到的,準確的語法錯誤是incorrect syntax near the keyword 'set'
添加了'爲'位爲你.. – Earlz 2010-06-17 00:18:34
@Earlz:看到,最欣賞:) – 2010-06-17 00:19:38
現在只需要再等3分鐘... – Earlz 2010-06-17 00:22:13