ddl

Converting MySQL DDL to SQL Server DDL

坚强是说给别人听的谎言 提交于 2019-12-13 00:34:14
问题 I have a model that was generated for MySQL 5 but now I need to create these tables on a SQL Server installation. It's been years since I mucked with SQL server and I want to make sure I can convert this script to be compatible. I don't really know what to look for TBQH, so without further ado, here's my MySQL DDL CREATE SCHEMA IF NOT EXISTS `bof_survey` DEFAULT CHARACTER SET utf8 COLLATE default collation ; USE `bof_survey`; -- ----------------------------------------------------- -- Table

高可用数据库UDB主从复制延时的解决

╄→尐↘猪︶ㄣ 提交于 2019-12-12 16:18:36
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> MySQL主从复制的延时一直是业界困扰已久的问题。延时的出现会降低主从读写分离的价值,不利于数据实时性较高的业务使用MySQL。 UDB是UCloud推出的云数据库服务,上线已达六年,运营了数以万计的UDB MySQL实例。除了提供高可用、高性能、便捷易用的产品特性,团队还平均每天帮助用户解决2-3起MySQL实例主从复制延时的问题。从大量实践中我们总结了主从复制延时的各种成因和解决方法,现分享于此。 延时问题的重要性 主从复制机制广泛应用在UDB的内部实现中:UDB创建的从库和主库就采用了“主从复制”的数据复制;另外,UDB的主打产品“UDB MySQL高可用实例”,也是采用2个数据库互为主从的“双主模式”来进行数据复制,而双主模式的核心就是主从复制机制。 如果主从复制之间出现延时,就会影响主从数据的一致性。 在高可用复制场景下,我们在UDB高可用容灾设计上考虑到,若出现主备数据不一致的场景,默认是不允许进行高可用容灾切换的。因为在主备数据不一致的情况下,此时发生容灾切换,且在新的主库写入了数据,那么从业务角度上,会产生意想不到的严重后果。 复制延时问题,不仅在UDB高可用中会带来不良后果,在只读从库的场景下,若从库产生复制延时,也可能会对业务造成一定影响,比如在业务上表现为读写不一致——新增

How to increase mysql table comments length?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 11:35:19
问题 Seems like max table comments length in mysql is only 60 characters. I'm developing an aplicacion in php symfony, which automatically generates sql ddl sentences, and in many cases those comments are far beyond 60 characters. Is there some way to increase that limit? thanks a lot 回答1: As I know, it is impossible to make it by mysql standard means. Table comment length in MySQL 来源: https://stackoverflow.com/questions/2473934/how-to-increase-mysql-table-comments-length

What is the DDL to rename column in MSAccess?

跟風遠走 提交于 2019-12-12 10:45:44
问题 What is the DDL to rename a column in MS Access? Something along the lines of: alter table myTable rename col1 to col2 which does not work for MSAccess 2000 format databases. I'm using OLEDB or ADO.NET with a MSAccess 2000 format db but would be grateful of any hint at the syntax or a suggestion as to how to achieve this using ADO.NET in some other way. 回答1: I am at home and can't test this at the moment, but I think this should work. This site has information about it. ALTER TABLE thetable

Do statistics referencing a column prevent that column from being dropped?

笑着哭i 提交于 2019-12-12 08:22:22
问题 I'm trying a very simple drop column statement: alter table MyTable drop column MyColumn and receiving several errors along the lines of Msg 5074, Level 16, State 1, Line 1 The statistics '_dta_stat_1268251623_3_2' is dependent on column 'MyColumn'. followed ultimately by Msg 4922, Level 16, State 9, Line 1 ALTER TABLE DROP COLUMN MyColumn failed because one or more objects access this column. I didn't think statistics prevent a column from being dropped. Do they? If so, since these are

Generate table DDL via query on MySQL and SQL Server

北战南征 提交于 2019-12-12 07:39:31
问题 Is there an easy way to extract table DDL information, via a query, using either Ms or My SQL server? (preferably both?) For example, using MySQL Administrator / Navicat for MySql, there is a "DDL" function, which generates the "create table foo (....)" script. Is there any way to get this information from a query itself, such as: Select DDL from foo where table_name='bar'; Any have the "Create table bar (.....)" returned to me? If not - any suggestions? 回答1: it's mysql-specific, but SHOW

Create Postgres database using batch file with [template],[encoding],[owner] and a .sql file

余生颓废 提交于 2019-12-12 07:39:05
问题 I want to create a Postgres database using a batch file. Now the normal way of doing this is the following: "C:\Program Files\PostgreSQL\9.0\bin\createdb.exe" -U Myadmin MydatAbseName This script above creates a database with the default database parameters. However, I want to create a database with the following parameters, as follows: WITH OWNER = Myadmin TEMPLATE = template0 ENCODING = 'SQL_ASCII' TABLESPACE = pg_default LC_COLLATE = 'C' LC_CTYPE = 'C' CONNECTION LIMIT = -1; Please tell me

How to get DDL for database objects shared to other user?

不羁岁月 提交于 2019-12-12 03:23:23
问题 We are working on extracting database DDL of Sybase ASE 15.5 version. We have one sample created in java that execute ddl commands. We got ddl using ddlgen utility provided by Sybase with commands : java -cp "mypath/lib/jconn4.jar;mypath/lib/dsparser.jar;mypath/lib/DDLGen.jar" com.sybase.ddlgen.DDLGenerator -Usa -Pmypassword -S192.123.13.111:5000 -Dmaster Above command generate DDL for all database objects exist in user sa , also we get list of objects shared to other user by user sa as :

How do you create a table with Sqlalchemy within a transaction in Postgres?

与世无争的帅哥 提交于 2019-12-12 03:03:19
问题 I'm using Sqlalchemy in a multitenant Flask application and need to create tables on the fly when a new tenant is added. I've been using Table.create to create individual tables within a new Postgres schema (along with search_path modifications) and this works quite well. The limitation I've found is that the Table.create method blocks if there is anything pending in the current transaction. I have to commit the transaction right before the .create call or it will block. It doesn't appear to

Sequence in Oracle/PostgreSQL with no ID in insert statement

梦想的初衷 提交于 2019-12-12 02:32:07
问题 I'm try to create table with clever sequence generator for using this insert-strucure: insert into SOMEUSERS (SOMEUSERS_NAME, SOMEUSERS_PASSWORD) values ('Artem', 'PracTimPatie'); instead of this: insert into SOMEUSERS (SOMEUSERS_ID, SOMEUSERS_NAME, SOMEUSERS_PASSWORD) values (2, 'Artem', 'PracTimPatie'); or this structure: insert into SOMEUSERS (SOMEUSERS_ID, SOMEUSERS_NAME, SOMEUSERS_PASSWORD) values (GEN_ID_SOMEUSERS.nextval, 'Artem', 'PracTimPatie'); When I executing the following sql