Welcome To Snipplr
Everyone's Recent SQL Snippets Tagged table
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
Example of SQL syntax to add a new column to an existing table, define a default value to the columns for the existing rows and also add a check constraint to limit the values that the column can hold.
0
855
posted 11 years ago by denakitan
My Add Column Varchar.sql
This template adds a new varchar column to the table.
0
540
posted 13 years ago by edwinet
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
909
posted 14 years ago by highlyevolved
This will return a list of all the tables in a certain database along with their row count.
1
700
posted 14 years ago by blackf0rk
Fields are tab delimited and need to match table schema.
I've found the tab separator ASCII(009) preferable over using a comma.
The second version can help remove double quotation marks around character fields.
Don't forget the keyword LOC...
0
813
posted 15 years ago by RICHARDP
This will create and then populate a MySQL table with a list of the names and USPS abbreviations for US states and possessions in existence.
3
2587
posted 15 years ago by cbrant
This will create and then populate a MySQL table with a list of the names and ISO 3166 codes for countries in existence.
5
1325
posted 15 years ago by cbrant
« Prev 1 Next »