更新位列的正确语法是什么

时间:2015-12-18 09:57:40

标签: sql-server

更新/插入位列(在Microsoft SQL Server上)时,正确的语法是什么?

workspace_ts="/home/user/workspace";
for folder_name in `find $workspace_ts -mindepth 1 -maxdepth 1 -type d -mtime +30 -print`; do
  echo -e "\t- It seems that [$folder_name] wasn't modified during last 30 days";
done;

必须是其中之一,但哪一个是推荐的最佳做法?

CREATE TABLE USER_ACCOUNT
(
     USER_NAME VARCHAR(256) NOT NULL,
     IS_ENABLED BIT   
)

3 个答案:

答案 0 :(得分:2)

两者都可以工作:

Insert into user_account values ('ABC', 'False');
Insert into user_account values ('ABC', 0);

答案 1 :(得分:1)

Insert into user_account values ('ABC', False);

所有其他查询都可以。未用单引号括起的False无法转换为BIT

答案 2 :(得分:0)

要更新列

更新transaction_stoppage设置is_deleted = 0,其中is_deleted为空