Generate C# class code for table
For any supplied table, my proc, usp_TableToClass, generates class code in C#, including fields, properties, getters and setters.
2013-12-24 (first published: 2007-11-06)
12,410 reads
For any supplied table, my proc, usp_TableToClass, generates class code in C#, including fields, properties, getters and setters.
2013-12-24 (first published: 2007-11-06)
12,410 reads
This proc generates SELECT, UPDATE, INSERT, and DELETE procs for any given table.
2008-01-02 (first published: 2007-11-08)
1,384 reads
This procedure, sp_who3, is based on the system-supplied sp_who2, but is modified to return the actual text of the commands executed by each spid. Very helpful for troubleshooting! In addition, I have added a @hostname parameter to allow the user the option of viewing activity originating from only one computer, if desired.
2004-05-06
640 reads
IP addresses are represented as xxx.xxx.xxx.xxx, where xxx is an integer between 0 and 255. Each three-digit integer is called an octet, and all IP addresses comprise four octets.Help-desk applications and administrative tools often store the IP addresses for a company's PCs in a database. An IP address can be represented either as a single […]
2004-02-25
2,070 reads
sp_ExecVBScript allows you to execute either a .vbs file or an ad-hoc VBScript command within a T-SQL batch. Note that the command (whether it be ad-hoc or contained in the .vbs file) cannot have any code that requires user input (such as Input Boxes or Message Boxes).
2003-11-05
7,579 reads
New Author! This is a great walkthrough that starts out with a description of the problem and goes all the way to the solution - all using TSQL.
2003-10-30
12,131 reads
Here is a revised version of the crosstab query I submitted last week. This new version avoids the WHILE loop (which was used in my pervious version) and is thus COMPLETELY SET-ORIENTED for better performance.
2003-10-03
763 reads
Crosstab queries (also called "pivot tables") in which you know beforehand the number of column values to aggregate by, can easily be performed in T-SQL using CASE statements wrapped in the SUM function. Where things get tricky, however, is when you don't know how many aggregation values exist, and you are required to write a […]
2003-09-26
3,582 reads
SQL Server includes the COUNT function for counting a table's rows - however, it can be slow. Although querying the "rows" column from the sysindexes table is faster, it is not always accurate (e.g., if a bulk load process has recently taken place). In addition, you would not be able to use this method in […]
2003-09-11
401 reads
SQL 2000's sp_MSForEachDB and sp_MSForEachTable are useful procedures for performing operations against multiple objects; however, they aren't always extremely efficient, because internally they use cursors to do their work.These 2 sprocs, sp_ForEachDB and sp_ForEachTable, perform many of the same tasks as their Microsoft-shipped twins, but run faster because they dynamically build the SQL string without […]
2003-08-19
2,260 reads
By Steve Jones
This is my last week of the year working (I guess I come back...
By Steve Jones
suente– n. the state of being so familiar with someone that you can be...
Anyone (everyone?) who has ever tried to learn a programming language knows that to...
Udaipur, Rajasthan, is a popular wedding destination known for its regal palaces, serene lakes,...
I am getting the below error when I execute a SQL command in SQL...
I am getting the below error when I execute a SQL command in SQL...