When to use database views and when not?
Pros: Allows you to change the underlying data structures without affecting the queries applications are using (as long as your view can hide the data structures)
Pros: Allows you to change the underlying data structures without affecting the queries applications are using (as long as your view can hide the data structures)
I agree with everything Oded said except “It can’t reasonably be used as a foreign key either.” In this case it’s a pick your poison, the mapping table absolutely can be a parent, it’s just a matter of the child using a multicolumn FK or not. Take a simple case of Car and color. Each … Read more
I always use something like the following: public static String GetTimestamp(this DateTime value) { return value.ToString(“yyyyMMddHHmmssfff”); } This will give you a string like 200905211035131468, as the string goes from highest order bits of the timestamp to lowest order simple string sorting in your SQL queries can be used to order by date if you’re … Read more
Database clustering is a bit of an ambiguous term, some vendors consider a cluster having two or more servers share the same storage, some others call a cluster a set of replicated servers. Replication defines the method by which a set of servers remain synchronized without having to share the storage being able to be … Read more
Try: INSERT INTO table1 ( column1 ) SELECT col1 FROM table2 This is standard ANSI SQL and should work on any DBMS It definitely works for: Oracle MS SQL Server MySQL Postgres SQLite v3 Teradata DB2 Sybase Vertica HSQLDB H2 AWS RedShift SAP HANA Google Spanner