The pit encountered in mysql to sqlserver

The pit encountered in mysql to sqlserver 1. sqlserver2005
cannot use the data synchronization function, only sql2008 can use it. You need to configure the odbc driver first, and then use the import function in navicat for server to ---odbc---fill in the mysql username and password---import data.
Note that the auto-increment field will become non-auto-increment in sqlserver.
At this time, you need to manually add identity(1,1).
But if it becomes an auto-increment field, when adding data, the auto-increment field cannot be filled in (filling it blank or not, is very different from mysq1).
2. SQL Server, an explicit value can be specified for an identity column in table xx only if a column list is used and IDENTITY_INSERT is ON.
set identity_insert table name ON

Use this command to set the auto-increment column of the table to ON
and then use:
SELECT 3,0,'Adolf',141,0,2,'133','09 24 2008 3:23PM','133 ','09 24 2008 3:23PM',0,'NULL'

, insert data (use Select, not Insert into).
After inserting, set the column to OFF
set identity_insert [agent_ctm_shopgroup_tbl] OFF
But I used the above when writing sql, and it still didn't work.
3. http://www.th7.cn/db/mssql/201406/59721.shtml
4. Now() is used for mysql time, and getdate() is used for sqlserver.
Now()+interval 1 day in the next day of mysql, now()+interval 1 month in
the next
month . (month,1,getdate())
5. sqlserver corresponds to different driver jar packages for different jdk of java. It is not wrong at all. The driver name is also very different after 2000 and 2005.
6. When querying by page, since 2005, you can use the row_number() function, which is much more convenient and faster than the original. (use select 0 when there is no order by field)
select * from (select * ,row_number(order by (select 0 )) as rownum from test)t where t.rownum>=10 and t.rownum <=20
7.
[
Microsoft ][ODBC SQL Server Driver][SQL Server] will truncate string or binary data.
This problem is caused by the insufficient length of a field in the database design.
The solution is to
find the corresponding field. If a field inserted in the upload is too long, it is likely that this field produces an error.
Change the length of this field to varchar type and lengthen it!

8. When sqlserver inserts data to move table, it cannot be used
create table test select * from test1.
而要用
select * from test1 into test

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327003677&siteId=291194637