Hi Leandro
This looks exactly what I am looking for.
I have however picked up the following error. Any ideas?
regards Steve
Msg 6260, Level 16, State 1, Line 1
An error occurred while getting new row from user defined Table Valued Function :
System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
System.Data.SqlTypes.SqlTypeException:
at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
at System.Data.SqlTypes.SqlDateTime..ctor(DateTime value)
at CLRFunctions.FillPartitionRow(Object obj, SqlChars& cubename, SqlChars& measuregroupname, SqlChars& partitionid, SqlChars& partitionname, SqlDateTime& createdtimestamp, SqlDateTime& lastprocessed, SqlChars& aggregationdesignid, SqlChars& aggregationdesignname, SqlInt32& aggregationdesignaggrscount, SqlInt32& aggregationdesignestperfgain, SqlChars& slice, SqlInt64& estimatedsize, SqlInt64& estimatedrows, SqlChars& storagemode, SqlChars& storagelocation, SqlChars& processingmode, SqlChars& datasourcename, SqlChars& datasourceconn, SqlChars& datasourceviewname, SqlChars& remotedatasourcename, SqlChars& remotedatasourceid, SqlChars& description, SqlChars& errconfkeyerrorlogfile, SqlChars& errconfkeyduplicate, SqlChars& errconfkeyaction, SqlInt64& errconfkeyerrorlimit, SqlChars& errconfkeyerrorlimitaction, SqlChars& errconfkeynotfound, SqlChars& errconfnullkeyconvtounknown, SqlChars& errconfnullkeynotallowed)
.