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,388 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,388 reads
This proc generates SELECT, UPDATE, INSERT, and DELETE procs for any given table.
2008-01-02 (first published: 2007-11-08)
1,381 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
637 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
1,972 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,530 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,129 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
762 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,550 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
399 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,256 reads
Data analysis is all about wrangling massive datasets. To do that efficiently, you need...
By Rob Sewell
Make it easier for your audience to engage with you by connecting your site...
By Rayis Imayev
"Stories are where memories go when they are forgotten" - Doctor Who.(2024-Sep-13) As September quickly...
Comments posted to this topic are about the item GIT Configuration and Automated Release...
I have a Colum that outputs this data, depending on the Card Type: 0991719957291436|02|22|VISA|Visa|...
Comments posted to this topic are about the item Trigger Order III
I have created these triggers in SQL Server 2022:
CREATE TRIGGER triggertest_tri_1 ON dbo.triggertest FOR INSERT AS PRINT 'one' GO CREATE TRIGGER triggertest_tri_2 ON dbo.triggertest FOR INSERT AS PRINT 'two' GOI want to be sure that the trigger with "1" runs first. I decide to run this:
EXEC sp_settriggerorder@triggername = 'triggertest_tri_1', @order = 'first'What happens? See possible answers