Category: MySQL

  • CTAS and Select Into

    In both Oracle and MySQL, you can do: create table T1 as select * from T1 This CREATE TABLE AS statement basically clones table T1 with its structure and data in T2. This can be pretty handy at times. The equivalent of that in Sql Server is SELECT INTO. For example, you can do: select […]

  • Delete permission implementation differences

    I mentioned when grant statements take into effect in Sql Server, MySql, and Oracle here. I found out recently that there are some implementation differences when you grant only delete permission on a table to a user. MySql and Sql Server do this the same way, whereas Oracle is different. Suppose you have: 1. Table […]

  • When does grant statement take into effect

    In both Sql Server and Oracle, permission changes to a user take into effect right away, even when said user is connected at the time you made the change. In MySql, it is a little different, depending on how the permissions are given. If you use the GRANT statement, then it takes into effect right […]

  • Executing sql scripts using command line tools

    SQL Server 2005 has a command line tool named sqlcmd. MySQL has a command line tool named mysql. Oracle has a command line tool called sqlplus. They can all be used for interactive query processing and batch scripts processing. They do similar things, albeit in different ways. They are functionally equivalent. For SQL Server 2005, […]

  • desc is sp_columns in Sql Server

    In Oracle and MySql, to get the column name and data type of a table, you can use: desc MyTable or describe MyTable The equivalent of desc in Sql Server is sp_columns. Therefore, run the command below will get similar results: sp_columns MyTable