?
Solved

SQL Server CLR Help

Posted on 2012-08-29
4
Medium Priority
?
507 Views
Last Modified: 2012-08-31
I appreciate that once an assembly is registered that you can so something like

EXEC ClrSpEmployeeByShift @shiftID=1

Where shiftID is an expected parameter but what if I want to use a class as an object ie set numerous properties then call a function or sub
0
Comment
Question by:rocky050371
  • 2
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38345865
I think to be able to exchange objects as parameters, you need to declare that as a user defined data type in SQL Server and then you can use it.

http://www.codeproject.com/Articles/38693/Working-with-CLR-Objects-in-SQL-Server-2005-or-Abo#heading0002
0
 

Author Comment

by:rocky050371
ID: 38345885
Essentially it could be n number of name value pairs, then once they have all been passed I want to call a function based on the collection of values
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 38346075
You can then probably exchange a datatable.

Following example is from .NET to SQL but other way round should be similar

http://www.codeproject.com/Tips/214492/Passing-a-datatable-to-a-stored-procedure-in-Sql-S
0
 

Author Comment

by:rocky050371
ID: 38346115
In OLE you can simply create an use an object, I wonder if a paramarray is possible?
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

850 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