如何将记录更新到数据库 [英] how to update record to database
本文介绍了如何将记录更新到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所有亲爱的如何将记录更新到数据库.
我有我没有大的数据库.行
我想添加列,并且想更新某些条件下所有空行记录的添加方式...
不.行数是1800.
在此先感谢
dear all how to update record to database.
i have database in which i have large no. of row
i want to add column and i want to update all empty rows record for some condition how to add it...
no. of row is 1800.
thank in advance
推荐答案
尝试以下SQL添加具有默认值的新列:
Try the following SQL to add a new column with a default value:
ALTER TABLE TestTable
ADD NewCol INT NOT NULL DEFAULT(0)
GO
此后,如果需要,您可以针对您的特定条件对表进行UPDATE查询,仅更新此新列,例如:
After this, if needed, you can fire an UPDATE query for the table with your specific condition, updating this new column only, like:
UPDATE TestTable
SET NewCol = Some_Value
WHERE ID=2
--some condition
您可以使用T-SQL命令:
ALTER TABLE [更新 [
You can use T-SQL commands:
ALTER TABLE[^]
UPDATE[^]
这篇关于如何将记录更新到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文