Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: 149 | 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

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones