use databasename? 进入指定数据库名? ? ? ? 命令一致
以下是MySQL和MSSQL命令的一些区别:
? ?- MySQL:
mysql -u username -p password -h hostname database_name
? ?- MSSQL:
sqlcmd -S servername -U username -P password -d database_name
? ?- MySQL:
show databases;
? ?- MSSQL:
SELECT name FROM master.sys.databases;
select databse()? ?查询当前进入数据库的名? ? mssql无法使用,mysql正常
mssql? 暂无
? ?- MySQL:
show tables;
? ?- MSSQL:
SELECT name FROM sys.tables;
顺序有点乱
SELECT name FROM sys.tables order by name;
? ?- MySQL:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
? ?- MSSQL:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
? ?- MySQL:
DROP TABLE table_name;
? ?- MSSQL:
DROP TABLE table_name;
? ?- MySQL:
DROP DATABASE database_name;
? ?- MSSQL:
DROP DATABASE database_name;
? ?- MySQL:
SELECT column1, column2, ... FROM table_name WHERE condition;
? ?- MSSQL:
SELECT column1, column2, ... FROM table_name WHERE condition;
? ?- MySQL:在distinct和group by之前
? ?- MSSQL:在distinct和group by之后
BACKUP DATABASE [数据库名] TO DISK = '备份文件的路径和文件名' WITH FORMAT;?
要导入SQL Server的.bak
文件,可以按照以下步骤操作: