sql查询复制表&存储过程架构到另一个数据库 [英] sql query to copy tables & stored procedures schema into another database
本文介绍了sql查询复制表&存储过程架构到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
sql查询以复制表&
sql query to copy tables & stored procedures schema into another database and not tables data?
推荐答案
检查一下:
信息架构视图(Transact-SQL)
T-SQL:information_schema视图列表
Hi,
Check this out:
Information Schema Views (Transact-SQL)
T-SQL: List of information_schema views
--Tables
SELECT * FROM INFORMATION_SCHEMA.TABLES
--Columns
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
--Stored procedures
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE'
--Functions
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION'
您可以使用
You can use
SP_HELPTEXT Procedure_Or_Function_Name
来获取过程和函数的内容,但是也许有更好的方法.
希望对您有所帮助!
to get the contents of the procedures and functions, there''s maybe a better way though.
Hope it helps!
这篇关于sql查询复制表&存储过程架构到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文