|
10 Feb 2010
Updated: 26 Apr 2010
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 11,561
Bookmarked: 5
Downloaded: 0
Assuming that a carriage return represents a line of code, this will count the lines of code in a SQL 2008 database:SELECT ROUTINE_NAME,ROUTINE_TYPE,LEN(ROUTINE_DEFINITION )-len(REPLACE(ROUTINE_DEFINITION,CHAR(10),'')) LOCFROM INFORMATION_SCHEMA.ROUTINESCOMPUTE...
|
SQL Server |
18 Nov 2009
Updated: 18 Nov 2009
Rating: 3.86/5
Votes: 4
Popularity: 2.32
Licence: CPOL
Views: 19,000
Bookmarked: 6
Downloaded: 0
Reparenting a Tree branch is a PITA using the HierarchyID functions. This reparents a branch by reformating the string representation of the HierarchyID. Supports moving the branch to the root node. I use an ID as the primary key so the proc expects the ID's of the node recordsDECLARE @NodeID INT
|
|
17 Mar 2010
Updated: 17 Mar 2010
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 27,370
Bookmarked: 1
Downloaded: 0
When grouping data within a List control I need a header table and child table. The data comes from 1 datatable where the 1st #n columns are duplicated for each detail rows.The usual answer to this is to set the hide duplicates value in the textbox. This suppresses the text but the row is...
|
SQL |
7 Sep 2009
Updated: 7 Sep 2009
Rating: 2.60/5
Votes: 3
Popularity: 1.24
Licence: CPOL
Views: 12,000
Bookmarked: 8
Downloaded: 0
Select dateadd(day, -1, dateadd(month, 1, dateadd(day, 1 - day(@Date), @Date))
|
|
18 Jul 2010
Updated: 18 Jul 2010
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 26,503
Bookmarked: 3
Downloaded: 0
Gets the last week day of the month
|
|
25 May 2010
Updated: 26 May 2010
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 16,560
Bookmarked: 3
Downloaded: 0
GetAncestor() requires a slightly unusual outlook to get the required results
|
|
11 Jul 2010
Updated: 14 Jul 2010
Rating: 4.09/5
Votes: 12
Popularity: 4.26
Licence: CPOL
Views: 35,601
Bookmarked: 13
Downloaded: 0
Why do developers insist on separate procedures to do these jobs
|