query (13,475)


c# How do I get a distinct, ordered list of names from a DataTable using LINQ?

c# How do I get a distinct, ordered list of names from a DataTable using LINQ?

I have a DataTable with a Name column. I want to generate a collection of the unique names ordered alphabetically. The following query ignores the order by clause. var names=(from DataRow dr in…


search Lucene Score results

In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match…


Deploying SQL Server Databases from Test to Live

I wonder how you guys manage deployment of a database between 2 SQL Servers, specifically SQL Server 2005. Now, there is a development and a live one. As this should be part of a buildscript(standar…


sql Swap unique indexed column values in database

I have a database table and one of the fields(not the primary key) is having a unique index on it. Now I want to swap values under this column for two rows. How could this be done? Two hacks I know…


How big can a MySQL database get before performance starts to degrade

At what point does a MySQL database start to lose performance? Does physical database size matter? Do number of records matter? Is any performance degradation linear or exponential? I have what I be…


sql server What is the best way to copy a database?

I always create a new empty database, after that backup and restore of the existing database into it, but is this really the best way? As it seems very error prone and over complicated for me.…


sql server Can I logically reorder columns in a table?

If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries? I don't want to mess with the physical layout of columns on disk, but I wou…



sql server Which tools do people use to create Data Dictionaries?

On the project that I am working on I have a couple of databases. Each table and each column in the database has a description set(as an extended property in SQL 2005). As a part of the documentatio…


asp.net Are Multiple DataContext classes ever appropriate?

In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create DataContext classes(which is usually done using the designer in VS 2008). From the UI perspective, the DataCo…


I need to know how much disk space a table is using in SQL Server

I think most people know how to do this via the GUI(right click table, properties), but doing this in T-SQL totally rocks.…


How to remove the time portion of a datetime value(SQL Server)?

Here's what I use: SELECT CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME) I'm thinking there may be a better and more elegant way. Requirements: It has to be as fast as possible(the less casting,…


Map Routing, a la Google Maps?

I've always been intrigued by Map Routing, but I've never found any good introductory(or even advanced!) level tutorials on it. Does anybody have any pointers, hints, etc? Update: I'm primarily look…


SQL Server 2005 For XML Explicit-Need help formatting

I have a table with a structure like the following:------------------------------ LocationID | AccountNumber------------------------------ long-guid-here | 12345 long-guid-here | 54321 To pass…




sql how example from select with mysql multiple server get