3,799 reputation
21735
bio website
location Bern, Switzerland
age 49
visits member for 3 years, 9 months
seen yesterday

Note to all SO beginner:

Please read (and embrace!) Jon Skeet's helpful hints on how to write a good question (or at least his short version here ) - one that has a chance that someone can answer it.


A Pascal/Delphi programmer and database freak at heart, I work as a C# developer on line-of-business applications (mostly ASP.NET).

I'm interested mostly in distributed systems (WCF), database (design and SQL), and Active Directory.


I'm an MCPD .NET 4 Web Developer, MCPD .NET 4 Windows Developer, MCPD Enterprise Application Developer (.NET 3.5), and MCTS for WCF, ADO.NET, Winforms and ASP.NET.


1d
comment how to define trigger scope variable
Your trigger has MAJOR flaw in that you seem to assume it'll be called once per row - that is not the case. The trigger will fire once per statement, so if your UPDATE statements affects 25 rows, you'll get the trigger fired once, but then Inserted and Deleted will each contain 25 rows. WHich of those 25 rows will your code select here?? SELECT DiscountPercent FROM Inserted - it's non-deterministic. You need to rewrite your trigger to take this into account!
1d
comment Performance issue when we directly insert into #temp table
"If you have two horses and you want to know which of the two is the faster then race your horses." ericlippert.com/2012/12/17/performance-rant
1d
comment SQL Server Management Studio: how to parse stored procedure code and check if table columns exist?
That is defined behavior, and it's by design. The "Parse" only check for syntactical errors. It does NOT check for object existence, and I'm not aware of any way or option to turn this on.
Nov
21
comment Where's my missing Sql Server Express 2005 Database space? Size and space available dont add up to SQL express size 4G?
Upgrade to SQL Server 2008 R2 Express (or even newer) - the limit has been upped to 10 GB
Nov
18
comment SQL Server is very slow
You have to provide a lot more information so anyone can help you! What does the database look like - tables and their columns, what queries do you run against those tables, how many rows are in those tables, what indexes are in place, what are the hardware parameters of the physical server box, what other activity is on that server? .....
Nov
18
comment Protect SQL Server Express data file
No, this is not dbase or Access - you cannot protect a SQL Server data file by a password or anything. If it's out there in the open, and someone with admin permissions on a SQL Server decides to attach it and peek inside it - there's no way to stop him from doing that.
Nov
17
comment Upgrading SQL Server 2008 R2 Standard edition to SQL Server 2008 R2 Enterprise edition what is the process and the impact?
There's absolutely no impact at all. The only thing that changes is that some additional features in SQL Server become available, so your performance might get better in certain areas, or you have more options to performance tune your queries.
Nov
17
comment SQL Performance: COUNT or extra attribute?
That highly depends on what concrete database you're talking about, and on what the table structure and available indexes look like....
Nov
9
comment SQL Server 2008 user and group permissions behavior weirdness
You need to take care: a login is on the server-level - a SQL Server instance has logins. Each database then has users that are linked to those logins. You cannot have a database has a login..... the server has a login, and the database has a user connected to that login.....
Nov
1
comment SQL Server clustered index, index balancing and insert performance using NewID
Sorry, you're right - I must have misread that.....
Nov
1
comment SQL Server 2008 R2 – Track Database Growth (Production Database)
There's also the built-in Performance Data Collector in SQL Server 2008 R2 which allows you to collect certain key indicators (including size) of databases and your servers into a performance management database
Oct
21
comment Best way to profile SQL Server
Really not a programming question --> should be moved to dba.stackexchagne.com
Oct
17
comment What can cause mongodb used memory to increase?
It's memory (not memery)
Oct
7
comment Unable to copy a DB from SQL Server 2000 to SQL Server 2012 using copy wizard
You cannot upgrade directly from SQL Server 2000 to 2012 - you'll have to go from 2000 to 2008 R2 and then from there on to 2012. That happens when you stick to dead-old versions for too long .....
Oct
1
comment Non clustered index on multiple columns
You cannot index a nvarchar(max) column - one of the great drawbacks of the "max" datatypes....
Sep
24
comment T-SQL How to Pivot on the Values of a Table?
If you post code, XML or data samples, please highlight those lines in the text editor and click on the "code samples" button ( { } ) on the editor toolbar to nicely format and syntax highlight it! This is not a HTML forum - please try to avoid messy and excessive HTML tags in your posts - thank you!
Aug
17
comment Is it possible to restore only tables/constraints from database backup?
NO, you cannot extract only bits and pieces from a .bak backup file - the restore is an all-or-nothing process. You could restore to a temporary staging database, and then just fetch those bits and pieces you need
Aug
15
comment Querying LDAP multi-value attributes using Openquery
If I remember correctly, as soon as an LDAP attribute is defined to be multi-valued (no matter whether it really contains multiple values or not), it cannot be read by the ADO.NET provider. This provider is deprecated anyway, so I wouldn't spend too much time on working with a "dead horse"....
Aug
3
comment Execution Plan in Microsoft SQL Server
@AaronBertrand: absolutely - one of the trickier aspects of plan caching ...
Aug
3
comment Cannot open database “user_auth.mdf” requested by the login. The login failed. Login failed for user 'web_user'
If you created the database using SSMS, you should use the logical database name and not the file with .mdf in your connection string! Use Server=XYZ;Database=user_auth;User ID=web_user;Password=web_user for your connection string and let SQL Server worry about the file-related details.