Moved to: WoodyHayday.com
Woody Hayday

Fresh Ideas

Hi there! This is my old blog, I don't hang around here much.
You can now find me trying to mix things up here:
Visit WoodyHayday.com Subscribe To My Email List

Entourage – Good downtime

Recently got a bit ill….Time to catch up on some Entourage!! – Good program – here’s a good example clip.

Posted in WoodyLabs

SSRS Every Forth Page? – Shortest Code

On looking for the quickest way to spit something out on every forth page of an SSRS report I wrote this – anyone got a yet further abreviated way to set visibility on every forth page?

=iif(((Globals.PageNumber+1) Mod 4) = 0, False, True)

Posted in Snippets, SSRS

SSRS 08 Reports Strait from URL

Looking to get SQL Server Reporting Services 08 reports to people easily? sometimes its simpler to just give them an url, which you can do and works well.

If you take the following and replace SERVERHOST, REPORT LOCATION/NAME,PARAMNAME and PARAMVALUE with your SSRS report details you can literally hand it out irrelevant of session, location (obviously internal/external applies) and itll spit out a nice PDF stream to their box.

http://*SERVERHOST*/ReportServer?/*REPORT LOCATION/NAME*&rs:Command=Render&*PARAMNAME*=*PARAMVALUE*&rc:Parameters=false&rc:Toolbar=false&rs:Format=PDF

Posted in SSRS

I think I am INTP

Happened across the “16 personality types” – Usually don’t drop time on this stuff but this one hit home.

I think I am INTP – But I think I might fluctuate more towards a leader/extrovert version. What personality type suits you?

Read the rest : I think I am INTP »
Posted in Uncategorized

TED Talks that inspire – My Pick

My most recent favourite on TED.com is this talk by behavioral economist Dan Ariely, is a funny one.

Alex Tabarrok on how “ideas trump crisis”

Adam Savage’s Talk on his obsessions in life

All worth a watch, if you get a spare chance check out TED.com,  you can see my profile where I will try to favourite the video’s I like but nearly all are interesting enough to warrant some of your web time.

Posted in Ideas, Technology

xp_fileexist Network Drive – T SQL Based File checking

If you didn’t already know you can check whether files exist, find file sizes and all sorts of other useful things directly from within Transactional SQL Query. In this example I had a table containing a few columns that gave me the network drive location and filename of a few thousand files and I wanted to verify that every file at this address existed in reality.

Here is how I managed it:

–make procedure to cycle trhough entrants and assign them to a room
create procedure [dbo].[files_2_check] as
DECLARE @fileAt varchar(2000)
DECLARE @fileEx int

DECLARE checkCursor CURSOR FOR
–select top 10 FileDirectory + FileName from files – USE to test it first
select FileDirectory + FileName fromfiles

OPEN checkCursor

FETCH NEXT FROM checkCursor
INTO @fileAt

WHILE @@FETCH_STATUS = 0
BEGIN

set @fileAt = ‘\\192.168.1.8\f$\Files\’ + @fileAt
–this will depend on your network address

print ‘Searching for ‘+@fileAt
EXEC master..xp_fileexist @fileAt, @fileEx OUTPUT;

if @fileEx = 0
begin
insert into dbo.tbl_fileCheck (fileLoc) Values (@fileAt)
–doesnt check for already existing, archives by date though
print ‘…NOT FOUND – Recorded to DB’
end
if @fileEx = 1
begin
print ‘…OK’
end

set @fileEx = 0
set @fileAt = ”
FETCH NEXT FROM checkCursor
INTO @fileAt
END

CLOSE checkCursor
DEALLOCATE checkCursor

Which basically grabs the rows containing the file directory/filename and uses a cursor to cycle through each one checking them using the xp_fileexist command. There were a number of ways available to do the actual file exist checking but this one suited best, This solution definately works on SQL2005 and forwards, although did need a few additionals:

Turn on the setting (potential security issues if this is on 24/7, but you could run it on a vanila ms sql db server elsewhere) – Worth turning off afterwards.

exec sp_configure ‘show advanced options’, 1

go

reconfigure

go

exec sp_configure ‘xp_cmdshell’, 1

go

reconfigure

go

Apply admin rights to the MS SQL Windows service – by default this will only have local scope, it needs you to go to the services properties, then logon tab and assign it a user which has scope to view the files its checking exist over the network.

Posted in Social Media, SQL Server, Transactional SQL

Developers Arsenal PHP to ASP Jump

Server Side Scripting is a wonderful term. It’s what takes the control off of the browser and solely in the hands of the developer, because ultimately the developer is the one with the coding capacity. Since I first messed about with php for my own entertainment I have always revelled in using it, perhaps it was my age or my development of programming understanding but on learning php code just started falling into place. Over the years I have written PHP that ranges from the most basic database reading and amending (Data Access Layers 😉 ) to flexible web spiders, data crunchers, content management systems, data extractors, image processors and full on web applications. For me PHP is my main gun, the thing I find easiest to sling a quick script out in. With the ever robust XAMPP you can stick a web server up anywhere in minutes and have a machine doing what you want with data or the web or images shortly thereafter. People have jailbreaked iPhones just to run php from web cafe’s and similar.

PHP is the tool of the open source project. (There are of course companies that use it (my companies do) and huge online websites/behemoths of information that use it as a server side language.) but overall the corporate world, any web software with intent to move to larger markets and bridge the gap to desktop apps codes in ASP and now ASP.NET. There was nothing I couldn’t do in PHP/mySQL that I wanted to do, it for me was a very good toolset and fulfilled my needs as far as I could see them. But it would lack if you wanted to move towards desktop applications, and its lack of association to Microsoft does act as a restriction in some ways. So there it is ASP / ASP.Net needs to picked up. For me this was more a conversion than picking up a new skill, I took PHP and hammered that knowledge into ASP Syntax – this actually works nearly entirely for the most part, you get over the differences very easily if you have done even a bit of visual basic before (as ASP in its default form is essentially vb – C# is also excellent.)

I just took a course in “ASP.NET Scalable web applications using AJAX” (Learning Tree in euston – would recommend it – taught by an excellent asp.net consultant, Richard Howells) which affirmed a lot of programmatic choices I have previously made and enlightened me to improved structures for scalability. The thing I most took out of it though is how much work microsoft have put into their IDE (Visual studio.) VS2008 is pretty phenomenal if you come from hand coding everything yourself. I can see how developers get wooed by intellisense and ease of access, they intend to make it all easy – every functionality provided by web technologies in their control based environment. For me it still remains though that in providing a huge framework of simplicity to every user you do carry a certain amount of redundancy, that is while it may take longer to code pure PHP \ Javascript it will still do specifically what you want it too, and only that. Potentially with the microsoft IDE you can create what you want entirely and then cut the fat so to speak afterwards – there are substantial speed benefits with their project based management, this methodology however is not my first choice.

For any person wanting to seek employment or understanding in web development I would highly recommend jumping strait into PHP or ASP.NET (probably PHP unless you have a requirement for ASP – ASP.NET C# Pays better than PHP here in the UK.) After learning the basics of HTML, Javascript and CSS, PHP or ASP brings you clearly up another step. I am available for code/developer mentoring/support as of Summer 2009.

Posted in ASP.Net, C#, CSS, Javascript, PHP

SQL Server Reporting Services

SQL Server Reporting Services – Microsoft Reporting Services – Microsoft Visual Basic Reports – Microsoft Visual Studio Reports

Whatever name you want to give them there is a great capacity in cutting edge Microsoft developer’s tools. You have to give it to them; they do continue to roll out tool after tool aimed solely at developers. Being a diehard fan of crystal reports and having written a fair few Visual Basic reports in Microsoft access back in school I wasn’t expecting to be that happy changing again, adapting to a new set of tools. SSRS though is actually quite good. A little learning about the structure of VS08 report writing/deploying and I was there.

I think there is still the need to bridge the gap for Microsoft, from SQL Management Studio (which by the way just gets better with age) to its reporting arm. Writing a query in SQL Management Studio and copying it is all well and good, but essentially it requires training a user up, giving rights and permissions to a user in two different contexts (that of the report deploying and writing environment and also SQL MGR Studio.) For the apt this is quickly picked up but when training the less capable there seems almost a gap between the two products. While we can all endeavour to employ only the talented, it would be the icing on the cake if a more simplistic solution was available.

Once over the initial hurdles of SSRS it soon steps up to crystal reports and certainly is capable of completing on 95% of the reports I have ever written. Crystal Reports does still have a minute edge in my mind but the learning curve to use Visual Studio to write reports was tiny, excellent for management reporting.

If you are using or have used crystal reports, I would suggest recreating a few reports in Sql server reporting services from scratch, maybe getting a book (SSRS 2005
or 2008) on it if you don’t feel confident enough to wing it. You should find it easy to pick up and it’s an invaluable tool for management and integration into any web application.

Posted in SQL Server, SSRS
The New Blog
WoodyHayday.com
A Quote..
"I'm only good at being young"
John Mayer
Old Random Projects
    © Woody Hayday 2008-2025