Welcome To Snipplr


Everyone's Recent Snippets Tagged sql



Re-seed identity table if rows were deleted/there are gaps in numerical order
2 1330 posted 16 years ago by CDIDevs
1 1693 posted 16 years ago by CDIDevs
2 1439 posted 16 years ago by CDIDevs
1 1344 posted 16 years ago by CDIDevs
1 1157 posted 16 years ago by magicrebirth
Call it in the button click event after in(de)crementing CurrentPage value
0 1118 posted 16 years ago by tomaszsimon
Using SQL you can have your database return the distance between 2 sets of Lat and Long points, and using some math functions also take into account the curvature of the earth.
3 2304 posted 16 years ago by zingo
Reset joomla super admin password to ”admin“
1 1244 posted 16 years ago by elisium
0 1509 posted 16 years ago by kingkool68
A Temp table is great for combining multiple SELECT statements in a Sproc and outputting as just one table. Don't forget to Drop the table after the SELECT * FROM #TempTableName at the end.
2 2016 posted 16 years ago by highlyevolved
These statements convert a date/time field into just a date or a time field
2 1853 posted 16 years ago by highlyevolved
0 1231 posted 16 years ago by tobewan
0 1135 posted 16 years ago by tobewan
Delete All Foreign Keys in a database; (make sure you USE keyword)
2 1242 posted 16 years ago by marcocs
0 1453 posted 16 years ago by almazom
This snippet is usable for telephone number normalization. It supports re-mapping of misused alphabetical characters (e.g. i for 1) and some other clean up stuff... Take a look. Update, 2009-10-02: added function to create a corresponding MySQL RE...
1 1627 posted 16 years ago by dreadwarrior
1 1322 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 1987 posted 16 years ago by rengber
Dead simple, but often forgotten.
1 1663 posted 16 years ago by rengber
Function for sanitize input POST, GET, COOKIE arrays.
2 1614 posted 16 years ago by kirik
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 1556 posted 16 years ago by rengber
1 1408 posted 16 years ago by pdswan
0 1322 posted 16 years ago by iloveitaly
Pretty straight forward implementation of mysql instantiation using php5 oop. Example usage at the bottom. The database in the example is named 'example_database' and has 1 table, 'newstable'. This table has three columns: 'id,heading,message'. By...
0 1151 posted 16 years ago by bakkelun
count(*args) Count operates using three different approaches. Count all: By not passing any parameters to count, it will return a count of all the rows for the model. Count using column: By passing a column name to count, it will return a count of...
1 1524 posted 16 years ago by deschism