免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 14498 | 回复: 11
打印 上一主题 下一主题

sybase批量建表 [复制链接]

论坛徽章:
1
戌狗
日期:2014-08-05 13:32:44
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-12-10 15:04 |只看该作者 |倒序浏览
类似Mysql  导入批量建表文件 sql>source filename.sql
类似oracle 导入批量建表文件 sql>@filename.sql

那sybase是怎么实现的呢

论坛徽章:
1
2 [报告]
发表于 2013-12-10 18:29 |只看该作者
将你的建表的建成一个SQL脚本,isql到sybase,执行你的脚本就可以了

论坛徽章:
0
3 [报告]
发表于 2013-12-10 19:47 |只看该作者
isql -U username -P password   -i  sql_filename.sql

论坛徽章:
1
戌狗
日期:2014-08-05 13:32:44
4 [报告]
发表于 2013-12-11 13:11 |只看该作者
谢谢。。 回复 3# mission_g


   

论坛徽章:
1
5 [报告]
发表于 2013-12-11 16:13 |只看该作者
回复 4# deelaaay


    迁移进度怎么样了?

论坛徽章:
1
戌狗
日期:2014-08-05 13:32:44
6 [报告]
发表于 2013-12-12 16:54 |只看该作者
sql语句跟存储过程全部转完了,全部手工操作的。。现在在修改插入语句。出现很多问题,比方说在Sybase里字段默认是非空的,插入空值的时候提示错误(已解决),现在在查text类型赋Null的问题。还没有时间去整本地客户端连接linux下的sybase回复 5# Anxiang1129


   

论坛徽章:
0
7 [报告]
发表于 2013-12-12 17:35 |只看该作者
比方说在Sybase里字段默认是非空的,插入空值的时候提示错误(已解决),
-----------------------


其实ASE是由这个功能的

sp_dboption "db_name","allow nulls by default", true


allow nulls by default
Setting allow nulls by default to true changes the default null type of a column from not null to null, in compliance with the SQL standard. The Transact-SQL default value for a column is not null, meaning that null values are not allowed in a column unless null is specified in the create table or alter table column definition.

You cannot use allow nulls by default to change the nullibility of a column during select into statements. Instead, use convert() to specify the nullibility of the resulting columns.

论坛徽章:
0
8 [报告]
发表于 2013-12-12 17:37 |只看该作者
还没有时间去整本地客户端连接linux下的sybase
-----
如果没有特殊设置,比如ssl, ldap server, kerberos server 的话,一般只需要字符集的问题即可.

论坛徽章:
1
9 [报告]
发表于 2013-12-12 17:50 |只看该作者
回复 6# deelaaay


    Good luck!

论坛徽章:
1
戌狗
日期:2014-08-05 13:32:44
10 [报告]
发表于 2013-12-13 10:50 |只看该作者
到今天位置所有的sql语句全部整完了。接下来,就是实现客户端连接,以及主从复制了。回复 9# Anxiang1129


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP