C#网页版代码生成器
C#网页版代码生成器,还在更新中....以前修复过ASPNETPAGER分页控件的网页版存储过程代码生成器,学到了一种思维,替换字符串,因此有空就写下了这个。仅供参考,本人水平还有待提高,写这个完全是兴趣,写的不好的地方不要骂我就行,呵呵。
存储过程代码如下,参考MSSQL SERVER文档。
存储过程代码
1
2 ALTER proc [dbo].[GetTablesFromDatabase]
3 @dataBaseName nvarchar(200)
4 as
5 declare @sql nvarchar(2000);
6 set @sql=SELECT TABLE_CATALOG as "数据库", TABLE_SCHEMA as "表架构" , TABLE_NAME as "表名" ,TABLE_TYPE as "表类型" FROM INFORMATION_SCHEMA.TABLES
7 where TABLE_CATALOG=N+@dataBaseName+ order by TABLE_NAME ; --get the role !
8 --SELECT * FROM INFORMATION_SCHEMA.TABLES
9 --where TABLE_CATALOG=TestSub --get the schema from databse
10 exec(@sql);
11 print(@sql);
12
13 ALTER proc [dbo].[GetColumnsFromTable]
14 @dataBaseName nvarchar(200),
15 @tableName nvarchar(200)
16 as
17 declare @dataBase nvarchar(200);
18 set @dataBase=rtrim(@dataBaseName)+.INFORMATION_SCHEMA.COLUMNS;
19 declare @sql nvarchar(2000);
20 --set @sql=SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_DEFAULT
21 --FROM +@dataBaseName+.INFORMATION_SCHEMA.COLUMNS
22 --WHERE TABLE_NAME =N+@tableName+;
23 set @sql=SELECT TABLE_CATALOG as "数据库", TABLE_SCHEMA as "表架构" , TABLE_NAME as "表名", COLUMN_NAME as "列名",DATA_TYPE as "列数据类型"
24 FROM +@dataBase
25 + WHERE TABLE_NAME =N+@tableName+
2 ALTER proc [dbo].[GetTablesFromDatabase]
3 @dataBaseName nvarchar(200)
4 as
5 declare @sql nvarchar(2000);
6 set @sql=SELECT TABLE_CATALOG as "数据库", TABLE_SCHEMA as "表架构" , TABLE_NAME as "表名" ,TABLE_TYPE as "表类型" FROM INFORMATION_SCHEMA.TABLES
7 where TABLE_CATALOG=N+@dataBaseName+ order by TABLE_NAME ; --get the role !
8 --SELECT * FROM INFORMATION_SCHEMA.TABLES
9 --where TABLE_CATALOG=TestSub --get the schema from databse
10 exec(@sql);
11 print(@sql);
12
13 ALTER proc [dbo].[GetColumnsFromTable]
14 @dataBaseName nvarchar(200),
15 @tableName nvarchar(200)
16 as
17 declare @dataBase nvarchar(200);
18 set @dataBase=rtrim(@dataBaseName)+.INFORMATION_SCHEMA.COLUMNS;
19 declare @sql nvarchar(2000);
20 --set @sql=SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_DEFAULT
21 --FROM +@dataBaseName+.INFORMATION_SCHEMA.COLUMNS
22 --WHERE TABLE_NAME =N+@tableName+;
23 set @sql=SELECT TABLE_CATALOG as "数据库", TABLE_SCHEMA as "表架构" , TABLE_NAME as "表名", COLUMN_NAME as "列名",DATA_TYPE as "列数据类型"
24 FROM +@dataBase
25 + WHERE TABLE_NAME =N+@tableName+
补充:软件开发 , C# ,
上一个:使用委托进行异步编程
下一个:栈的应用_表达式求值_C#实现
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,
部分文章来自网络,