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,396 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,396 reads
This proc generates SELECT, UPDATE, INSERT, and DELETE procs for any given table.
2008-01-02 (first published: 2007-11-08)
1,383 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,049 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,568 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,563 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,259 reads
Oftentimes there is a need to retrieve different types of the same object (e.g. contacts). For example, in a Contacts database, you might have a Contact table containing many different types of contacts (employees, customers, suppliers, etc). Typically, a user might need to see a report of all different types of contacts for an order […]
2003-07-18
713 reads
This month, I prompted bloggers to discuss whether good enough is perfect. Thank you to all...
By Steve Jones
Recently a customer asked if SQL Compare and SQL Data Compare can be used...
i see this in the definition of a linked server on our wh sql...
Is this even possible ? Tried with grant but to no avail. [sys].[database_role_members] and...
Comments posted to this topic are about the item Stairway to Snowflake Level 5...
What does this code return in SSMS 20 from SQL Server 2019?
select '|' + CHAR(0)+'abc' + '|';See possible answers