Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sp_procedure_params - IS_NULLABLE always return 1

Author  Topic 

konradr
Starting Member

1 Post

Posted - 2012-01-27 : 03:53:02
Hi!
I have a problem with IS_NULLABLE value.
exec sp_procedure_params_rowset StoredProcedureName;

and for "IS_NULLABLE" param exec command always return "1"
procedure looks like that:

...
ALTER PROCEDURE [dbo].[StoredProcedureName]
@FK_field int ,
@field2 int,
@field3 varchar(100),
@field4 varchar(100) = null,
...

@field2 and @field3 can't be null but in IS_NULLABLE value = 1
I would be grateful for any help.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-27 : 04:09:34
As far as I know all params to a stored procedure are nullable and there is no syntax to make them not nullable.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-27 : 08:35:53
quote:
Originally posted by konradr

Hi!
I have a problem with IS_NULLABLE value.
exec sp_procedure_params_rowset StoredProcedureName;

and for "IS_NULLABLE" param exec command always return "1"
procedure looks like that:

...
ALTER PROCEDURE [dbo].[StoredProcedureName]
@FK_field int ,
@field2 int,
@field3 varchar(100),
@field4 varchar(100) = null,
...

@field2 and @field3 can't be null but in IS_NULLABLE value = 1
I would be grateful for any help.




you've to impose that check inside proc if you want to implement it and assign a default value in code.
Other way is to assign it a default value in definition and ignore it in EXEC so that it assumes the default value automatically

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -