Still working on the legacy application and seeing this Module Module1 Public x as long Sub mymethod1(Byref x as long) x = x + 1 End Sub Sub mymethod2() mymethod1(x) end sub End Module``` Way cool.
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
I’m in the process of upgrading a legacy VB program and I found this 10: For x as integer = 1 to whatever if x = 1 then goto 20 dosomethingelse 20: Next``` I’m gonna use this more often, it’s cool.
Today I had a major computer crash, or something that looked like it. The computer had a bad spell and I was the victim. Don’t ask what went wrong because I have no idea. After rebooting a couple of times it came back as if nothing ever happened. But something did happen. I have VMware workstation 6.5.1 on my machine with 4 open VM’s on it, 3 of them XP and one server 2003. It also had one closed VM with Win 7 on it.
I answered this question today and thought it would be useful to create a little post If you have a varchar value like this ‘2009-06-26 14:30:00.000Z+4:30’ you want to take 4 hours and 30 minutes and then subtract that from the date itself so in this case you will get 2009-06-26 11:00:00.000. The reason you subtract is because the +4:30 means that this was generated in a zone that is 4:30 ahead of utc
This will not work on SQL Server 2000 since the sp_refreshsqlmodule does not exists on that version! A while back in the What is deferred name resolution and why do you need to care? blogpost I showed you that sp_depens is not reliable because you can create procedures that reference objects that have not been created yet. You can use sp_refreshsqlmodule to help ‘fix’ that let’s take a look at how that works
SQLCLR adds a great deal to the SQL Developer list of methods to get the job done. That is pretty much a given. Hardware, resource usage and all that endless discussion aside, SQLCLR given handled correctly and given the hardware to utilize its abilities without putting memory and other pressure on your instances can be truly a beneficial aspect to your bag of tricks. As a DBA I have dozens of SQLCLR procedures that make my life unbelievably easier than in prior years. Also coming from years of developer experience have helped me along in catching on the SQLCLR. Today I thought sharing a few common and very useful DBA procedures would make a handy post.
For a long time I have had to make web reports for our company that could be exported to excel. This is a fairly easy process. All you have to do is put your report in an HTML table and add the following 2 lines of code: Response.ContentType = "application/ms-excel"; Response.AddHeader("content-disposition", "attachment; filename=test.xls"); However, when the excel file is generated it has a nasty side effect of having all the gridlines hidden. They can easily be turned back on in excel by the following: Tools > Options > click gridlines checkbox.
I took some time off so apologize to readers for my lack of writing lately. Today I thought I’d talk about the report manager and SSRS. Personally I’m not a big fan of it. It lands in there with SSMS and tasks like creating or modifying indexes. I use it when I need it really quick and it’s the only thing I need to touch. If you have to modify or create a bunch of things it becomes very cumbersome and pretty much an annoyance. Any browser based front end is a dog. Sense report manager is just that, you can expect refresh issues, slow response and having to hit 30 “OK” buttons to get one thing saved. The nice thing about most SQL Server Services is they are controlled by system procedures, functions etc… This means in most cases you can utilize these same system objects to your advantage. One that I’ll show you today is the create subscriptions procedure named, “CreateSubscription” for Reporting Services.
This week I bought a new netbook. The Acer Aspire One 751h (what’s in a name). It’s an amazing little machine, but I guess everything is amazing at my age I can still remember things like the Commodore 64 and the first x86. Standard, it only comes with 1Gb of RAM but it supports a maximum of 2GB so I ordered that with it and installed it myself which is pretty simple no need to spend 20€ on a tech to do it for you.
A friend of mine pointed me in the direction of a cool library for Aspect Oriented Programming called PostSharp the other day. I’d read about AOP in the past, but always had so much going on that it slipped my mind to look further into it. But, his excitement rubbed off on me and it wasn’t long before I thought of a way I could use it. I’d been wanting to set up logging on a site I’ve been working on so that I could collect data for a while and report on it to see which controller methods are running the slowest. Not a permanent solution, just a way to gather data for a while to analyze it and identify any pain points I may have missed. Using PostSharp I can do it without littering too much logging code throughout the controllers themselves (all they would need is an attribute).