MDX Fundamentals – MSDN
December 17, 2010 Leave a comment
http://msdn.microsoft.com/en-us/library/ms145514(v=SQL.100).aspx
Just another WordPress.com site
October 9, 2010 2 Comments
I bought a shiny new galaxy s
recently and now this blog is on wordpress it means I can blog from my phone (which is what I’m doing now!).
October 8, 2010 1 Comment
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
September 3, 2010 Leave a comment
table SSIS_Configurations
VARCHAR(100) NOT NULL,
NVARCHAR(255) NOT NULL,
NVARCHAR(20) NOT NULL,
NVARCHAR(1000) NULL
June 16, 2010 Leave a comment
Today I had to write a procedure to unpivot a table with an unknown number of columns / column names, I’ve used a combination of user defined function and dynamic sql to build a sql unpivot statement and then execute it…
First create function…
CREATE FUNCTION [dbo].[Udfgetcolumnnames] (@Table VARCHAR(100))
RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @str VARCHAR(MAX)
SET @str =”
SELECT @str = @str + column_name + ‘,’ frominformation_schema.columns
WHERE table_name = @Table
AND column_name NOT IN( ‘ShiftStart’, ‘AgentName’, ‘Date’ )
SET @str =Substring(@str, 1, Len(@str) – 1)
RETURN @str
END
Then use it to help define the SQL…
DECLARE @sql NVARCHAR(MAX)
SET @sql =”
SET @sql =
‘SELECT AgentName, Date, pvt.Interval, pvt.ActivityCode FROM ActualAgentActivity UNPIVOT ( ActivityCode for Interval in (‘ +
dbo.Udfgetcolumnnames(‘ActualAgentActivity’) + ‘) ) as pvt WHERE pvt.ActivityCode <> ”.”’
EXEC Sp_executesql @sql
You will notice I hardcoded some values in my function – Trying to add this functionality as an extra parameter/s was a complete nightmare and I ran out of time. If anyone has a suggestion on how this could be made more generic I would love to hear it (given that there could be any number of excluded columns)
June 15, 2010 Leave a comment
<script type="text/javascript" language="javascript">
var reloadTimer = null;
var sURL = unescape(window.location.pathname);
function setReloadTime(secs)
{ if (arguments.length == 1)
{ if (reloadTimer) clearTimeout(reloadTimer);
reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs)*1000));
}
else
{ reloadTimer = null;
location.reload(true);
window.location.replace( sURL );
}
}
setReloadTime(30);
</script>
Thanks for this go to http://drewmace.blogspot.com/2008/02/auto-refresh-sharepoint-page.html
May 25, 2010 Leave a comment
May 25, 2010 Leave a comment
SQL> select TEXT
2 FROM DBA_VIEWS
3 where OWNER = ‘<owner_name>’
4 and VIEW_NAME = ‘<view_name>’;
May 20, 2010 Leave a comment