SQL Server & Tibco Spotfire Ideas & Samples
SQL, TSQL, Tibco Spotfire...
Aug 8, 2010
DOS command in T-sql (xp_cmdshell)
EXEC master..xp_cmdshell 'dir c:'
EXEC master..xp_cmdshell 'RENAME E:\"HR Reports"\"Master Sheet"*.xls "Master Sheet".xls'
T-SQL RollUp
--Sample Script
SELECT CASE WHEN (GROUPING(Data_type) = 1) THEN 'ALL'
ELSE ISNULL(Data_type, 'UNKNOWN')
END AS Data_type,
SUM(Type_id) AS Type_idSum
FROM Staging.Data_Type
GROUP BY Data_type WITH ROLLUP
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)