I wonder how the DataContext handles concurrency violation.
For example -
Two users are fetching some data from the database, then some of them change some row and commit changes, then other user trying commit their changes so a ChangeConflictException should occur, but how does the DataContext know that the data has changed?
Fetch...
I am struggling with a query in SQL Server 2005-2008
There are 15 participants in a tournament. Every day, 7 random participants are chosen. Out of the 7, one is the teamleader.
The condition is that if a person has become a teamleader once, he cannot become again till all the others (rest 14) have got their chances.
How can i write ...
I'm trying to make my integration tests more idempotent. One idea was to execute rollback after every test, the other idea was to some how programatically parse the text, similar to the green check box in Query Analyzer or SSMS.
How do I get SQL Server to parse my command without running it using ADO.NET?
UPDATE:
This is what finally...
I have the following situation:
DB Server 1 is Sql Server 2008 and hosts database A with transaction records
DB Server 2 is Postgres and hosts database B with records of prices
Server2 is added as a linked server to server1.
I need to run a query where for each transaction record on server1 I need to check a number of prices from serv...
This is really dumb question but still my head cannot work it out.
I have a table with Orders, each order has userID in it. User can have unlimited amount of Orders. How do i make count of unique userIDs ?
...
Hi,
I need to allow my end users to view SQL Server Analysis Services data mining model (to be exact Association finding).
I'm looking for a tool which can do the job. For the cubes I'm using Excel OWC, and I'm quite satisfied.
So far I had found only DM Companion . But I'm struggling to find anything else. Can you recommend somethi...
In a SQL Server external stored procedure(written in C) that I am trying to migrate, the SRV_PROC structure is the entrance parameter for a used method.
Is it possible to call this method in Oracle or do I have to change the data type into something else? Is there any workaround for this situation?
...
I've been reading a lot of articles that suggest putting a Memcached (or Velocity, etc) in front of a database is more efficient than hitting the database directly. It will reduce the number of hits on the database by looking up the data in a memory cache, which is faster than hitting the database.
However, SQL Server has it's own memo...
We've recently moved our company website to a new host.
It is an ASP.NET site with C# code behind, connecting to MS SQL server.
Since moving the site to the new server, the site is exceeding the connection pool limit (which is not set explicitly, so I believe is at the default size of 100).
Inspection of the open processes via SQL Serv...
i am getting the following error while executing the following query in an Stored Procedure..Could anyone help in finding the fault?
UPDATE is not allowed because the statement updates view "sup_item" which participates in a join and has an INSTEAD OF UPDATE trigger.
UPDATE si
SET
name = mc.name,
sup_item_cat_id = mc.res_sup_i...
Hello all,
I have tried something like this:
select PREPRO = case when (isnumeric(PREPRO) = 1 and
PREPRO in ('0','1','-1')) or
convert(varchar, PREPRO) in ('True','False')
then convert(bit, convert(integer, PREPRO)) else 'No' end
from dbo.TI10SE
The PREPRO contains all "False".
I get this error:
Conversion failed when converting ...
I have a SQL stored procedure of the form
SELECT [fields] FROM [table] WHERE @whereSql
I want to pass the procedure an argument (@whereSql) which specifies the entire WHERE clause, but the following error is returned:
An expression of non-boolean type specified in a context where a condition is expected
Can this be done?
...
For example, there is a string field Name in my C# (Linq-to-SQL); what data type would that SQL field have to be?
varchar? nchar? I'm confused.
...
i use this SMO code to attach a database.
Server mServer = new Server(".");
mServer.AttachDatabase("DbName", new StringCollection {
"DbName.mdf",
"DbName_log.LDF" }, AttachOptions.None);
But i keep getting the exception
Failed to connect to server.
Any Ideas?
[EDITED]
Inner Exception...
Hello All!
I'm having an issue trying to set variable in SQL in a stored procedure. I'm checking to see if a record is set to active, and the idea is to set it to inactive or vice versa.
Admittedly I'm not the best with SQL and have tried CASE statements along with my example, but nothings working...
Could someone show me what I'm mis...
Here is the SQL script:
create table Employee(
Carnet nvarchar(15) primary key,
Name nvarchar(500),
LastName nvarchar(500)
)
create table Document(
ID nvarchar(20) primary key,
Employee nvarchar(15) foreign key references Employee(Carnet),
Project nvarchar(20) foreign key references Project(ID)
)
create table DocumentsArea(
DocumentID...
When I developed a site with VS 2008 it happily connected to a the webservice in the solution, then connected to the database (using ADO.Net Entities) and ran my query.
Now I come to rolling out the site. When it connects to the webservice it is connecting as NETWORK SERVICE - which I don't want - I need it to connect as 'MYCREDENTIAS'....
Subsonic 3.0 is updating multiple rows instead of just the one it's supposed to
DB Table is defined as follows -
Col1 int NOT NULL
Col2 Text NOT NULL
Col3 INT NOT NULL
ColX NTEXT
COLY NTEXT
Primary Key = Col1 + Col2 + Col3
....
the select expr is as follows
myTable a = myTable.SingleOrDefault( x => x.Col1 = 1 && x.Col2 = 'a...
For example, the column ID. I want it to start at 1, and then increment by 1 for each row.
Thank you!
...
I was trying to register a 64 bit machine under new Utility control point name, get the following
"The SQL Server edition must support UCP creation. Validation failed. The specified instance of SQL Server cannot be used as a utility control point because the feature is not enabled in SQL Server 'Standard Edition (64-bit)'. For more info...