Showing posts with label null. Show all posts
Showing posts with label null. Show all posts

Friday, March 23, 2012

Is it possible to display field B if field A is null and vice versa.

Hi all,
I'm new with Crystal Report. Just to ask is it possible for me to display field B if field A is null? And to display field A if field B is null. This is because, in one record, either field A or field B will have the value. Any idea?
Thanx in advance..;)Yes u can

write a formula

if isnull(fieldA) then
fieldB
else if isnull(FieldB) then
fieldA

hope it helps|||or

IIF(Isnull(fieldA),fieldB,fieldA)

Monday, March 19, 2012

Is it possible to "disable" all restrictions on a Ms sql DB?

In meen. primary keys, NOT NULL, IDENTETIES...et.c

I have to do a maunally, one time, building of a database. Sometables has to
stay an some are to be exchanged. The foreignkey inforcemnt ill do for my
self so everything is correct. I just need to be allowed to de thede task
for a while. Is it impossible?

Regards
Anders"Flare" <dct_flare@.hotmail.com> wrote in message news:<3f302ad3$0$24659$edfadb0f@.dread14.news.tele.dk>...
> In meen. primary keys, NOT NULL, IDENTETIES...et.c
> I have to do a maunally, one time, building of a database. Sometables has to
> stay an some are to be exchanged. The foreignkey inforcemnt ill do for my
> self so everything is correct. I just need to be allowed to de thede task
> for a while. Is it impossible?
> Regards
> Anders

You can disable foreign keys, check constraints and triggers with
ALTER TABLE. But you can't disable primary keys, NULL/NOT NULL is
(usually) part of the column definition, and IDENTITY is a column
property, so they can't be enabled/disabled in the same way.

It's not entirely clear from your comments what problems you're having
with the import, so if you can be more specific then perhaps someone
can help.

Simon

Friday, February 24, 2012

Is DEFAULT a constraint?

Hi,

I see the following in Books Online: CONSTRAINT--Is an optional keyword
indicating the beginning of a PRIMARY KEY, NOT NULL, UNIQUE, FOREIGN
KEY, or CHECK constraint definition...

But I have a table column defined as follows:

[MONTH] [decimal] (2, 0) NOT NULL CONSTRAINT
[DF__TBLNAME__MONTH__216361A7] DEFAULT (0)

My question: Is "DEFAULT" a constraint, or is it called something else?

Thanks,
EricEric Bragas (ericbragas@.yahoo.com) writes:

Quote:

Originally Posted by

I see the following in Books Online: CONSTRAINT--Is an optional keyword
indicating the beginning of a PRIMARY KEY, NOT NULL, UNIQUE, FOREIGN
KEY, or CHECK constraint definition...
>
But I have a table column defined as follows:
>
[MONTH] [decimal] (2, 0) NOT NULL CONSTRAINT
[DF__TBLNAME__MONTH__216361A7] DEFAULT (0)
>
My question: Is "DEFAULT" a constraint, or is it called something else?


There are actually two sorts of defaults: bound defaults and default
constraints. Bound defaults are deprecated, but are useful when you
bind them to types.

What you have above, is indeed a default constraints.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thank you for the clarification.