答案 0 :(得分:3)
我已经从SP_HELP
的定义中获取了一些代码供参考,这里有些东西可以帮到你,但你仍然必须手动复制excel中的数据:
select
'Table_name' = ao.name,
'Column_name' = ac.name,
'Type' = type_name(user_type_id),
'Computed' = case when ColumnProperty(ac.object_id, ac.name, 'IsComputed') = 0 then 'no' else 'yes' end,
'Length' = convert(int, max_length),
-- for prec/scale, only show for those types that have valid precision/scale
-- Search for type name + ',', because 'datetime' is actually a substring of 'datetime2' and 'datetimeoffset'
'Prec' = case when charindex(type_name(system_type_id) + ',', N'tinyint,smallint,decimal,int,bigint,real,money,float,numeric,smallmoney,date,time,datetime2,datetimeoffset,') > 0
then convert(char(5),ColumnProperty(ac.object_id, ac.name, 'precision'))
else ' ' end,
'Scale' = case when charindex(type_name(system_type_id) + ',', N'tinyint,smallint,decimal,int,bigint,real,money,float,numeric,smallmoney,date,time,datetime2,datetimeoffset,') > 0
then convert(char(5),OdbcScale(system_type_id,scale))
else ' ' end,
'Nullable' = case when is_nullable = 0 then 'no' else 'yes' end,
'TrimTrailingBlanks' = case ColumnProperty(ac.object_id, ac.name, 'UsesAnsiTrim')
when 1 then 'no'
when 0 then 'yes'
else '(n/a)' end,
'FixedLenNullInSource' = case
when type_name(system_type_id) not in ('varbinary','varchar','binary','char')
then '(n/a)'
when is_nullable = 0 then 'no' else 'yes' end,
'Collation' = collation_name
from sys.all_columns ac
INNER JOIN sys.all_objects ao
ON ac.object_id = ao.object_id and ao.type = N'U'
ORDER BY ao.object_id, ac.column_id
答案 1 :(得分:0)
string jsFunc = "alert(" + Session["TerminalID"] + ")";
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "myJsFn", jsFunc , true);