Here is my LINQ query:
(from o in entities.MyTable
orderby o.MyColumn
select o.MyColumn).Distinct();
Here is the result:
{"a", "c", "b", "d"}
Here is the generated SQL:
SELECT
[Distinct1].[MyColumn] AS [MyColumn]
FROM ( SELECT DISTINCT
[Extent1].[MyColumn] AS [MyColumn]
FROM [dbo].[MyTable] AS [Extent1]
) AS [Distinct1]...
With Management Studio I can't alter the index. Dropping it doesn't work because it's being used as a foreign key in a lot of other tables. Can I somehow alter it? Or how would you do this?
...
Hi,
In Sql Server when you select to modify a SP or UDF it loads the objects alter query in a query window. Are these queries accessible in a system table so I can store the alter statements somewhere? It looks like syscomments has some objects but not all of them.
Thanks
...
One of my clients is hooked on multi-column substring matching.
I understand that Contains and FreeText search for words (and at least in the case of Contains, word prefixes). However, based upon my understanding of this MSDN book, neither of these nor their variants are capable of searching substrings.
I have used LIKE rather extensi...
I am using C#, Entity Framework and SQL Server 2008 Express.
I am connected to the database over the internet.
What is the best method to speed up saving/updating data to database?
It takes 87 seconds to save 180 records to the database.
It takes only 3.5 seconds to save the same number of records to local (on the same machine) SQL Serve...
Hello, I have SQL Server 2008 Ent and OLTP database with two big tables. How I can move this tables to another filegroup without service interrupting? Now, about 100-130 records inserted and 30-50 records updated each second in this tables. Each table have about 100M records and six fields (including one field geography).
I looking for ...
I've read through a lot of posts regarding the problem, but none of the proposed solutions have worked for me. I continue to get an error stating, "The permissions granted to user '\Rich' are insufficient for performing this operation. (rsAccessDenied)." If I am logged in as the local administrator account, entering the Reporting Service...
Is there a way to specify, for example 4 distinct values for a varchar column in MS SQL Server 2008?
For example, I need a column called Frequency (varchar) that only accepts 'Daily', 'Weekly', 'Monthly', 'Yearly' as possible values
Is this possible to set within the SQL Server Management Studio when creating the table?
...
Is there a way to tell how to get a file size that is uploaded to database?
SELECT [ID]
,[File]
FROM [dbo].[Reports]
I would like to be able to tell user the size of File which is VarBinary(max) field in MS SQL 2005/2008. How to do that?
Maybe the only way to do is to create another column and when inserting file i should al...
Hi
I need help with query to find all the dates that between 31/12/2009 and 31/02/2010
In SQL Server 2008
i try this:
SELECT convert(varchar(50), MyDate, 103)
where convert(varchar(50), MyDate, 103) >= '31/12/2009' and convert(varchar(50), MyDate, 103) <='31/02/2010'
but it give me wrong result
why ?
...
SQL Server 2008 is telling me to include the Primary Key in an index in the Included Column field. I thought the PK was automagically returned with all indexes?
...
Is it possible to use deepEarth with sql server 2008 spatial, or is there aney other open-source mapping solutions for Silverlight and sql server 2008.
Tanks for any thought on this.
...
I have to include one report in my application showing offline/online activity of few databases on SQL Server 2008.
Could you please suggest how can I collect teh same information from sql server?
...
Hi, the question is hard to define without giving an example, e.g. I'd like to achieve something like this
:
SELECT
(CASE WHEN ...) AS FieldA,
20 + FieldA AS FieldB
FROM Tbl
Assuming that by "..." I've replaced a long and complex CASE statement, hence I don't want to repeat it when selecting FieldB and use the aliased FieldA instea...
Hi all,
Recently, I was trying to optimise this query
UPDATE Analytics
SET UserID = x.UserID
FROM Analytics z
INNER JOIN UserDetail x ON x.UserGUID = z.UserGUID
Estimated execution plan show 57% on the Table Update and 40% on a Hash Match (Aggregate). I did some snooping around and came across the topic of JOIN hints. So I added a L...
So I installed a trial of SQL Server 2008 enterprise edition while waiting for MSDN licenses to come through - I now want to uninstall the trial and replace it with a developer edition installation.
However, I'd like to first know how long I have left on the trial. Is there a way to do this programmatically with SQL? I looked at creat...
Can Microsoft SQL Server 2008 Web Edition be used in "closed" websites, which are hosted on the Internet, but require users to log in?
We are developing a web application for banks. This is a website for clients of the bank; it allows clients to log in and view information on their personal banking accounts, stock portfolios, etc.
Can ...
Is this a bug, or some hidden limit I can't find any documentation about? When creating a Send Mail Task in SSIS 2008, the TO, CC and BCC fields seem to have a hidden limit of 255 characters. I'm aware this is the standard limit for individual email addresses, but all three are commonly used for multiple addresses and the comment for the...
I can't see to find a quick explanation of the differences so I can figure out which to use.
One is for a server one is for a Database? Im not sure what that means..
Basically we are doing a new web app and I want to see what these project types can offer me in terms of tracking the DB code/schema etc..
...
I ran a very basic query against one of our table and I noticed that the execution plan query processor is recommending that we create an index on a column
The query is
SELECT SUM(DATALENGTH(Data))
FROM Item
WHERE Namespace = 'http://some_url/some_namespace/'
After running, I get the following message
// The Query Processor estimat...