Skip to content

Instantly share code, notes, and snippets.

View MachinesAreUs's full-sized avatar

Agustín Ramos MachinesAreUs

View GitHub Profile
@yngwie74
yngwie74 / gist:3380963
Created August 17, 2012 17:47
Determinar la fecha de última modificación a la estructura de una tabla en SQL Server
SELECT name
,create_date
,modify_date
FROM sys.tables
WHERE name = 'TABLE_NAME'
@yngwie74
yngwie74 / gist:3380899
Created August 17, 2012 17:40
Determinar cuando se hizo un "RESTORE" a un BD por última vez en SQL Server
SELECT rsh.destination_database_name AS [Database]
,rsh.user_name AS [Restaurado por]
,CASE
WHEN rsh.restore_type = 'D' THEN 'Database'
WHEN rsh.restore_type = 'F' THEN 'File'
WHEN rsh.restore_type = 'G' THEN 'Filegroup'
WHEN rsh.restore_type = 'I' THEN 'Differential'
WHEN rsh.restore_type = 'L' THEN 'Log'
WHEN rsh.restore_type = 'V' THEN 'Verifyonly'
WHEN rsh.restore_type = 'R' THEN 'Revert'
@MachinesAreUs
MachinesAreUs / gist:2029919
Created March 13, 2012 17:00
FizzBuzz en haskell
fizzbuzz x
| x `mod` 3 == 0 && x `mod` 5 == 0 = "fizzbuzz"
| x `mod` 3 == 0 = "fizz"
| x `mod` 5 == 0 = "buzz"
| otherwise = show x
fizzbuzz100 =
mapM_ putStrLn [ fizzbuzz x | x <- [1..100] ]