3,509 reputation
21529
bio website
location Bern, Switzerland
age 48
visits member for 3 years, 2 months
seen 10 hours ago

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.


2d
comment Get into SQL Server 2008 with no management studio and no sqlcmd
@MikeFal: sqlcmd replaced osql in SQL Server 2005, actually ...
Apr
18
comment New SQL Server 2008 instance, load old instance DB's
MDB is MS Access - not SQL Server. SQL Server data files are .mdf (and .ndf), transaction log files are .ldf
Apr
7
comment How control 27 locations and 27 databases?
You might need a third-party tool like Spotlight on SQL Server to handle such a job
Apr
7
comment How control 27 locations and 27 databases?
There is no SQL Server 2012 R2 - there are versions 2008 R2, or then 2012, and now just recently 2014 was released ....
Apr
5
comment Which should I use on my DB? - Clustered Index or Non Clustered Index or Both
To be very clear: the primary key in SQL Server DOES NOT determine the physical ordering of the table! It's the clustering key which does that. By default, the primary key is also the clustering key - but it doesn't have to be. The primary key is "just" a logical construct to uniquely and reliably identify every single row in your table.
Apr
3
comment Database Normalization: A Case Of The NULLs
Another option could be to make the column non-nullable, and define a "magic" value that sort of "takes over" the meaning of NULL - like -1 for an INT column. It's sometimes frowned upon - but it makes your queries a lot easier if you can rely on an INT value to always be there for sure.
Apr
3
comment SQL Performance issue after migration from SQL Server 2005 to SQL Server 2012
Shrinking the database can totally screw up your indexes and can massive fragmentation. If you insist on keeping that step, do this before you reorganize & rebuild your indexes, so that those indexes can be defragmented after shrinking the database. Or leave out that step altogether.
Mar
19
comment Can I recover a single table from a SQL Server 2012 database backup
You cannot really restore just a single table out of a SQL Server backup - SQL Server backups are all-or-nothing.
Mar
18
comment Efficient way to Add NON-CLUSTERED Index?
Try your two approaches, measure performance -> pick the better option!
Mar
15
comment Update Statement takes forever to complete
If you're trying to update 35'000 rows at once, you might run into the problem that SQL Server will use a lock escalation and will attempt to lock the entire table for an update. If something else is already happening at the same time, SQL Server might just not be able to get that table-wide, update/exclusive lock - so it'll wait until it does get that lock... you can get around this by updating no more than 5000 rows at once
Mar
13
comment SQL Server 2008 R2: cannot attach database
Which part of file not found do you not understand? The file you're looking for to attach isn't there ... Are you trying to attach to a remote SQL Server instance, and the .mdf file is on your local `C:` drive? That won't work! The file must be on the server machine - not your local PC ....
Mar
2
comment Reduce DB size - SQL Server, SSMS
There is no version 2012 R2 - there is 2008 R2, or 2012 (with or without SP1) ....
Feb
26
comment Help with “Flexible” vs Fixed Tables
I definitely share your concern .... this already smells bad now.... wait until you have millions of rows ..... tell your super-clever boss to read this exposé on how EAV can go horribly wrong and sink companies - hopefully we'll come around and change his mind!
Feb
19
comment Normalisation of practise database
By default, every table ought to have a primary key! It's what reliably, uniquely identifies each row of the table - so NO, by no means just ignore adding primary key to your tables! That's a horrible design ....
Feb
10
comment Reset SQL Server sa password
No, no data will be lost! You can easily uninstall and re-install SQL Server and then re-attach the existing .mdf files to the new installation again.
Jan
29
comment Using unique non clustered index with unique clustered index
From the fact you mention clustered index, I assume this is for sql-server - added tag to indicate as much
Jan
26
comment Insert text data into image datatype using SQL Server 2000
WHY on earth do you want to do this? Image is for binary data - not for text.... large volumes of text should be stored in TEXT columns in SQL Server 2000
Jan
20
comment Why is multiple independent index always better than concatenated index
Highly depends on what your data and your queries look like - there's no simple, generally valid answer to this....
Jan
18
comment The memory usage of SQL Server keeps growing
If your database design is optimal, and your queries are optimized - then the apps will use less memory so SQL Server will have to cache less pages in the buffer pool and possibly less execution plans in the plan cache
Jan
18
comment The memory usage of SQL Server keeps growing
SQL Server will try to use as much memory as it can get to speed up queries. That's by design - that's not a bug. If your buffer pool gets polluted, then maybe the application and database design are not as good as they could be - tables are too large, queries are inefficient.....