Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Creating assembly Expand / Collapse
Author
Message
Posted Monday, March 10, 2008 9:58 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:32 AM
Points: 7,179, Visits: 15,767
J Sitz (3/10/2008)
Matt,
Rebooting the server fixed it. How can I test for a memory leak on the server? This was the first assembly on the server, but it was not in production. I don't see how it could cause a memory leak. There are no resources that need to be disposed. It just calculates dates.


What release version are you on? Several are just not good for CLR.

Also - for dates - I'd probably go with Jeff's advice and steer clear of CLR. Plenty of date functions right in SQL. What are you trying to do?


----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #467144
Posted Tuesday, March 11, 2008 7:04 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, October 27, 2014 9:25 AM
Points: 18, Visits: 35
Jeff,
What do you mean a Calendar table? Is this just a table that I would create and add in the dates manually?
Post #467353
Posted Tuesday, March 11, 2008 7:12 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, October 27, 2014 9:25 AM
Points: 18, Visits: 35
I already had this function created for another application, and thought it would be easier than looking up the holiday dates in the future. I suppose if you think it would be a lot better, I could use this function to populate a table with the dates. This Calendar table that you are referring to, is it just a table that I enter in the dates, or is it a feature in SQL?
Post #467360
Posted Tuesday, March 11, 2008 7:24 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:32 AM
Points: 7,179, Visits: 15,767
The concern is that functions tend to hurt performance quite a bit. Although they might improve readability, they have a tendency to take the ability to leverage things like indexing away from the optimizer, so your queries tend to run quite a bit slower. And that's not so much a CLR vs T-SQL issue - that's kind of "built-in" to functions using inputs from the row.

The recommendation then tends to become - build the functionality of the function into the queries you need. They will usually run a LOT faster.

Of course - if you are using the function to create stuff that can be stored and will remain - that's also great. Quite honestly - disk space is cheap these days, so if this can be calculated once and stored, and then referred to later - go for it. just treat it like any other table - index it, etc...


----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #467371
Posted Tuesday, March 11, 2008 7:46 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, October 27, 2014 9:25 AM
Points: 18, Visits: 35
I guess that I'll make the table with the dates.

Thanks for all your help.
Post #467398
Posted Tuesday, March 11, 2008 8:19 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 2:14 PM
Points: 35,770, Visits: 32,435
J Sitz (3/11/2008)
I already had this function created for another application, and thought it would be easier than looking up the holiday dates in the future. I suppose if you think it would be a lot better, I could use this function to populate a table with the dates. This Calendar table that you are referring to, is it just a table that I enter in the dates, or is it a feature in SQL?


It's not a built in feature... here's an article that tells the how and why...

http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #467440
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse