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 2005 Forums
 Transact-SQL (2005)
 custom data types in a stored procedure

Author  Topic 

chedderslam
Posting Yak Master

223 Posts

Posted - 2008-06-12 : 09:38:45
I am new to working with custom data types. I am trying to use one as an input parameter for a stored procedure, but I'm not sure what the syntax is.

I the design table view, the data type shows up as this:
DISPOSAL_AREA_NAME_TYPE:varchar(40)

What is the proper way to reference it in a stored procedure? Here is what I have, but it errors out:
CREATE PROCEDURE webservices_BENEFICIAL_USES_DM_SELECT
@DISPOSAL_AREA_NAME [DISPOSAL_AREA_NAME_TYPE:varchar(40)] = ""
AS
BEGIN

suresha_b
Yak Posting Veteran

82 Posts

Posted - 2008-06-12 : 09:42:16
CREATE PROCEDURE webservices_BENEFICIAL_USES_DM_SELECT
@DISPOSAL_AREA_NAME varchar(40) = ""
AS
BEGIN
Go to Top of Page

chedderslam
Posting Yak Master

223 Posts

Posted - 2008-06-12 : 09:44:04
Thanks for the response.

Does doing it the way you posted lose any of the benefits of custom datatypes, whatever they may be? I'm not sure what the purpose of defining a custom datatype is if you end up referencing it as a plain varchar. Thanks.
Go to Top of Page

suresha_b
Yak Posting Veteran

82 Posts

Posted - 2008-06-12 : 09:50:57
CREATE PROCEDURE webservices_BENEFICIAL_USES_DM_SELECT
@DISPOSAL_AREA_NAME DISPOSAL_AREA_NAME_TYPE = ""
AS
BEGINBEGIN

Also works.
Go to Top of Page

chedderslam
Posting Yak Master

223 Posts

Posted - 2008-06-12 : 09:51:54
That's what I was looking for. Thanks.
Go to Top of Page
   

- Advertisement -