czchlong
czchlong

Reputation: 2584

How to purposely return a NULL from TSQL query

Is there a method to purposely return NULL from a TSQL query?

Upvotes: 0

Views: 129

Answers (2)

aF.
aF.

Reputation: 66697

The simplest way is to select it:

select NULL

Upvotes: 1

GilM
GilM

Reputation: 3771

I don't use Sybase, but you should be able to do something like:

SELECT CAST(NULL as int) AS NULLint --specify the appropriate datatype

Upvotes: 1

Related Questions