Use the Getdate()
SET @sql = 'INSERT INTO ' + @p + ' (AggregateName,TimeIndex,TotalSpace,UsedSpace,UsedPercent,DaysToFull,DailyGrowth,ControllerName,CustomerID)
SELECT SUBSTRING(Aggregate,1,25), GETDATE(),
SUBSTRING(Total,1,15),
SUBSTRING(Used,1,15),
CONVERT(decimal(10,3),UsedPerc,3),
CONVERT(int,DaysToFull),
CONVERT(decimal(10,3),DailyGrowthRatePerc,3),
SUBSTRING(Controller/Cluster,1,25),
'''+@cid+''' FROM ' + @s
print @sql
function directly to skip the @d variable.
No comments:
Post a Comment