本文介绍了在数据库中存储默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为在相应字段中输入的每个空字符串在数据库表中存储一个默认值. 我的数据库表允许存储一个空值,因此对于要插入数据库中的每个条目,我想在表中存储一个默认值,以便以后在Crystal Report上没有空字段.
Storing a default value in database table for each empty string entered for corresponding field. My DB table allows a null value to be stored, so for each entry inserted in DB I want to store a default value in table so that later on crystal report dont have empty fields.
推荐答案设置数据库字段的默认值. 或者更好的是,您可以在Crystal Report字段上设置一个条件,以在其值显示为null时显示该默认值. Set the default value for your database field. Or better, you could set a condition on the crystal report fields to display this default value whenever their values are displayed as null.
阅读SQL中的默认约束服务器.它们仅用于这种情况.如果未指定,则输入特定值. 阅读:此处. [ ^ ] Read about Default Constraints in SQL Server. They are for scenario''s like this only. To enter certain value if not specified. Read: here.[^]
更多推荐
在数据库中存储默认值
发布评论