zoukankan
html css js c++ java
SQL Server 根据表名创建实体类的字段和属性
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: <shipeng.wang> -- Create date: <2009-09-11> -- Description: <根据表名创建实体类的字段和属性> -- ============================================= ALTER proc [dbo].[p_Wsp] @tablename varchar(50) as declare @sql varchar(8000) select @sql=isnull(@sql+char(9)+'private ','public class '+@tablename+char(13)+'{'+char(13)+char(9)+'private ')+ case when a.name in('image','uniqueidentifier','ntext','varchar','ntext','nchar','nvarchar','text','char') then 'string' when a.name in('tinyint','smallint','int','bigint') then 'int' when a.name in('datetime','smalldatetime') then 'DateTime' when a.name in('float','decimal','numeric','money','real','smallmoney') then 'decimal' when a.name ='bit' then 'bool' else a.name end+' '+lower('_'+b.name)+';'+char(13)+char(9)+'public '+ case when a.name in('image','uniqueidentifier','ntext','varchar','ntext','nchar','nvarchar','text','char') then 'string' when a.name in('tinyint','smallint','int') then 'int' when a.name='bigint' then 'long' when a.name in('datetime','smalldatetime') then 'DateTime' when a.name in('float','decimal','numeric','money','real','smallmoney') then 'decimal' when a.name ='bit' then 'bool' else a.name end +' '+b.name+char(13)+char(9)+'{'+char(13)+char(9)+char(9)+'get{return '+lower('_'+b.name)+';}'+ char(13)+char(9)+char(9)+'set{'+lower('_'+b.name)+'=value;}'+char(13)+char(9)+'}'+char(13) from syscolumns b, (select distinct name,xtype from systypes where status=0) a where a.xtype=b.xtype and b.id=object_id(@tablename) set @sql=@sql+'}' print @sql
查看全文
相关阅读:
Android Studio --“Cannot resolve symbol” 解决办法
js与android webview交互
关于post与get请求参数存在特殊字符问题
Fragment 学习笔记(1)
Android Studio 错误集
UVA
UVA
UVALive
考试题string——线段树。
洛谷 1552 [APIO2012]派遣
原文地址:https://www.cnblogs.com/javawebsoa/p/2458205.html
最新文章
bzoj 2243: [SDOI2011]染色
<nginx+PHP>nginx环境下配置支持php7
MySQL5.7导入数据报错ERROR 1067 (42000) at line 1015: Invalid default value for 'service_time'
nginx访问量统计
U盘安装CentOS7的最终解决方案
redis安装优化:
Vmware ESXi 6.0 多Vlan部署,vSphere Client管理方法
mysql触发器学习
如何使用curl命令指定ip访问url
运维必备技能 WEB 日志分析
热门文章
以V8中js源码为例了解GitHub查看代码功能
js中的自动包装机制
js中的new操作符解析
关于三层架构和MVC模式的思考
JS获取对象属性名小结
Vue实践TS中的一些常见错误解决方案
NodeJS模块和ES6模块系统语法及注意点
CSS选择器分类整理
Koa帮我们做了什么
Echarts数据更新大坑
Copyright © 2011-2022 走看看