Welcome To Snipplr


Everyone's Recent SQL Snippets



0 1365 posted 16 years ago by tobewan
Delete All Foreign Keys in a database; (make sure you USE keyword)
2 1380 posted 16 years ago by marcocs
1 1675 posted 16 years ago by thomasvdb
1 1451 posted 16 years ago by wearetherock
I am forever forgetting this. Have to look up the 101 vs 103 in books online every time. Also forget which way around is US/NZ format. :-)
1 2148 posted 16 years ago by rengber
Dead simple, but often forgotten.
1 1844 posted 16 years ago by rengber
From StackOverflow. I'm still not quite happy with my understanding of it, but it looks an order of magnitude more elegant than most I've found.
0 1715 posted 16 years ago by rengber
1 1550 posted 16 years ago by pdswan
4 1966 posted 16 years ago by pdswan
Crear un backup de una base de datos en SQL Server 2005/08 desde código en la posición definida por Device. Cuidado con los permisos: http://support.microsoft.com/kb/207187/es
1 1937 posted 16 years ago by marcocs
Crear un backup de una base de datos en SQL Server 2005/08 desde código en la posición predefinida del disco. Para agregar un dispositivo y hacer el backup en posición no predefinida: http://msdn.microsoft.com/es-es/library/ms188409(SQL.90).as...
1 1794 posted 16 years ago by marcocs
More for me than anything else
2 1318 posted 16 years ago by iloveitaly
0 1579 posted 16 years ago by d020
0 1445 posted 17 years ago by jturmel
This will return a list of all the tables in a certain database along with their row count.
1 1721 posted 17 years ago by blackf0rk
0 1253 posted 17 years ago by rowntreerob
In a migration scenario, you may need to take a backup and a differential later to split the transfer over time. But to make it work, there shouldn't be any other full backup in between. This will help you check the last full backup date. Of course,...
0 1625 posted 17 years ago by pollusb
This sql query will select the past version information about a given file from the database. An example would be searching for %ApprovalHistoryVOImpl% would return all past version numbers (in the database) for the ApprovalHistoryVOImpl.class file....
0 1726 posted 17 years ago by theonlyalterego
* be postgres user
0 1317 posted 17 years ago by kungfoo
Extract logins default db settings from one server to export to another
0 1216 posted 17 years ago by pollusb
Sometimes you want to return a bunch of data from a table, but you want it coming back in a random order. Maybe it's for keeping some content on a home page fresh. Here's how:
0 1463 posted 17 years ago by blackf0rk
0 1523 posted 17 years ago by smoover
This is how you can connect SQL Server to a Share folder for your backups. After running this, you will see the letter T: in the GUI. Each line must be run seperatly.
0 1948 posted 17 years ago by pollusb
This as it sits isn't an improvement on what happens by default. It's only useful combined with a compensating transaction or sad path in the catch block, or in allowing a loop to continue.
0 1676 posted 17 years ago by rengber
select cast(floor(cast(getdate() as float)) as datetime)
0 1658 posted 17 years ago by flurk118
Minimal syntax for cursor use. See URL for SQL 2005 options and improvements.
0 1734 posted 17 years ago by rengber