Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
CLR Integration and Programming.
»
sql assemblies in .net
sql assemblies in .net
Rate Topic
Display Mode
Topic Options
Author
Message
bhakti-sonu
bhakti-sonu
Posted Thursday, June 26, 2008 4:17 AM
Valued Member
Group: General Forum Members
Last Login: Friday, March 12, 2010 3:15 AM
Points: 66,
Visits: 78
i have created an assembly in sql server. written stored procedures ,triggers and a function to it now tell me how can I use this assembly in VB.net to view the records or results.
I tried it by using the same method as we follow for private assembly but it gives
---------------------------------
Imports SqlServerProject2
Dim o As StoredProcedures
StoredProcedures.PrintDate()
----------------------------------------
an error occurs :-"The requested operation requires a SqlClr context, which is only available when running in the Sql Server process."
how to resolve this?
Post #523988
Marios Philippopoulos
Marios Philippopoulos
Posted Thursday, June 26, 2008 10:26 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 7:10 AM
Points: 1,824,
Visits: 3,477
The purpose of a SQLCLR assembly is for it to be invoked from within SQL code.
You don't need to call it from .NET code.
What is your assembly doing?
__________________________________________________________________________________
Turbocharge Your Database Maintenance With Service Broker: Part 1
Real-Time Tracking of Tempdb Utilization Through Reporting Services
Monitoring Database Blocking Through SCOM 2007 Custom Rules and Alerts
Preparing for the Unthinkable - a Disaster/Recovery Implementation
Post #524377
RBarryYoung
RBarryYoung
Posted Thursday, June 26, 2008 7:49 PM
SSCrazy Eights
Group: General Forum Members
Last Login: Saturday, May 04, 2013 11:13 AM
Points: 9,855,
Visits: 9,374
Make a common library that you can call both from your SQLCLR wrapper and from VB.net.
-- RBarryYoung
,
(302)375-0451
blog:
MovingSQL.com
, Twitter:
@RBarryYoung
Proactive
Performance Solutions, Inc.
"Performance is our middle name."
Post #524689
bhakti-sonu
bhakti-sonu
Posted Thursday, June 26, 2008 11:07 PM
Valued Member
Group: General Forum Members
Last Login: Friday, March 12, 2010 3:15 AM
Points: 66,
Visits: 78
how to use this assembly in .net then
Post #524764
Jonathan Kehayias
Jonathan Kehayias
Posted Friday, June 27, 2008 8:17 PM
SSCommitted
Group: General Forum Members
Last Login: Sunday, May 12, 2013 4:26 PM
Points: 1,696,
Visits: 1,742
If you want to use the Logic from a CLR Stored Procedure outside of SQL Server, you need to code it for such a purpose. I generally abstract the logic portions that may be used outside of SQL Server into traditional methods and call out to those in SQL and in the application. The SqlPipe and SqlContext don't exist outside of SQL Server, so you have to code a test for them in your CLR code so that it functions properly if it is being run outside of SQL Server.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog
|
Twitter
|
MVP Profile
Training
|
Consulting
|
Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #525408
Marios Philippopoulos
Marios Philippopoulos
Posted Saturday, June 28, 2008 7:10 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 7:10 AM
Points: 1,824,
Visits: 3,477
For the purposes of this debate, what is the point of invoking SQLCLR code outside a SQL context?
I'm wondering if this is even necessary.
What are the possible scenarios for this? If the SQLCLR assembly is accessing environmental resources (O/S, registry, event logs etc.) why can't this be done from the .NET code without using the SQLCLR? If not, what is the assembly doing?
Pls everybody, humor me on this, am I missing something?
__________________________________________________________________________________
Turbocharge Your Database Maintenance With Service Broker: Part 1
Real-Time Tracking of Tempdb Utilization Through Reporting Services
Monitoring Database Blocking Through SCOM 2007 Custom Rules and Alerts
Preparing for the Unthinkable - a Disaster/Recovery Implementation
Post #525480
Jonathan Kehayias
Jonathan Kehayias
Posted Saturday, June 28, 2008 8:20 AM
SSCommitted
Group: General Forum Members
Last Login: Sunday, May 12, 2013 4:26 PM
Points: 1,696,
Visits: 1,742
More thn anything else, UDT's and UDF's are easily used out side of SQL. This is of great benefit for things like geocoding where the UDT is used as a typed object in the app as well. SQL 2008 implements the spatial datatypes in this manner. You can download the SDK online.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog
|
Twitter
|
MVP Profile
Training
|
Consulting
|
Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #525487
Marios Philippopoulos
Marios Philippopoulos
Posted Saturday, June 28, 2008 11:55 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 7:10 AM
Points: 1,824,
Visits: 3,477
Jonathan Kehayias (6/28/2008)
More thn anything else, UDT's and UDF's are easily used out side of SQL. This is of great benefit for things like geocoding where the UDT is used as a typed object in the app as well. SQL 2008 implements the spatial datatypes in this manner. You can download the SDK online.
Thank you, that I didn't know...
__________________________________________________________________________________
Turbocharge Your Database Maintenance With Service Broker: Part 1
Real-Time Tracking of Tempdb Utilization Through Reporting Services
Monitoring Database Blocking Through SCOM 2007 Custom Rules and Alerts
Preparing for the Unthinkable - a Disaster/Recovery Implementation
Post #525524
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.