如何通过查询获取表ddl [英] How to get Table ddl Via Query

查看:742
本文介绍了如何通过查询获取表ddl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



可以帮助我获取sybase中现有表和索引的ddl。

我们可以使用




can any one help me to get the ddl of the already existing table and index in sybase.
we can use

SELECT c.text From syscomments c, sysobjects o Where o.id=c.id and o.name=@procname Order By c.colid





获取触发器,程序和视图的脚本..但是对于表它不工作。是否有可用于表和索引的系统程序?



提前谢谢



to get the Scripts for triggers, procedures and view.. but for table it is not working. is there any system procedures available for table and index?

Thank you in advance

推荐答案

试试这个:

Try this:
SELECT *
FROM   sys.sql_modules sm
WHERE  sm.definition LIKE '%ObjectName%'


这篇关于如何通过查询获取表ddl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆