Showing posts with label requirement. Show all posts
Showing posts with label requirement. Show all posts

Monday, March 26, 2012

Making managed code calls inside SQL Server in context of the client

Dear all,

I am very new to the subject of writing CLR code inside SQL Server, so I apologise if my questions seem naive.

I have a requirement to populate an asp.net 2.0 GridView control with data columns, some of which are directly from a SQL Server 2005 database, but some of which are calculated by calling CLR methods passing the values from the database columns to those methods.

However, the methods I need to call only make sense in the process context of the client web site which is calling the stored procedure which I want to write to return the data columns.

In effect, I want to be able to make a remote procedure call from within the SQL Server CLR code to the methods available in the client process.

Is this possible? If so, could someone please refer me to an example of how to do it.

If it can be done, it opens up lots of very cool possibilities!

Thanks.

It's a much cleaner design if you can explicitly pass the client context information to the server-side CLR code rather than RPC back to the client. While you can do anything you want if you register the assembly as unsafe, I don't recommend that approach. It's better for both security and performance reasons to keep server-side processing on the server itself as much as possible.

|||

Dear BonnieFe,

Thanks for your suggestion. It would be a much cleaner design, if it was possible. Unfortunately, the data I need back changes for every row in the returned data, since it is obtained by passing a value from a returned data column to a method which has to be called in the context of the calling process.

I have now solved the problem by calling a web service in the calling web site from the CLR code inside SQL Server 2005. This seems to work fine, although it is bound to be slower than it would be if it used RPC back through the SQL connection.

Making groups visible using Parameters

Hi everyone,

I am new to reporting services and really need some help..
Im trying to simply my requirement using this scenario: Lets say

I want to display Sales for the current year (i.e from the start of the year january to the month we are currently at). The next requirement is to group these sales, by Area , Region , Zone...

Top leve l = Zone , then Region then Area.

I need the user to be able to control this using a parameter (i.e User can select "View Area Level" or "View Region Level" or "View Zone level")

How can this best be achieved ?

My idea was using row groupings and controling visibility using the parameter.. The problem is.. If i want to view ONLY the area level and not see anything above, can I turn visibility off of the Zone and Region and still see the inner group (area)

Area Level (default view)

Jan Feb
Area 1 100 100
Area 2 200 200

Region Level Selected

Reagion 1
Area 1 100 100
Region 2
Area 2 200 200

Zone Level Select

Zone 1
Region 1
Area 1 100 100
Region 2
Area 2 200 200
Any help would REALLY be appreciated ..

Kind Regards,
Neil
http://blogs.msdn.com/chrishays/archive/2004/07/15/DynamicGrouping.aspx|||

Hello Neil,

I can think of a couple ways to do this, one way is having 2 boolean parameters. From the way you show in your example, it looks like the Area level will always show.

First, you'll need to create the 2 parameters as boolean type and set your defaults. For example: ShowRegion - False, ShowZone - False.

Click on the row handle for your Zone level and go to the Hidden setting in the Properties window.

Change the Hidden setting to an expression and enter this into it:

=Iif(Parameters!ShowZone.Value = True, False, True)

Click on the row handle for your Region level and change the Hidden setting to this expression:

=Iif(Parameters!ShowRegion.Value = True OR Parameters!ShowZone.Value = True, False, True)

Hope this helps.

Jarret

|||Hey Jarret

Thanks so much for the reply, I have found away to do this, well In theory the idea works..
With regards to your idea.. I was thinking that If the parent group is made invisible so are the children groups (invisible).. well.. I dont know if that is the case.. If you know the answer please let me know..

Thanks for taking the time to help out.. really appreciate it Smile

Kind Regards,
Neil
|||

Hello,

If you hide a higher group (parent), the lower groups (children) will continue to show until explicitly hidden. They are independent of each other.

Jarret

|||Great !!

Thanks!!

Friday, March 23, 2012

Making a stored procedure run on its own periodically.

Hi,
I have a requirement to update a table in SQL Server through a stored
procedure,
the stored procedure should run periodically, say once in a month, and
update the table.I should not use any external programs to call the
stored procedure, is there any other way to do it without using an
external programs.
Thanks in advance,
RajanSchedule a job that calls the stored procedure:

http://msdn.microsoft.com/library/e...tomate_4v1v.asp

--
David Portas
----
Please reply only to the newsgroup
--|||Thank you so much.

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message news:<x8GdnWECNf3zSFSiRVn-gw@.giganews.com>...
> Schedule a job that calls the stored procedure:
> http://msdn.microsoft.com/library/e...tomate_4v1v.asp