我需要将SQL Server management studio express 2005中的Database Schema导出到MSExcel中吗?生成脚本给我的脚本。但我需要Excel文件包含数据库架构。我如何处理SQL Server management studio express 2005?
答案 0 :(得分:-1)
您可以使用此脚本获取所有表格数据,并将结果复制粘贴到Excel文件中:
SELECT o.name AS TableName
, c.name AS ColumnName
, t.name AS DataType
, c.Max_Length
, c.Precision
, c.Scale
FROM sys.objects AS o
INNER JOIN sys.columns AS c ON o.object_id = c.object_id
INNER JOIN sys.types AS t ON c.user_type_id = t.user_type_id
WHERE type = 'U'
ORDER BY
o.name
, c.name
答案 1 :(得分:-2)
不幸的是我对SQL Server 2005并不太熟悉 导入导出向导怎么样? 该向导应该可以选择目标类型