Cannot preview Excel spreadsheet data in BIDS 2008

Leave a comment

Simple error returned when trying to view sheet data in Excel from within BIDS.

“There was an error displaying the preview. (Microsoft Visual Studio)

Index and length must refer to a location within the string.

Parameter name: length (mscorlib)”

 

BIDS doesn’t do well with spaces in the Excel sheet name. Remove the spaces or replace them with underscores lazy programmer. 😉

CAST SQL Server system table/view duration as Time

Leave a comment

Parse to your heart’s content . .

SELECT CAST(SUBSTRING(CAST(last_run_duration + 1000000 AS CHAR(7)), 2, 2) AS INT) AS ‘hours’
,CAST(SUBSTRING(CAST(last_run_duration + 1000000 AS CHAR(7)), 4, 2) AS INT) AS ‘mins’
,CAST(SUBSTRING(CAST(last_run_duration + 1000000 AS CHAR(7)), 6, 2) AS INT) AS ‘secs’
FROM msdb..sysjobsteps

%d bloggers like this: