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,416 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,416 reads
This proc generates SELECT, UPDATE, INSERT, and DELETE procs for any given table.
2008-01-02 (first published: 2007-11-08)
1,386 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
642 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,121 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,592 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
765 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,609 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
403 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,264 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
745 reads
By Steve Jones
I was asked to do some a little thinking and brainstorming recently. Rather than...
By alevyinroc
It seems like no matter how long you work with a system beyond a...
By Steve Jones
I started a short thread on Twitter/X and Bluesky recently after leaving the Tesla...
hi i imported a tabular model from production into vs 2022, changed the data...
Hi I have just installed again on win 11 sql server express 2022 with...
Comments posted to this topic are about the item Understanding Bit Manipulation Functions: BIT_COUNT,...
I have a complex database with a few filegroups and files. Can I run a backup command like this? (assume file/filegroup names are valid).
BACKUP DATABASE [complex] FILE = N'thirdone' , FILE = N'thirdtwo' , FILEGROUP = N'second' TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL16.SQL2022\MSSQL\Backup\complex.bak' WITH NOFORMAT, NOINIT, NAME = N'complex-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GOSee possible answers