Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Create property methods for fields using query

By snthampi,

Probably, many of you know this trick, but I thought it might be useful to people who doesn't know it. This script, when run in query analyzer with text output selected, simply creates property methods code. This example is written for creating property methods for c#. But you can modify it for any language. The only benefit of this script is that it saves a lot of time, when you have to write property methods for a class that has too many properties (fields). You have to add cases for all the data types that your table uses.

Total article views: 151 | Views in the last 30 days: 1
 
Related Articles
FORUM

PowerShell detailed reference

Command and object properties & methods

FORUM

DateTime properties and methods

To put today's date in an expression you type 'datetime.today'. How do you express this date last ye...

FORUM

database properties not accessing

database properties not accessing

FORUM

Adding identity property on primary key column

Adding identity property on primary key column

FORUM

MDX Member properties

Return member properties

Tags
miscellaneous    
 
Contribute