Wednesday, October 31, 2007

Tuesday, October 30, 2007

Check If Auto Update Statistics Is Enabled With DATABASEPROPERTY

How do you check if auto update statistics is enabled on your database? It is pretty easy to check that, you can use the DATABASEPROPERTY function
Run the following line of code

SELECT DATABASEPROPERTY('pubs','IsAutoUpdateStatistics') AS IsAutoUpdateStatistics

If 1 is returned(true) it is enabled, if 0 is returned(false) then it is not enabled

Now to save me (and you) time I have pasted a code block below with all the properties, just change the database name from pubs to your database name and run the code


DECLARE @v VARCHAR(55)
SELECT @v = 'pubs'

SELECT
DATABASEPROPERTY(@v,'IsAnsiNullDefault') AS IsAnsiNullDefault,
DATABASEPROPERTY(@v,'IsAnsiNullsEnabled') AS IsAnsiNullsEnabled,
DATABASEPROPERTY(@v,'IsAnsiWarningsEnabled') AS IsAnsiWarningsEnabled,
DATABASEPROPERTY(@v,'IsAutoClose') AS IsAutoClose,
DATABASEPROPERTY(@v,'IsAutoCreateStatistics') AS IsAutoCreateStatistics,
DATABASEPROPERTY(@v,'IsAutoShrink') AS IsAutoShrink,
DATABASEPROPERTY(@v,'IsAutoUpdateStatistics') AS IsAutoUpdateStatistics,
DATABASEPROPERTY(@v,'IsBulkCopy') AS IsBulkCopy,
DATABASEPROPERTY(@v,'IsDboOnly') AS IsDboOnly,
DATABASEPROPERTY(@v,'IsDetached') AS IsDetached,
DATABASEPROPERTY(@v,'IsEmergencyMode') AS IsEmergencyMode,
DATABASEPROPERTY(@v,'IsInLoad') AS IsInLoad,
DATABASEPROPERTY(@v,'IsInRecovery') AS IsInRecovery,
DATABASEPROPERTY(@v,'IsAutoClose') AS IsAutoClose,
DATABASEPROPERTY(@v,'IsInStandBy') AS IsInStandBy,
DATABASEPROPERTY(@v,'IsLocalCursorsDefault') AS IsLocalCursorsDefault,
DATABASEPROPERTY(@v,'IsNotRecovered') AS IsNotRecovered,
DATABASEPROPERTY(@v,'IsNullConcat') AS IsNullConcat,
DATABASEPROPERTY(@v,'IsOffline') AS IsOffline,
DATABASEPROPERTY(@v,'IsQuotedIdentifiersEnabled') AS IsQuotedIdentifiersEnabled,
DATABASEPROPERTY(@v,'IsReadOnly') AS IsReadOnly,
DATABASEPROPERTY(@v,'IsRecursiveTriggersEnabled') AS IsRecursiveTriggersEnabled,
DATABASEPROPERTY(@v,'IsShutDown') AS IsShutDown,
DATABASEPROPERTY(@v,'IsSingleUser') AS IsSingleUser,
DATABASEPROPERTY(@v,'IsSuspect') AS IsSuspect,
DATABASEPROPERTY(@v,'IsTruncLog') AS IsTruncLog,
DATABASEPROPERTY(@v,'Version') AS Version

So what do all these values mean? Here is a list of all the properties

IsAnsiNullDefault
Database follows SQL-92 rules for allowing null values.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsAnsiNullsEnabled
All comparisons to a null evaluate to unknown.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsAnsiWarningsEnabled
Error or warning messages are issued when standard error conditions occur.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsAutoClose
Database shuts down cleanly and frees resources after the last user exits.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsAutoCreateStatistics
Existing statistics are automatically updated when the statistics become out-of-date because the data in the tables has changed.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsAutoShrink
Database files are candidates for automatic periodic shrinking.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsAutoUpdateStatistics
Auto update statistics database option is enabled.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsBulkCopy
Database allows nonlogged operations.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsCloseCursorsOnCommitEnabled
Cursors that are open when a transaction is committed are closed.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsDboOnly
Database is in DBO-only access mode.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsDetached
Database was detached by a detach operation.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsEmergencyMode
Emergency mode is enabled to allow suspect database to be usable.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsFulltextEnabled
Database is full-text enabled.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsInLoad
Database is loading.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsInRecovery
Database is recovering.
1 = TRUE
0 = FALSE
NULL1 = Invalid input

IsInStandBy
Database is online as read-only, with restore log allowed.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsLocalCursorsDefault
Cursor declarations default to LOCAL.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsNotRecovered
Database failed to recover.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsNullConcat
Null concatenation operand yields NULL.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsOffline
Database is offline.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsQuotedIdentifiersEnabled
Double quotation marks can be used on identifiers.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsReadOnly
Database is in a read-only access mode.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsRecursiveTriggersEnabled
Recursive firing of triggers is enabled.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsShutDown
Database encountered a problem at startup.
1 = TRUE
0 = FALSE
NULL1 = Invalid input

IsSingleUser
Database is in single-user access mode.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsSuspect
Database is suspect.
1 = TRUE
0 = FALSE
NULL = Invalid input

IsTruncLog
Database truncates its logon checkpoints.
1 = TRUE
0 = FALSE
NULL = Invalid input

Version
Internal version number of the Microsoft® SQL Server™ code

Microsoft Unveils Vision and Road Map to Simplify SOA, Bridge Software Plus Services, and Take Composite Applications Mainstream

Attendees gathered at the fifth annual Microsoft SOA & Business Process Conference today, where the company shared its vision and road map to simplify the effort required to design, build, deploy and manage composite applications within and across organizations. Microsoft Corp. announced “Oslo,” the code name for the set of technical investments that help customers realize this vision.

This multiyear, multiproduct effort utilizes the company’s top engineering talent to build on the model-driven and service-enabled principles of Microsoft Dynamic IT (http://www.microsoft.com/presspass/press/2007/jun07/06-04TechED07PR.mspx ) and extend the benefits of service-oriented architecture (SOA) beyond the firewall. The “Oslo” technology innovations further Microsoft software-plus-services efforts by providing extensions to the application platform to help developers bridge between on-premise and off-premise projects. As part of a technical road map, Microsoft made available new tools and guidance to help organizations take advantage of “real-world SOA” today, including new SOA resources from Microsoft and a host of industry partners.

“Many customers are challenged to realize the promise of SOA given today’s complexities,” said Jeff Raikes, president of Microsoft Business Division. “The combination of our current software-plus-services approach and the new wave of ‘Oslo’ technologies will enable IT to deliver high-impact business solutions.”

Today, applications cannot easily span the boundaries between technologies, between business and IT, and between an organization, its suppliers and its customers. Microsoft’s continued investments in SOA and business-process management (BPM) technologies will help customers better connect across these boundaries using a service-oriented and model-driven approach. As part of “Oslo,” Microsoft will work to deliver a unified platform integrating services and modeling, moving from a world where models describe the application to a world where models are the application.

“It’s time to help developers and IT professionals extend the capabilities of SOA to address the new ‘blended’ world of software plus services and cross-boundary collaboration,” said Robert Wahbe, corporate vice president of the Connected Systems Division at Microsoft. “‘Oslo’ will enable a new class of applications that are connected and streamlined — from design through deployment — reducing complexity, aligning the enterprise and Internet, and simplifying interoperability and management.”

At the conference today, Microsoft also demonstrated an upcoming community technology preview of Microsoft BizTalk Services (http://labs.biztalk.net/default.aspx), featuring additional support for interoperability, Web 2.0 services, identity standards and workflow in the cloud.

Building on the technology available today, the “Oslo” advancements will be delivered through Microsoft server and tools products in five key areas:

Server. Microsoft BizTalk Server “6” will continue to provide a core foundation for distributed and highly scalable SOA and BPM solutions, and deliver the capability to develop, manage and deploy composite applications.

Services. BizTalk Services “1” will offer a commercially supported release of Web-based services enabling hosted composite applications that cross organizational boundaries. This release will include advanced messaging, identity and workflow capabilities.

Framework. The Microsoft .NET Framework “4” release will further enable model-driven development with Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF).

Tools. New technology planned for Visual Studio “10” will make significant strides in end-to-end application life-cycle management through new tools for model-driven design of distributed applications.

Repository. There will also be investments in aligning the metadata repositories across the Server and Tools product sets. Microsoft System Center “5,” Visual Studio “10” and BizTalk Server “6” will utilize a repository technology for managing, versioning and deploying models.


Customers are realizing the benefits of Microsoft’s real-world approach to SOA and vision by employing today’s technology, including BizTalk Server and BizTalk Services, along with the upcoming .NET Framework and Visual Studio. On Feb. 27, 2008, Microsoft will continue the wave of innovation by also launching Windows Server 2008, .NET Framework 3.5, and Microsoft SQL Server 2008.

Reinforcing their commitment to SOA, Microsoft, Accenture and Avanade recently announced the Accenture and Avanade Solutions Showcase, located on Microsoft’s corporate campus. This Solutions Showcase highlights the power of SOA while offering customers customized solutions in areas such as the next-generation workplace, infrastructure optimization and business intelligence. The first solution to be developed in conjunction with the new Solutions Showcase, a human resources (HR) solution that helps organizations quickly and efficiently bring on board new employees, was demonstrated during Robert Wahbe’s keynote address at the Microsoft SOA & BPM Conference.

“The Solutions Showcase illustrates the benefits of bringing together the technology skills and industry expertise of Accenture, Avanade and Microsoft in a single location,” said Paul


Daugherty, chief architect for Accenture. “Our customers are always looking to extract more value from their application development investments and can benefit from this joint innovation as they develop mission critical-solutions on the Microsoft platform.”

Customers and partners can visit the new Microsoft SOA and Business Process Solution Center at http://www.microsoft.com/soa for additional information and resources, including patterns and practices based on the most successful customer implementations.

Friday, October 26, 2007

Rhino Mocks 3.3 Released

Rhino Mocks 3.3 has been released.

Bug Fixes:
Fixing inconsistency in how Is.Equals handled ICollection instances, now it will compare them by their values, not their Equals()
Fixing NASTY bug where setup result that were defined in a using(mocks.Ordered()) block were not registered properly.

Improvements:
Changing error message to "are you calling a virtual (C#) / Overridable (VB) method?" - make it friendlier to VB guys.
Exception for Record will not trigger a ReplayAll(), which can mask the exception.
Adding a check for running on Mono to avoid calling Marshal.GetExceptionCode in that case.

New features:
Adding support for calling void methods using Expect.Call
Adding remoting proxies.
Made IMethodOptions generic. Allows compile time type safety on Return.
Adding a PublicFieldConstraint

Download it here: http://www.ayende.com/projects/rhino-mocks/downloads.aspx

Wednesday, October 24, 2007

C# 3.0 language specifications available for download

Get it here: http://download.microsoft.com/download/3/8/8/388e7205-bc10-4226-b2a8-75351c669b09/csharp%20language%20specification.doc

The document contains 503 pages.

Table of Contents
1. Introduction 1
1.1 Hello world 1
1.2 Program structure 2
1.3 Types and variables 4
1.4 Expressions 6
1.5 Statements 8
1.6 Classes and objects 12
1.6.1 Members 12
1.6.2 Accessibility 13
1.6.3 Type parameters 13
1.6.4 Base classes 14
1.6.5 Fields 14
1.6.6 Methods 15
1.6.6.1 Parameters 15
1.6.6.2 Method body and local variables 16
1.6.6.3 Static and instance methods 17
1.6.6.4 Virtual, override, and abstract methods 18
1.6.6.5 Method overloading 20
1.6.7 Other function members 21
1.6.7.1 Constructors 22
1.6.7.2 Properties 23
1.6.7.3 Indexers 23
1.6.7.4 Events 24
1.6.7.5 Operators 24
1.6.7.6 Destructors 25
1.7 Structs 25
1.8 Arrays 26
1.9 Interfaces 27
1.10 Enums 29
1.11 Delegates 30
1.12 Attributes 31

2. Lexical structure 33
2.1 Programs 33
2.2 Grammars 33
2.2.1 Grammar notation 33
2.2.2 Lexical grammar 34
2.2.3 Syntactic grammar 34
2.3 Lexical analysis 34
2.3.1 Line terminators 35
2.3.2 Comments 35
2.3.3 White space 37
2.4 Tokens 37
2.4.1 Unicode character escape sequences 37
2.4.2 Identifiers 38
2.4.3 Keywords 40
2.4.4 Literals 40
2.4.4.1 Boolean literals 40
2.4.4.2 Integer literals 40
2.4.4.3 Real literals 42
2.4.4.4 Character literals 42
2.4.4.5 String literals 43
2.4.4.6 The null literal 45
2.4.5 Operators and punctuators 45
2.5 Pre-processing directives 45
2.5.1 Conditional compilation symbols 47
2.5.2 Pre-processing expressions 47
2.5.3 Declaration directives 48
2.5.4 Conditional compilation directives 49
2.5.5 Diagnostic directives 51
2.5.6 Region directives 52
2.5.7 Line directives 52
2.5.8 Pragma directives 53
2.5.8.1 Pragma warning 53

3. Basic concepts 55
3.1 Application Startup 55
3.2 Application termination 56
3.3 Declarations 56
3.4 Members 58
3.4.1 Namespace members 59
3.4.2 Struct members 59
3.4.3 Enumeration members 59
3.4.4 Class members 59
3.4.5 Interface members 60
3.4.6 Array members 60
3.4.7 Delegate members 60
3.5 Member access 60
3.5.1 Declared accessibility 60
3.5.2 Accessibility domains 61
3.5.3 Protected access for instance members 63
3.5.4 Accessibility constraints 64
3.6 Signatures and overloading 65
3.7 Scopes 66
3.7.1 Name hiding 69
3.7.1.1 Hiding through nesting 69
3.7.1.2 Hiding through inheritance 70
3.8 Namespace and type names 71
3.8.1 Fully qualified names 73
3.9 Automatic memory management 74
3.10 Execution order 76

4. Types 79
4.1 Value types 79
4.1.1 The System.ValueType type 80
4.1.2 Default constructors 80
4.1.3 Struct types 81
4.1.4 Simple types 81
4.1.5 Integral types 82
4.1.6 Floating point types 83
4.1.7 The decimal type 84
4.1.8 The bool type 85
4.1.9 Enumeration types 85
4.1.10 Nullable types 85
4.2 Reference types 86
4.2.1 Class types 86
4.2.2 The object type 87
4.2.3 The string type 87
4.2.4 Interface types 87
4.2.5 Array types 87
4.2.6 Delegate types 87
4.3 Boxing and unboxing 88
4.3.1 Boxing conversions 88
4.3.2 Unboxing conversions 89
4.4 Constructed types 90
4.4.1 Type arguments 91
4.4.2 Open and closed types 91
4.4.3 Bound and unbound types 91
4.4.4 Satisfying constraints 91
4.5 Type parameters 92
4.6 Expression tree types 93

5. Variables 95
5.1 Variable categories 95
5.1.1 Static variables 95
5.1.2 Instance variables 95
5.1.2.1 Instance variables in classes 96
5.1.2.2 Instance variables in structs 96
5.1.3 Array elements 96
5.1.4 Value parameters 96
5.1.5 Reference parameters 96
5.1.6 Output parameters 97
5.1.7 Local variables 97
5.2 Default values 98
5.3 Definite assignment 98
5.3.1 Initially assigned variables 99
5.3.2 Initially unassigned variables 99
5.3.3 Precise rules for determining definite assignment 99
5.3.3.1 General rules for statements 100
5.3.3.2 Block statements, checked, and unchecked statements 100
5.3.3.3 Expression statements 100
5.3.3.4 Declaration statements 101
5.3.3.5 If statements 101
5.3.3.6 Switch statements 101
5.3.3.7 While statements 101
5.3.3.8 Do statements 102
5.3.3.9 For statements 102
5.3.3.10 Break, continue, and goto statements 102
5.3.3.11 Throw statements 102
5.3.3.12 Return statements 102
5.3.3.13 Try-catch statements 103
5.3.3.14 Try-finally statements 103
5.3.3.15 Try-catch-finally statements 103
5.3.3.16 Foreach statements 104
5.3.3.17 Using statements 104
5.3.3.18 Lock statements 105
5.3.3.19 Yield statements 105
5.3.3.20 General rules for simple expressions 105
5.3.3.21 General rules for expressions with embedded expressions 105
5.3.3.22 Invocation expressions and object creation expressions 106
5.3.3.23 Simple assignment expressions 106
5.3.3.24 && expressions 106
5.3.3.25 || expressions 107
5.3.3.26 ! expressions 108
5.3.3.27 ?? expressions 108
5.3.3.28 ?: expressions 109
5.3.3.29 Anonymous functions 109
5.4 Variable references 110
5.5 Atomicity of variable references 110

6. Conversions 111
6.1 Implicit conversions 111
6.1.1 Identity conversion 111
6.1.2 Implicit numeric conversions 111
6.1.3 Implicit enumeration conversions 112
6.1.4 Implicit nullable conversions 112
6.1.5 Null literal conversions 112
6.1.6 Implicit reference conversions 113
6.1.7 Boxing conversions 113
6.1.8 Implicit constant expression conversions 114
6.1.9 Implicit conversions involving type parameters 114
6.1.10 User-defined implicit conversions 114
6.1.11 Anonymous function conversions and method group conversions 114
6.2 Explicit conversions 114
6.2.1 Explicit numeric conversions 115
6.2.2 Explicit enumeration conversions 116
6.2.3 Explicit nullable conversions 117
6.2.4 Explicit reference conversions 117
6.2.5 Unboxing conversions 118
6.2.6 Explicit conversions involving type parameters 118
6.2.7 User-defined explicit conversions 119
6.3 Standard conversions 119
6.3.1 Standard implicit conversions 119
6.3.2 Standard explicit conversions 120
6.4 User-defined conversions 120
6.4.1 Permitted user-defined conversions 120
6.4.2 Lifted conversion operators 120
6.4.3 Evaluation of user-defined conversions 120
6.4.4 User-defined implicit conversions 121
6.4.5 User-defined explicit conversions 122
6.5 Anonymous function conversions 123
6.5.1 Evaluation of anonymous function conversions to delegate types 124
6.5.2 Evaluation of anonymous function conversions to expression tree types 125
6.5.3 Implementation example 125
6.6 Method group conversions 127

7. Expressions 131
7.1 Expression classifications 131
7.1.1 Values of expressions 132
7.2 Operators 132
7.2.1 Operator precedence and associativity 132
7.2.2 Operator overloading 133
7.2.3 Unary operator overload resolution 135
7.2.4 Binary operator overload resolution 135
7.2.5 Candidate user-defined operators 135
7.2.6 Numeric promotions 136
7.2.6.1 Unary numeric promotions 136
7.2.6.2 Binary numeric promotions 136
7.2.7 Lifted operators 137
7.3 Member lookup 138
7.3.1 Base types 139
7.4 Function members 139
7.4.1 Argument lists 142
7.4.2 Type inference 144
7.4.2.1 The first phase 145
7.4.2.2 The second phase 145
7.4.2.3 Input types 145
7.4.2.4 Output types 145
7.4.2.5 Dependence 145
7.4.2.6 Output type inferences 145
7.4.2.7 Explicit parameter type inferences 146
7.4.2.8 Exact inferences 146
7.4.2.9 Lower-bound inferences 146
7.4.2.10 Fixing 146
7.4.2.11 Inferred return type 147
7.4.2.12 Type inference for conversion of method groups 148
7.4.2.13 Finding the best common type of a set of expressions 148
7.4.3 Overload resolution 148
7.4.3.1 Applicable function member 149
7.4.3.2 Better function member 149
7.4.3.3 Better conversion from expression 150
7.4.3.4 Better conversion from type 151
7.4.3.5 Overloading in generic classes 151
7.4.4 Function member invocation 152
7.4.4.1 Invocations on boxed instances 153
7.5 Primary expressions 153
7.5.1 Literals 154
7.5.2 Simple names 154
7.5.2.1 Invariant meaning in blocks 156
7.5.3 Parenthesized expressions 156
7.5.4 Member access 157
7.5.4.1 Identical simple names and type names 158
7.5.4.2 Grammar ambiguities 159
7.5.5 Invocation expressions 160
7.5.5.1 Method invocations 160
7.5.5.2 Extension method invocations 161
7.5.5.3 Delegate invocations 163
7.5.6 Element access 164
7.5.6.1 Array access 164
7.5.6.2 Indexer access 165
7.5.7 This access 165
7.5.8 Base access 166
7.5.9 Postfix increment and decrement operators 166
7.5.10 The new operator 167
7.5.10.1 Object creation expressions 168
7.5.10.2 Object initializers 169
7.5.10.3 Collection initializers 171
7.5.10.4 Array creation expressions 172
7.5.10.5 Delegate creation expressions 174
7.5.10.6 Anonymous object creation expressions 175
7.5.11 The typeof operator 177
7.5.12 The checked and unchecked operators 178
7.5.13 Default value expressions 180
7.5.14 Anonymous method expressions 181
7.6 Unary operators 181
7.6.1 Unary plus operator 181
7.6.2 Unary minus operator 181
7.6.3 Logical negation operator 182
7.6.4 Bitwise complement operator 182
7.6.5 Prefix increment and decrement operators 183
7.6.6 Cast expressions 183
7.7 Arithmetic operators 184
7.7.1 Multiplication operator 184
7.7.2 Division operator 185
7.7.3 Remainder operator 186
7.7.4 Addition operator 187
7.7.5 Subtraction operator 189
7.8 Shift operators 191
7.9 Relational and type-testing operators 192
7.9.1 Integer comparison operators 192
7.9.2 Floating-point comparison operators 193
7.9.3 Decimal comparison operators 194
7.9.4 Boolean equality operators 194
7.9.5 Enumeration comparison operators 194
7.9.6 Reference type equality operators 194
7.9.7 String equality operators 196
7.9.8 Delegate equality operators 196
7.9.9 Equality operators and null 197
7.9.10 The is operator 197
7.9.11 The as operator 198
7.10 Logical operators 198
7.10.1 Integer logical operators 199
7.10.2 Enumeration logical operators 199
7.10.3 Boolean logical operators 199
7.10.4 Nullable boolean logical operators 199
7.11 Conditional logical operators 200
7.11.1 Boolean conditional logical operators 201
7.11.2 User-defined conditional logical operators 201
7.12 The null coalescing operator 201
7.13 Conditional operator 202
7.14 Anonymous function expressions 203
7.14.1 Anonymous function signatures 205
7.14.2 Anonymous function bodies 205
7.14.3 Overload resolution 206
7.14.4 Outer variables 206
7.14.4.1 Captured outer variables 206
7.14.4.2 Instantiation of local variables 207
7.14.5 Evaluation of anonymous function expressions 209
7.15 Query expressions 209
7.15.1 Ambiguities in query expressions 211
7.15.2 Query expression translation 211
7.15.2.1 Select and groupby clauses with continuations 211
7.15.2.2 Explicit range variable types 212
7.15.2.3 Degenerate query expressions 212
7.15.2.4 From, let, where, join and orderby clauses 213
7.15.2.5 Select clauses 216
7.15.2.6 Groupby clauses 216
7.15.2.7 Transparent identifiers 217
7.15.3 The query expression pattern 218
7.16 Assignment operators 219
7.16.1 Simple assignment 220
7.16.2 Compound assignment 222
7.16.3 Event assignment 223
7.17 Expression 223
7.18 Constant expressions 223
7.19 Boolean expressions 225

8. Statements 227
8.1 End points and reachability 227
8.2 Blocks 229
8.2.1 Statement lists 229
8.3 The empty statement 230
8.4 Labeled statements 230
8.5 Declaration statements 231
8.5.1 Local variable declarations 231
8.5.2 Local constant declarations 232
8.6 Expression statements 233
8.7 Selection statements 233
8.7.1 The if statement 233
8.7.2 The switch statement 234
8.8 Iteration statements 237
8.8.1 The while statement 238
8.8.2 The do statement 238
8.8.3 The for statement 239
8.8.4 The foreach statement 240
8.9 Jump statements 242
8.9.1 The break statement 243
8.9.2 The continue statement 244
8.9.3 The goto statement 244
8.9.4 The return statement 245
8.9.5 The throw statement 246
8.10 The try statement 247
8.11 The checked and unchecked statements 250
8.12 The lock statement 250
8.13 The using statement 251
8.14 The yield statement 253

9. Namespaces 255
9.1 Compilation units 255
9.2 Namespace declarations 255
9.3 Extern aliases 257
9.4 Using directives 257
9.4.1 Using alias directives 258
9.4.2 Using namespace directives 260
9.5 Namespace members 262
9.6 Type declarations 262
9.7 Namespace alias qualifiers 263
9.7.1 Uniqueness of aliases 264

10. Classes 265
10.1 Class declarations 265
10.1.1 Class modifiers 265
10.1.1.1 Abstract classes 266
10.1.1.2 Sealed classes 266
10.1.1.3 Static classes 266
10.1.2 Partial modifier 267
10.1.3 Type parameters 267
10.1.4 Class base specification 268
10.1.4.1 Base classes 268
10.1.4.2 Interface implementations 269
10.1.5 Type parameter constraints 270
10.1.6 Class body 274
10.2 Partial types 274
10.2.1 Attributes 274
10.2.2 Modifiers 274
10.2.3 Type parameters and constraints 275
10.2.4 Base class 275
10.2.5 Base interfaces 275
10.2.6 Members 276
10.2.7 Partial methods 276
10.2.8 Name binding 279
10.3 Class members 279
10.3.1 The instance type 281
10.3.2 Members of constructed types 281
10.3.3 Inheritance 282
10.3.4 The new modifier 283
10.3.5 Access modifiers 283
10.3.6 Constituent types 283
10.3.7 Static and instance members 283
10.3.8 Nested types 284
10.3.8.1 Fully qualified name 285
10.3.8.2 Declared accessibility 285
10.3.8.3 Hiding 285
10.3.8.4 this access 286
10.3.8.5 Access to private and protected members of the containing type 287
10.3.8.6 Nested types in generic classes 288
10.3.9 Reserved member names 288
10.3.9.1 Member names reserved for properties 289
10.3.9.2 Member names reserved for events 289
10.3.9.3 Member names reserved for indexers 289
10.3.9.4 Member names reserved for destructors 290
10.4 Constants 290
10.5 Fields 291
10.5.1 Static and instance fields 293
10.5.2 Readonly fields 293
10.5.2.1 Using static readonly fields for constants 294
10.5.2.2 Versioning of constants and static readonly fields 294
10.5.3 Volatile fields 295
10.5.4 Field initialization 296
10.5.5 Variable initializers 296
10.5.5.1 Static field initialization 297
10.5.5.2 Instance field initialization 298
10.6 Methods 299
10.6.1 Method parameters 300
10.6.1.1 Value parameters 301
10.6.1.2 Reference parameters 302
10.6.1.3 Output parameters 303
10.6.1.4 Parameter arrays 303
10.6.2 Static and instance methods 306
10.6.3 Virtual methods 306
10.6.4 Override methods 308
10.6.5 Sealed methods 310
10.6.6 Abstract methods 311
10.6.7 External methods 312
10.6.8 Partial methods 313
10.6.9 Extension methods 313
10.6.10 Method body 313
10.6.11 Method overloading 314
10.7 Properties 314
10.7.1 Static and instance properties 315
10.7.2 Accessors 316
10.7.3 Automatically implemented properties 320
10.7.4 Accessibility 321
10.7.5 Virtual, sealed, override, and abstract accessors 322
10.8 Events 324
10.8.1 Field-like events 326
10.8.2 Event accessors 327
10.8.3 Static and instance events 328
10.8.4 Virtual, sealed, override, and abstract accessors 329
10.9 Indexers 329
10.9.1 Indexer overloading 333
10.10 Operators 333
10.10.1 Unary operators 335
10.10.2 Binary operators 335
10.10.3 Conversion operators 336
10.11 Instance constructors 338
10.11.1 Constructor initializers 339
10.11.2 Instance variable initializers 340
10.11.3 Constructor execution 340
10.11.4 Default constructors 342
10.11.5 Private constructors 342
10.11.6 Optional instance constructor parameters 343
10.12 Static constructors 343
10.13 Destructors 345
10.14 Iterators 347
10.14.1 Enumerator interfaces 347
10.14.2 Enumerable interfaces 347
10.14.3 Yield type 347
10.14.4 Enumerator objects 347
10.14.4.1 The MoveNext method 348
10.14.4.2 The Current property 349
10.14.4.3 The Dispose method 349
10.14.5 Enumerable objects 349
10.14.5.1 The GetEnumerator method 350
10.14.6 Implementation example 350

11. Structs 357
11.1 Struct declarations 357
11.1.1 Struct modifiers 357
11.1.2 Partial modifier 358
11.1.3 Struct interfaces 358
11.1.4 Struct body 358
11.2 Struct members 358
11.3 Class and struct differences 358
11.3.1 Value semantics 359
11.3.2 Inheritance 360
11.3.3 Assignment 360
11.3.4 Default values 360
11.3.5 Boxing and unboxing 361
11.3.6 Meaning of this 362
11.3.7 Field initializers 363
11.3.8 Constructors 363
11.3.9 Destructors 364
11.3.10 Static constructors 364
11.4 Struct examples 364
11.4.1 Database integer type 364
11.4.2 Database boolean type 366

12. Arrays 369
12.1 Array types 369
12.1.1 The System.Array type 370
12.1.2 Arrays and the generic IList interface 370
12.2 Array creation 370
12.3 Array element access 371
12.4 Array members 371
12.5 Array covariance 371
12.6 Array initializers 371

13. Interfaces 375
13.1 Interface declarations 375
13.1.1 Interface modifiers 375
13.1.2 Partial modifier 375
13.1.3 Base interfaces 376
13.1.4 Interface body 376
13.2 Interface members 376
13.2.1 Interface methods 378
13.2.2 Interface properties 378
13.2.3 Interface events 378
13.2.4 Interface indexers 378
13.2.5 Interface member access 379
13.3 Fully qualified interface member names 380
13.4 Interface implementations 381
13.4.1 Explicit interface member implementations 382
13.4.2 Uniqueness of implemented interfaces 384
13.4.3 Implementation of generic methods 385
13.4.4 Interface mapping 385
13.4.5 Interface implementation inheritance 388
13.4.6 Interface re-implementation 389
13.4.7 Abstract classes and interfaces 391

14. Enums 393
14.1 Enum declarations 393
14.2 Enum modifiers 393
14.3 Enum members 394
14.4 The System.Enum type 396
14.5 Enum values and operations 396

15. Delegates 397
15.1 Delegate declarations 397
15.2 Delegate compatibility 399
15.3 Delegate instantiation 399
15.4 Delegate invocation 400

16. Exceptions 403
16.1 Causes of exceptions 403
16.2 The System.Exception class 403
16.3 How exceptions are handled 403
16.4 Common Exception Classes 404

17. Attributes 407
17.1 Attribute classes 407
17.1.1 Attribute usage 407
17.1.2 Positional and named parameters 408
17.1.3 Attribute parameter types 409
17.2 Attribute specification 409
17.3 Attribute instances 414
17.3.1 Compilation of an attribute 415
17.3.2 Run-time retrieval of an attribute instance 415
17.4 Reserved attributes 415
17.4.1 The AttributeUsage attribute 415
17.4.2 The Conditional attribute 416
17.4.2.1 Conditional methods 416
17.4.2.2 Conditional attribute classes 418
17.4.3 The Obsolete attribute 419
17.5 Attributes for Interoperation 420
17.5.1 Interoperation with COM and Win32 components 421
17.5.2 Interoperation with other .NET languages 421
17.5.2.1 The IndexerName attribute 421

18. Unsafe code 423
18.1 Unsafe contexts 423
18.2 Pointer types 425
18.3 Fixed and moveable variables 428
18.4 Pointer conversions 428
18.5 Pointers in expressions 429
18.5.1 Pointer indirection 430
18.5.2 Pointer member access 430
18.5.3 Pointer element access 431
18.5.4 The address-of operator 432
18.5.5 Pointer increment and decrement 433
18.5.6 Pointer arithmetic 433
18.5.7 Pointer comparison 434
18.5.8 The sizeof operator 434
18.6 The fixed statement 435
18.7 Fixed size buffers 438
18.7.1 Fixed size buffer declarations 438
18.7.2 Fixed size buffers in expressions 440
18.7.3 Definite assignment checking 440
18.8 Stack allocation 441
18.9 Dynamic memory allocation 442

A. Documentation comments 445
A.1 Introduction 445
A.2 Recommended tags 446
A.2.1 447
A.2.2 447
A.2.3 448
A.2.4 448
A.2.5 449
A.2.6 449
A.2.7 450
A.2.8 451
A.2.9 451
A.2.10 451
A.2.11

452
A.2.12 452
A.2.13 453
A.2.14 453
A.2.15 454
A.2.16 454
A.2.17 454
A.2.18 455
A.3 Processing the documentation file 455
A.3.1 ID string format 455
A.3.2 ID string examples 456
A.4 An example 460
A.4.1 C# source code 460
A.4.2 Resulting XML 462

B. Grammar 468
B.1 Lexical grammar 468
B.1.1 Line terminators 468
B.1.2 Comments 468
B.1.3 White space 469
B.1.4 Tokens 469
B.1.5 Unicode character escape sequences 469
B.1.6 Identifiers 470
B.1.7 Keywords 471
B.1.8 Literals 471
B.1.9 Operators and punctuators 473
B.1.10 Pre-processing directives 473
B.2 Syntactic grammar 476
B.2.1 Basic concepts 476
B.2.2 Types 476
B.2.3 Variables 477
B.2.4 Expressions 478
B.2.5 Statements 484
B.2.6 Namespaces 488
B.2.7 Classes 489
B.2.8 Structs 496
B.2.9 Arrays 496
B.2.10 Interfaces 497
B.2.11 Enums 498
B.2.12 Delegates 498
B.2.13 Attributes 499
B.3 Grammar extensions for unsafe code 500

Visual Basic Language Specification 9.0 (Beta 2) Available For Download

Table of Contents
The Visual Basic Language Specification 9.0 (Beta 2) document is available for download. The document contains 328 pages. Below is the Table Of Contents

1. Introduction
2. Lexical Grammar
3. Preprocessing Directives
4. General Concepts
5. Attributes
6. Source Files and Namespaces
7. Types
8. Conversions
9. Type Members
10. Statements
11. Expressions
12. Documentation Comments
13. Grammar Summary
14. Change List

Download the document here: http://www.microsoft.com/downloads/details.aspx?FamilyID=39de1dd0-f775-40bf-a191-09f5a95ef500&displaylang=en

Tuesday, October 23, 2007

Oracle Database 11g Generally Available on Microsoft Windows Platform

Oracle today announced the general availability of Oracle(r) Database 11g on the Microsoft Windows platform. Oracle Database 11g on Windows helps organizations of all sizes tackle the demands of rapid data growth, changing environments, and the need to deliver higher quality of services while reducing and controlling IT costs.
"Oracle is committed to providing choice, and we continue to deliver on that promise with the release of Oracle Database 11g on Windows," said Andy Mendelsohn, senior vice president of Database Server Technologies, Oracle. "Optimized for Windows, Oracle Database 11g helps growing businesses address their increasing data management demands with unrivaled price/performance and scalability."

Optimized for Windows and .NET
Oracle Database 11g is optimized for Windows platforms and services. Administrators can take advantage of new Windows-specific features including database backup and recovery using Windows Volume Shadow Copy Service as well as enhancements in Active Directory and Kerberos integration. New features in Oracle Database 11g and enhanced integration with Windows offer a fast, reliable and secure foundation for mission-critical applications. Oracle's recent world record for price/performance with the TPC-C benchmark running Oracle Database 11g on Windows(1) demonstrates Oracle Database's ability to cost-effectively meet the needs of businesses of all sizes without compromising performance.

As a Premier partner in the Microsoft Visual Studio Industry Partner (VSIP) program, Oracle offers tight integration between Oracle Database and Microsoft Visual Studio. With the release of Oracle Database 11g on Windows, .NET developers will experience even faster performance and improved developer productivity. The new Oracle client result cache can significantly improve performance of repetitive queries. Oracle SecureFiles provides breakthrough performance for storage and retrieval of unstructured data such as documents, XML, images, and video. New indexing and storage methods for XML provide up to 15 times improved performance.

In previous releases, Oracle has delivered new and unique features for Windows customers such as Oracle Real Application Clusters, which turns a cluster of low-cost, industry-standard servers running Windows into a highly available, scalable and secure platform for running database and packaged applications. Oracle Database 11g is no exception and offers new capabilities, including:

* Oracle Real Application Testing enables businesses to efficiently test the changes made to their IT environment from operating systems to servers to software, reducing the risks and costs associated with such changes;

* Oracle Advanced Compression capabilities delivers compression ratios of 2x to 3x or more for all data types for added cost-effective storage of data;

* Oracle Total Recall offers an easy, practical way to query the historical changes to data for change tracking, auditing and compliance;

* Oracle Active Data Guard enhances the performance of production systems and provides a more cost-effective disaster recovery solution by enabling the offloading of resource intensive tasks such as queries and backups to a single physical standby database; and,

* Oracle Partitioning automates many manual data partitioning operations and extends existing range, hash and list partitioning to include interval, reference and virtual column partitioning.

Melbourne Health Tests Oracle Database 11g on Windows
Melbourne Health is a major public health provider in Victoria, Australia that provides comprehensive acute, sub-acute and community-based health care programs. Melbourne Health is the lead driver behind the Bio21:Molecular Medicine Informatics Model (MMIM), a platform that provides clinical researchers access to data from disparate existing databases across multiple disease types at multiple institutions, co-located in a virtual repository.

A participant in the Oracle Database 11g beta program, Melbourne Health tested DICOM image storage, metadata (image information) extraction and DICOM image retrieval, ability to anonymize the image, generation of thumbnails, and conformance validation of Oracle Database 11g on Windows and Linux platforms.

"Oracle Database 11g on Windows has provided a number of new features such as increased capabilities for management of unstructured data including medical imaging, improved data compression for managing rapidly growing volumes of data, and data encryption for securing sensitive data that we would consider implementing in support of the Bio21:MMIM project. Authorized researchers will be able to access de-identified information about an image via the MMIM SAS interface, just as they do for other clinical research data," said Dr. Marienne Hibbert, Ph.D., MMIM Project Director.

Webcast Explores IT Trends and Challenges in Windows Environment
A Webcast featuring IDC Research Vice President Carl Olofson and hosted by Oracle and Redmond Magazine, is scheduled on Wednesday, October 24, 2007 at 12:00 PM ET / 9:00 AM PT. To register to hear more about IT trends and challenges within a Windows environment, go to: http://w.on24.com/r.htm?e=94296&s=1&k=9A5C333D69A9F6221FB918F5B41994E5&partnerref=oracle1

Availability
Oracle Database 11g Enterprise Edition, Standard Edition and Standard Edition One are generally available today on the Microsoft Windows platform. A free evaluation version of Oracle Database 11g for 32-bit Windows is available for download on the Oracle Technology Network at:
http://www.oracle.com/technology/software/products/database/index.html.

For more information on Oracle Database 11g, go to:
http://www.oracle.com/database.

Video: Pascal Bourque - Building a rich datagrid in WPF

Channel 9 has posted their latest video: Pascal Bourque - Building a rich datagrid in WPF

From the site:

We talk about what its like to develop a rich control using WPF, mainly focusing on the custom theming of the grid. It really shows off the whole concept of seperating the UI interaction and style from the core code. And with that capability, diving into redefining a grid's purpose and how real-time visualization changes can be used effectively.

I'm hoping they take my suggestion of a custom themes contest and run with it. It'd be interesting to see what other type of skins people could create.
Listen to the podcast(MP3)
Listen to the podcast(WMA)
Download the Video
Watch the Video

Friday, October 19, 2007

Sort Values Ascending But NULLS Last

This is a frequent request in newsgroups and fora. People want to sort the column in ascending order but don't want the NULLS at the beginning.
Oracle has this syntax: ORDER BY ColumnName NULLS LAST;
SQL Server does not have this. But there are 2 ways to do this. The first one is by using case and the second one by using COALESCE and the maximum value for the data type in the order by clause.

The 2 approaches with a datetime data type



DECLARE @Temp table(Col datetime)
INSERT INTO @Temp VALUES(getdate())
INSERT INTO @Temp VALUES('2007-10-19 09:54:03.730')
INSERT INTO @Temp VALUES('2006-10-19 09:54:03.730')
INSERT INTO @Temp VALUES('2005-10-19 09:54:03.730')
INSERT INTO @Temp VALUES('2006-10-19 09:54:03.730')
INSERT INTO @Temp VALUES('2004-10-19 09:54:03.730')
INSERT INTO @Temp VALUES(NULL)
INSERT INTO @Temp VALUES(NULL)




SELECT *
FROM @Temp
ORDER BY COALESCE(Col,'9999-12-31 23:59:59.997')




SELECT *
FROM @Temp
ORDER BY CASE WHEN Col Is NULL Then 1 Else 0 End, Col





The 2 approaches with an integer data type



DECLARE @Temp table(Col int)
INSERT INTO @Temp VALUES(1)
INSERT INTO @Temp VALUES(555)
INSERT INTO @Temp VALUES(444)
INSERT INTO @Temp VALUES(333)
INSERT INTO @Temp VALUES(5656565)
INSERT INTO @Temp VALUES(3)
INSERT INTO @Temp VALUES(NULL)
INSERT INTO @Temp VALUES(NULL)




SELECT *
FROM @Temp
ORDER BY COALESCE(Col,'2147483647')




SELECT *
FROM @Temp
ORDER BY CASE WHEN Col Is NULL Then 1 Else 0 End, Col


Wednesday, October 17, 2007

Another Chinese Toy Recall

Chinese Toy Recall

Another Chinese Toy Recall

Tuesday, October 16, 2007

Hotfix: FIX: A Service Broker endpoint stops passing messages in a database mirroring session of SQL Server 2005

SYMPTOMS
In a database mirroring session of Microsoft SQL Server 2005, a Service Broker endpoint stops passing messages from the initiating service to the target service. This problem occurs periodically and with increasing frequency.

When this problem occurs, a minidump file is generated. Additionally, the following error messages are repeatedly logged in the SQL Server 2005 error log:
Date Time SPID The mirror route is not operational. 'TCP://plpossrv135:4027' is acting as 'Unknown' []. 'tcp://slpossrv135:4027' is acting as 'Unknown' [].
Date Time SPID The mirror route is operational, but only connected to principal. 'TCP://plpossrv048:4027' is acting as 'Principal' []. 'tcp://slpossrv048:4027' is acting as 'Unknown' [].
Date Time Backup Log was backed up. Database: ShvaWebHO, creation date(time): 2006/07/17(23:01:56), first LSN: 50098:8649:37, last LSN: 50136:18614:1, number of dump devices: 2, device information: (FILE=1, TYPE=VIRTUAL_DEVICE: {'VDI_0F67AA24-5C91-47D6-B048-7662275C1E35_0', 'VDI_0F67AA24-5C91-47D6-B048-7662275C1E35_1'}). This is an informational message only. No user action is required.
Date Time SPID Timeout occurred while waiting for latch: class 'SERVICE_BROKER_TRANSMISSION_WORK', id 0000000082EA40E0, type 4, Task 0x0000000004ACC718 : 0, waittime 300, flags 0xa, owning task 0x00000000052F9978. Continuing to wait.
Date Time SPID Using 'dbghelp.dll' version '4.0.5'
Date Time SPID **Dump thread - spid = 104, PSS = 0x0000000089DCEB40, EC = 0x0000000089DCEB50
Date Time SPID ***Stack Dump being sent to R:\Microsoft SQL Server\MSSQL.6\MSSQL\LOG\SQLDump0011.txt
Date Time SPID * *******************************************************************************
Date Time SPID *
Date Time SPID * BEGIN STACK DUMP:
Date Time SPID * 06/26/07 13:16:51 spid 104
Date Time SPID *
Date Time SPID * Latch timeout
Date Time SPID *
Date Time SPID *
Date Time SPID * *******************************************************************************
Date Time SPID * -------------------------------------------------------------------------------
Date Time SPID * Short Stack Dump
Date Time SPID Stack Signature for the dump is 0x0000000156139452
Date Time SPID Timeout occurred while waiting for latch: class 'SERVICE_BROKER_TRANSMITTER', id 0000000080283900, type 4, Task 0x0000000003C74EF8 : 0, waittime 300, flags 0x1008, owning task 0x0000000000000000. Continuing to wait.
Date Time SPID External dump process return code 0x20000001.Date


RESOLUTION
Cumulative update information
The fix for this issue was first released as a hotfix and is also available in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
941450 (http://support.microsoft.com/kb/941450/ ) Cumulative update package 4 for SQL Server 2005 Service Pack 2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. We recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 937137 (http://support.microsoft.com/kb/937137/ ) The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 2 hotfix to an installation of SQL Server 2005 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

Monday, October 15, 2007

Fish Lips Pictures







Interview With Kalen Delaney About Inside Microsoft SQL Server 2005 Query Tuning and Optimization

Inside Microsoft SQL Server 2005: Query Tuning and Optimization I am a big fan of Inside Microsoft SQL Server 2005 The Storage Engine so when I saw that yet another book got published in this series I just had to check it out. Inside Microsoft SQL Server 2005: Query Tuning and Optimization is very well written gets to the point and give you the answers that you need. I decided to contact Kalen to see if she would be willing to do an interview, by now you know that the answer is yes of course ;-)


The question-and-answer session with Kalen that follows was conducted via email.

What is the audience for this book, is it the enterprise user or can a small department benefit from the tips in this book?
Because this book deals with query tuning, anyone who writes SQL queries for SQL Server can benefit. Very little in the book is geared towards system tuning, so the size of the machine doesn’t really matter. Now of course, if you have a very small system with very small tables, you won’t get as much benefit out of tuning your queries. However, if you have any tables of more than a few thousand rows, and you do any joins, you will need to tune your queries. In addition, the issues of blocking and concurrency control can impact any system, no matter how small.

What new technologies in SQL Server 2005 do you think are the most beneficial for performance?
For very large databases, the best new technology is partitioning. For any size system, if you have had serious performance problems due to blocking, you might find a big performance benefit by using one of the snapshot-based isolation levels, but you really need to understand the resource costs that come along with the improved performance. For your individual queries, I think the new optimizer hints and query level recompiles can make a big difference. For indexes, the ability to add included columns to nonclustered indexes can give some of your hard-to-tune queries a major performance boost.

What will a person who reads this book gain in terms of understanding how to performance tune a server?
The focus of this book is not so much on tuning the server, but on tuning queries. There is more in Inside SQL Server 2005: The Storage Engine on server issues such as memory and processor management. The biggest server wide issues are covered in Chapter 5, when I talk about managing the plan cache, and how and when query plans are reused.

Is the book geared towards a beginner/intermediate level user or do you have to be an advanced user to really utilize the information in this book?
The book is not geared towards beginners, but everyone should be able to get something out of it. It’s primarily geared to SQL Server developers and DBA’s who have been working with SQL Server for a while, and have encountered performance problems that they are trying to find solutions for.

With all the changes in SQL Server 2005, how critical has the tempdb become in regards to performance?
Tempdb has always been important. In SQL Server 2005, if you are using one of the snapshot-based isolation levels, you are going to have to be more aware of the demands placed on tempdb, both in the sizing requirements and the additional I/O resources needed. Fortunately, SQL Server 2005 provides tools to monitor tempdb, including a dozen new performance monitor counters, and a dynamic management view, sys.dm_db_file_space_usage, that keeps track of how much space in tempdb is being used for each of the different kind of object stored in tempdb.

I understand that this is the first time you wrote with a team of other writers; can you tell us something about that experience?
I initially thought that not having to write the whole volume by myself meant that I could get it done sooner, but that was not the case. Everyone had their own schedule and their own way of writing. The personal aspect of working with the other authors was great. I deeply respect all of the others and it was an honor to be working so closely with them. I had some concerns about the depth of coverage and I wondered whether all the chapters would end up being as deep as I hoped for, but that turned out not to be a major problem. The only real issues were agreeing on a common terminology and coding style, and even that wasn’t that big of an issue, because I got to do a final editing pass on everyone’s chapters.

What SQL Server books are on your bookshelf?
All of the Inside SQL Server books are there, of course, and all of Ken Henderson’s books. Bob Beauchemin’s book is in my car, to read while I am waiting for the ferryboat, and while on the ferry. I also have technical books that aren’t SQL Server specific, such as Jim Gray’s Transaction Processing, Russinovich’s and Solomon’s Windows Internals, Chris Date’s Introduction to Database Systems and Mike Stonebraker’s Readings in Database Systems.

Why do you write technical books?
I love working with SQL Server and trying to find out all I can about it. When I found that I could explain difficult concepts in a training environment, I thought I could do the same thing in a written format, and reach more people that way. I have always loved explaining things, ever since I was a teaching assistant for High School Math.

Will you be updating your books for SQL Server 2008?
I have just started meeting with my editors at Microsoft Press about SQL Server 2008, and it looks like a revision is in the plans. We’re really looking at it as just a revision, with the same structures as the current books, with straightforward changes and the inclusion of new features.

Name three things that are new in SQL Server 2005 that you find are the most valuable?
Dynamic Management Views, Dynamic Management Views, and Dynamic Management Views!
Oh, you wanted three different things? ;-) How about XML query plans and optimization hints. (I’m also very fond of many of the new TSQL constructs, but I was only talking about things that I cover in my new book.)

Name three things which are coming in SQL Server 2008 that you are most excited about?
You’ll have to ask me this next time. I have actually been avoiding SQL Server 2008 while I was getting my Query Tuning and Optimization book finished, because I didn’t want to get distracted.

Can you list any third party tools that you find useful to have as a SQL Server developer/admin?
I’ve tried a few other products, but usefully I find that it is much easier to just stick with the Microsoft line and use the tools provided with the product.

Name some of your favorite non-technical books.
Oh, I love to read. It would be impossible to list my favorite books, but I can tell you my favorite authors, most of whom write science fiction: Lois McMaster Bujold, Ursula LeGuin, Sheri Tepper, Orson Scott Card, Octavia Butler, Elizabeth Moon. I also love to read historical fiction like Leon Uris.

Friday, October 12, 2007

NHibernate: 1.2.0GA Released

NHibernate is a port of Hibernate to the .NET platform. Hibernate is the leading open-source object-relational persistence library for Java, used to persist plain objects in relational databases.


After several years of development, the first stable version of NHibernate, version 1.0, is now available for download. This version is comparable to Hibernate 2.1 in terms of features, with a few small differences.

With the release of version 1.0, NHibernate is also joining the original Hibernate project at JBoss Inc., the company providing support and training services around Hibernate.

More information about NHibernate:
http://www.nhibernate.org/

Download NHibernate 1.2.0GA:
https://sourceforge.net/project/showfiles.php?group_id=73818&package_id=73969

Download NHibernateContrib 1.0.4:
https://sourceforge.net/project/showfiles.php?group_id=73818&package_id=138561

Wednesday, October 10, 2007

Screencast: Dramatically Improve Data-Driven Web Application Development with LINQ

Richard Hale Shaw's session, Dramatically Improve Data-Driven Web Application Development with LINQ in 5 parts.

Part 1: Watch the screencast(WMV)
Part 2: Watch the screencast(WMV)
Part 3: Watch the screencast(WMV)
Part 4: Watch the screencast(WMV)
Part 5: Watch the screencast(WMV)

SQL Teaser: Guess the output

What do you think will be the output?


DECLARE @d datetime
SET @d = '20071010'

SELECT DATEADD(yy, DATEDIFF(yy, 0, @d)+1, -1)

After that run this to see how to get first and last days for years, quarters, months and weeks(be careful of ISO weeks!)

DECLARE @d datetime
SET @d = '20071010'

SELECT DATEADD(yy, DATEDIFF(yy, 0, @d), 0) as FirstDayOfYear,
DATEADD(yy, DATEDIFF(yy, 0, @d)+1, -1) as LastDayOfYear,
DATEADD(qq, DATEDIFF(qq, 0, @d), 0) as FirstDayOfQuarter,
DATEADD(qq, DATEDIFF(qq, 0, @d)+1, -1) as LastDayOfQuarter,
DATEADD(mm, DATEDIFF(mm, 0, @d), 0) as FirstDayOfMonth,
DATEADD(mm, DATEDIFF(mm, 0, @d)+1, -1) as LastDayOfMonth,
DATEADD(wk, DATEDIFF(wk, 0, @d), 0) as FirstDayOfWeek,
DATEADD(wk, DATEDIFF(wk, 0, @d)+1, -1) as LastDayOfWeek

Tuesday, October 9, 2007

Self-paced Course: What's New in Microsoft SQL Server 2008

In this clinic, you will learn about the new and enhanced features included in SQL Server 2008. You will explore the new data types and the data management features. Additionally, you will learn about the enhanced Integration Services, Analysis Services, and Reporting Services included in SQL Server 2008. This online clinic is composed of a rich multimedia experience.

To get the most out of this clinic, it is recommended that you have:

  • Knowledge of general SQL database concepts that are largely independent of a specific version of SQL Server
  • Knowledge of Microsoft SQL Server 2005 features
  • Knowledge of deploying and upgrading database solutions
  • Knowledge of how to solve performance issues related to SQL Server hardware
  • Performed the job role of a SQL Server 2005 database administrator or database developer
  • Product or technology experience in Microsoft SQL Server 2000 or SQL Server 2005



Objectives:
At the end of the course, students will be able to:

  • Describe the features of SQL Server 2008 and their benefits.
  • Describe the features of enterprise data platform that help you to secure data in applications.
  • Describe the dynamic development features that facilitate the development of database applications.
  • Describe the features of SQL Server 2008 that provide data storage solutions beyond relational databases.
  • Describe the enhanced features in SSIS that help you to integrate data effectively.
  • Describe the enhanced features in SSAS that help you to improve the BI infrastructure.
  • Describe the enhanced features in SSRS that help you to improve the scalability of the reporting engine.



Modules & Lessons

Clinic Overview

Module Introduction
Navigation Overview
Clinic Information

What’s New in SQL Server 2008
Module Introduction

Overview of SQL Server 2008
Lesson Introduction
Enhancements in SQL Server 2008
New Features of SQL Server 2008
Self Test

Enterprise Data Platform
Lesson Introduction
Methods for Data Encryption
Security Auditing for Data Protection
Resource Management Features
Benefits of the Resource Governor Tool
System Analysis Features
Server Management Features
Self Test

Dynamic Development
Lesson Introduction
Data Entities in SQL Server 2008
Data Synchronizing Features
Self Test

Beyond Relational Databases
Lesson Introduction
New Data Types
Spatial Data Type
Table-Value Parameters in SQL Server 2008
Features of Integrated Full-Text Search in SQL Server 2008
Self Test

Pervasive Insight in Integration Services
Lesson Introduction
Data Integration Features
The MERGE Statement in SQL Server 2008
Self Test

Pervasive Insight in Analysis Services
Lesson Introduction
Enhanced Features in Analysis Services
How the Block Computation Feature Works
Self Test

Pervasive Insight in Reporting Services
Lesson Introduction
How Reporting Services Work
Features for Microsoft Office 2007 Integration
The Report Authoring Tool
Report Builder Enhancements
What Is Tablix?
Self Test
Module Summary

Glossary
Module Introduction


Start here: https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=128041

    Friday, October 5, 2007

    What am I doing wrong?

    THIS APPEARED ON CRAIG'S LIST

    What am I doing wrong?

    Okay, I'm tired of beating around the bush. I'm a beautiful (spectacularly beautiful) 25 year old girl. I'm articulate and classy.
    I'm not from New York. I'm looking to get married to a guy who makes at least half a million a year. I know how that sounds, but keep in mind that a million a year is middle class in New York City, so I don't think I'm overreaching at all.

    Are there any guys who make 500K or more on this board? Any wives? Could you send me some tips? I dated a business man who makes average around 200 - 250. But that's where I seem to hit a roadblock. 250,000 won't get me to central park west. I know a woman in my yoga class who was married to an investment banker and lives in Tribeca, and she's not as pretty as I am, nor is she a great genius. So what is she doing right? How do I get to her level?

    Here are my questions specifically:

    - Where do you single rich men hang out? Give me specifics- bars, restaurants, gyms

    -What are you looking for in a mate? Be honest guys, you won't hurt my feelings

    -Is there an age range I should be targeting (I'm 25)?

    - Why are some of the women living lavish lifestyles on the upper east side so plain? I've seen really 'plain jane' boring types who have nothing to offer married to incredibly wealthy guys. I've seen drop dead gorgeous girls in singles bars in the east village. What's the story there?

    - Jobs I should look out for? Everyone knows - lawyer, investment banker, doctor. How much do those guys really make? And where do they hang out? Where do the hedge fund guys hang out?

    - How you decide marriage vs. just a girlfriend? I am looking for MARRIAGE ONLY

    Please hold your insults - I'm putting myself out there in an honest way. Most beautiful women are superficial; at least I'm being up front about it. I wouldn't be searching for these kind of guys if I wasn't able to match them - in looks, culture, sophistication, and keeping a nice home and hearth.

    it's NOT ok to contact this poster with services or other commercial interests

    PostingID: 432279810


    THE ANSWER
    Dear Pers-431649184:

    I read your posting with great interest and have thought meaningfully about your dilemma. I offer the following analysis of your predicament.
    Firstly, I'm not wasting your time, I qualify as a guy who fits your bill; that is I make more than $500K per year. That said here's how I see it.

    Your offer, from the prospective of a guy like me, is plain and simple a crappy business deal. Here's why. Cutting through all the B.S., what you suggest is a simple trade: you bring your looks to the party and I bring my money. Fine, simple. But here's the rub, your looks will fade and my money will likely continue into perpetuity...in fact, it is very likely that my income increases but it is an absolute certainty that you won't be getting any more beautiful!

    So, in economic terms you are a depreciating asset and I am an earning asset. Not only are you a depreciating asset, your depreciation accelerates! Let me explain, you're 25 now and will likely stay pretty hot for the next 5 years, but less so each year. Then the fade begins in earnest. By 35 stick a fork in you!

    So in Wall Street terms, we would call you a trading position, not a buy and hold...hence the rub...marriage. It doesn't make good business sense to "buy you" (which is what you're asking) so I'd rather lease. In case you think I'm being cruel, I would say the following. If my money were to go away, so would you, so when your beauty fades I need an out. It's as simple as that. So a deal that makes sense is dating, not marriage.

    Separately, I was taught early in my career about efficient markets. So, I wonder why a girl as "articulate, classy and spectacularly beautiful"
    as you has been unable to find your sugar daddy. I find it hard to believe that if you are as gorgeous as you say you are that the $500K hasn't found you, if not only for a tryout.

    By the way, you could always find a way to make your own money and then we wouldn't need to have this difficult conversation.

    With all that said, I must say you're going about it the right way.
    Classic "pump and dump."
    I hope this is helpful, and if you want to enter into some sort of lease, let me know.

    Thursday, October 4, 2007

    Sputnik 50th Anniversay Today

    Sputnik 50th Anniversay

    50 years ago the spage age begun

    Halo 3 Records More Than $300 Million in First-Week Sales Worldwide

    Interactive entertainment will never be the same, with the launch of one title that has changed the way the world thinks about video games. “Halo® 3” has captured the attention of consumers worldwide and has made history as one of the biggest entertainment launches of all time.

    Microsoft Corp. today announced that “Halo 3” has officially become a global phenomenon, garnering more than $300 million in sales in the first week alone. The critically acclaimed Xbox 360® exclusive, which was released worldwide on Tuesday, Sept. 25, is the fastest-selling video game ever and already one of the most successful entertainment properties in history.

    Initial reports from retailers worldwide show console sales have more than doubled compared with the weekly average before the launch of “Halo 3.” With games such as “Halo 3,” “Madden 08” (EA Sports), “Mass Effect” (Microsoft Game Studios) and “Rock Band” (Harmonix), Xbox 360 has the greatest lineup in the history of video games and is the only console where consumers can play all the year’s biggest blockbusters.

    “‘Halo’ is truly a cultural phenomenon, and the launch of ‘Halo 3’ is an important milestone for Xbox 360 and for video games as entertainment and as an art form,” said Bill Gates, chairman of Microsoft. “‘Halo 3’ embodies our vision for the future of entertainment, where some of the world’s greatest creative minds will deliver a new generation of interactive storytelling.”

    “Halo 3” is quickly staking its place as the most popular Xbox LIVE® game in history with members gathering in record numbers to play on the world’s largest online gaming and entertainment network on TV. More than 2.7 million gamers have played “Halo 3” on Xbox LIVE in the first week, representing nearly one-third of the 7 million Xbox LIVE members worldwide. Within the first day of its launch, “Halo 3” players worldwide racked up more than 3.6 million hours of online gameplay, which increased more than elevenfold to 40 million hours by the end of the first week, representing more than 4,500 years of continuous gameplay. Since “Halo 3 launched,” gamers have unlocked nearly 30 million achievements. In its first week alone, “Halo 3” drove a record number of Xbox LIVE Gold Memberships as hundreds of thousands of new members gathered online with friends, family members and other gamers around the world to collectively compete and complete the game.

    “Halo 3” is the conclusion to the epic trilogy and picks up where “Halo 2” left off, answering questions about the fates of the beloved protagonist Master Chief™ and his artificial intelligence sidekick Cortana as they struggle to save humankind from destruction at the hands of the alien coalition known as the Covenant. In addition to the rich storyline, “Halo 3” continues the franchise’s grand tradition of delivering innovative online multiplayer experiences via Xbox LIVE. The game’s online multiplayer and innovative four-player cooperative gameplay for Xbox LIVE Gold users, the much-talked-about Saved Films feature that enables players to capture and save their favorite moments on their hard drives, and Forge, an innovative map editor that enables myriad customization options, are just some of the new features gamers are experiencing.

    Developed by Bungie Studios and published by Microsoft Game Studios, the “Halo” franchise is exclusive to the Xbox 360 video game and entertainment system and optimized for the Xbox LIVE online entertainment network. “Halo 3” was released in 37 countries and 17 languages. To date, more than 20 million copies of the games in the “Halo” trilogy have been sold worldwide.

    Record week-one sales come on the heels of the previously announced $170 million in sales in the U.S. within the first 24 hours of the game’s release, which marked not just the biggest video game launch, but the biggest entertainment launch in history. The Xbox 360 title beat previous U.S. sales records set by blockbuster openings for entertainment events such as the release of “Spider-Man 3” and “Harry Potter and the Deathly Hallows.” In addition, more than 1.7 million copies of “Halo 3” were pre-ordered in the United States, making it the fastest pre-selling game in history, surpassing the previous record-setting pre-sales of “Halo 2.”

    About Xbox 360

    Xbox 360 is a superior video game and entertainment system delivering the best games, unique entertainment features and a unified online gaming network that revolve around gamers. Xbox 360 will have a portfolio of more than 300 games and will be available in nearly 40 countries by the end of 2007. More information can be found online at http://www.xbox.com/xbox360.

    About Xbox LIVE

    Xbox LIVE is the first and most comprehensive unified online entertainment network seamlessly integrated throughout the entire console experience, making it easy for people to find the friends, games and entertainment they want from the moment they power on their Xbox 360 system. Xbox LIVE connects millions of members across 25 countries to enjoy hundreds of multiplayer games, downloadable games via Xbox LIVE Arcade, free and premium playable game demos, music videos, TV shows and movies in the United States as well as new game levels, characters and vehicles for all their favorite retail games. More information can be found online at http://www.xbox.com/en-us/live.

    About Microsoft Game Studios

    Microsoft Game Studios is a leading worldwide publisher and developer of games for the Xbox® and Xbox 360 video game systems, the Windows® operating system, and online platforms. Comprising a network of top developers, Microsoft Game Studios is committed to creating innovative and diverse games for Windows (http://www.microsoft.com/games), including such franchises as “Age of Empires®,” “Flight Simulator” and “Zoo Tycoon®”; Xbox and Xbox 360 (http://www.xbox.com), including such games as “Gears of War” and franchises such as “Halo,” “Fable®,” “Project Gotham Racing®” and “Forza Motorsport®”; and MSN® Games (http://www.games.msn.com), the official games channel for the MSN network and home to such hits as “Bejeweled” and “Hexic®.”

    About Bungie Studios

    Bungie Studios was founded in 1991 with two goals: to develop games that combine brilliant technology, beautiful art, intelligent stories and deep gameplay, and then sell enough of those games to achieve its real goal of total world domination. Over the past 10 years, it has produced games such as the “Marathon” trilogy and the first two “Myth” games, hailed as classics by critics and gamers around the world. Bungie’s “Halo” franchise is an international award-winning action title that has grown into a global entertainment phenomenon, selling more than 14.8 million units worldwide, logging nearly 1 billion hours of multiplayer action on Xbox LIVE, and spawning action figures, books, a graphic novel, apparel and more. “Halo 3,” the final installment in Bungie’s epic “Halo” trilogy, released on Sept. 25 to critical acclaim and record-setting sales. More information on Bungie can be found at http://www.bungie.net.