Solved

User defined datatype

Posted on 2014-11-21
4
148 Views
Last Modified: 2014-11-23
Hi

I have a pre existing code in an stored pro that receives multi valued  parameter from SSRS 2008.

Declare @tbl_x table(typename nvarchar(100))
While len(@rpt_parameter) >0
Begin
Insert into @tbl_x
.....
)

I'm not familiar with user defined data types and need to do same thing for a parameter of type unique identifier.
Are the variables ( in the example above: typename) defined here in the code? Do I need to do the same for unique identifier data type?
Thanks
0
Comment
Question by:shmz
4 Comments
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 40458052
that looks a column name to me...

a table var names @tbl_x which has one column named "typename" with nvarchar(100) datatype

above code, creates a (temporary) table with one column and dumps all parameters into it, so maybe it will use it in some queries/views etc...
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40458293
Declare @tbl_x table(typename uniqueidentifier primary key) --might as well be pk, unless you need to insert dup values to this table??

 While len(@rpt_parameter) >0
 Begin
 Insert into @tbl_x
 .....
 )
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40460268
There are no user-defined data types in the code fragment you provided. Perhaps you would like to provide the full SProc (or at least the part that gets data into the table variable (@tbl_x)) for us to see ? Otherwise what HainKurt says.

Mike
0
 

Author Closing Comment

by:shmz
ID: 40460896
thanks
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question