Saturday, February 25, 2012

"Name" Data Type?

Standard apologies for the extreme "newbie" nature of this question...
I've just seen a batch of sample code with the following declaration:
DECLARE @.MyVar Name
"@.MyVar", in this case, is there to receive some string data from an OPENXML
operation. The contents of the variable are subsequently used to feed other
functions that take varchar's as arguments. This works successfully.
The problem is, I've never heard of a "Name" before -- I can't CAST it to
anything useful, nor can I successfully concatenate it with a "+" operator to
other string data. I don't believe it is actually a data type, but I'm afraid
I don't know what it is, and because of what it's called it's darned hard to
look up in BOL!
Any insight would be greatly appreciated. Thanks!Dan,
A user-defined data type?
Try:
EXEC sp_datatype_info
GO
--and
EXEC sp_help
GO
HTH
Jerry
"Dan Costello" <DanCostello@.discussions.microsoft.com> wrote in message
news:C4A7366D-A8D9-4AE7-90D5-AF1E9CEDC847@.microsoft.com...
> Standard apologies for the extreme "newbie" nature of this question...
> I've just seen a batch of sample code with the following declaration:
> DECLARE @.MyVar Name
> "@.MyVar", in this case, is there to receive some string data from an
> OPENXML
> operation. The contents of the variable are subsequently used to feed
> other
> functions that take varchar's as arguments. This works successfully.
> The problem is, I've never heard of a "Name" before -- I can't CAST it to
> anything useful, nor can I successfully concatenate it with a "+" operator
> to
> other string data. I don't believe it is actually a data type, but I'm
> afraid
> I don't know what it is, and because of what it's called it's darned hard
> to
> look up in BOL!
> Any insight would be greatly appreciated. Thanks!|||Jerry,
Well, now I feel really stupid! Thanks, that's got it. For the sake of
completeness, the sample code uses the "AdventureWorks" sample database,
which does in fact have a user-defined type called "Name" already in it.
--Dan
"Jerry Spivey" wrote:
> Dan,
> A user-defined data type?
> Try:
> EXEC sp_datatype_info
> GO
> --and
> EXEC sp_help
> GO
> HTH
> Jerry
> "Dan Costello" <DanCostello@.discussions.microsoft.com> wrote in message
> news:C4A7366D-A8D9-4AE7-90D5-AF1E9CEDC847@.microsoft.com...
> > Standard apologies for the extreme "newbie" nature of this question...
> >
> > I've just seen a batch of sample code with the following declaration:
> >
> > DECLARE @.MyVar Name
> >
> > "@.MyVar", in this case, is there to receive some string data from an
> > OPENXML
> > operation. The contents of the variable are subsequently used to feed
> > other
> > functions that take varchar's as arguments. This works successfully.
> >
> > The problem is, I've never heard of a "Name" before -- I can't CAST it to
> > anything useful, nor can I successfully concatenate it with a "+" operator
> > to
> > other string data. I don't believe it is actually a data type, but I'm
> > afraid
> > I don't know what it is, and because of what it's called it's darned hard
> > to
> > look up in BOL!
> >
> > Any insight would be greatly appreciated. Thanks!
>
>

No comments:

Post a Comment