Skip to content

Instantly share code, notes, and snippets.

@BraveNewMath
BraveNewMath / TSQL-to-POCO
Last active November 15, 2015 09:49 — forked from joey-qc/TSQL-to-POCO
This fork lets you A) filter output tables, B) makes validation attributes optional, C) a prettier output. A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query again…
declare @GeneratePocoForTablesLike varchar(100) = '%' --Limit the POCO generation to specific table names
, @Tab CHAR(1) = CHAR(9)
, @IncludeValidationTags bit = 0 -- to output [Required] and maxLength validation attributes on properties
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
@BraveNewMath
BraveNewMath / index.htm
Created April 4, 2012 22:17
These are helper files for creating browsable wireframes for html and image files generated from Fireworks
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="X-UA-Compatible" value="IE=9" />
<title>Renters Mock UI</title>
<link rel="stylesheet" type="text/css" href="Resources/Styles/styles.css"/>
<script type="text/javascript" src="Resources/Scripts/jquery-1.7.1.min.js"></script>
<!--<script type="text/javascript" src="Resources/Scripts/jqHistory.js"></script>-->
<script type="text/javascript" src="Resources/Scripts/mockUI.js"></script>