sql

2008 SQL Server Express Load Balancing

Hi, I have 3 home PCs that have 2008 SQL Server Express instances installed on each one of them... but right now only one has my database and I'm also running an application on that machine that requests a bunch of data from the database. I don't know a whole lot about server architecture, but I have read some guides from Microsoft's we...

How can I select tags from an SQL XML Query?

How can I retrieve the fields within an XML field in MS SQL? Every query I try does not work as intended whenever I use this XML code: <soap:Envelope xmlns:xsi="[URI]" xmlns:xsd="[URI]" xmlns:soap="[URI]"> <soap:Body> <RunPackage xmlns="[URI]"> <xmlDoc> <Request> <SubscriberCode>76547654</SubscriberCode> ...

Different results from .mdb vs .odb, why?

I use the following query to retrieve data from a .mdb file through JDBC, however when I try it on an .odb file it goes does not throw any exceptions but there are no results at all. I am wondering is .odb case sensitive where .mdb is not or is there something else I am missing? "SELECT DISTINCT column-one + ':' + column-two As ResultCo...

Oracle 11g SQL to get unique values in one column of a multi-column query

Given a table A of people, their native language, and other columns C3 .. C10 represented by ... Table A PERSON LANGUAGE ... bob english john english vlad russian olga russian jose spanish How do I construct a query which selects all columns of one row for each distinct language? Desired Result PERSON L...

How to apply dynamically created controls to a catagory.

(C#/SQL/Approach-question) This has to be one of the hardest nuts I've ever had to crack. So I sincerely hope one of you smart people out there have tried to solve this before! :) I have a much of catagories (A,B,C) with pictures. For each picture I need to ascribe some information, based on some controls that have either no- or pred...

Oracle lag between commit and select

Hello, We have an Java workflow application that uses an Oracle database to track its steps and interactions with other services. During a workflow run several insert/update/selects are performed and occasionally the select will not return the updated data, even though the insert/update commit that ran before it completed successfully....

Relational database theory and SQL book recommendations?

I'm looking for a book which combines relational database theory, design and SQL techniques in a generic sense if possible. I have a feeling this is a big ask, and if that's really not available then I don't mind having perhaps two separate specialist books (one for RDBMS theory and one for SQL techniques). Any recommendations? ...

How do you strip a character out of a column in SQL Server?

How do you remove a value out of a string in SQL Server? ...

Query times out in .Net SqlCommand.ExecuteNonQuery, works in SQL Server Management Studio

Update: Problem solved, and staying solved. If you want to see the site in action, visit Tweet08 I've got several queries that act differently in SSMS versus when run inside my .Net application. The SSMS executes fine in under a second. The .Net call times out after 120 seconds (connection default timeout). I did a SQL Trace (and col...

SQL Server *= Operator?

Today while inside a client's production system, I found a SQL Server query that contained an unfamiliar syntax. In the below example, what does the *= operator do? I could not find any mention of it on MSDN. The query does execute and return data. As far as anyone knows, this has been in the system since they were using SQL Server 2...

How does StackOverflow suggest related questions?

Possible Duplicates: Stackoverflow Related questions algorithm Stackoverflow Search Algorithm I expected the answer to my question to appear in the Related Questions after I typed it; however, ironically, it did not. How does StackOverflow generate the list of related questions before I submit a new question? Is it using a fu...

secure ODBC connection -- oxymoron?

Hello - There are times we need to create an ODBC connection over the "tubes" to one of our customer sites. We would like to provide as much security as possible to our customers, given we are using ODBC and, well... Anyway, there is a checkbox setting in the SQL Server DSN that says "Use strong encryption for data", but absolutely no...

saving a column in an array

i m trying to fetch random no. of entries from a database by using SELECT QNO FROM TABLE ORDER BY RAND() LIMIT 10 it returns a column of databse if i want to save all the entries in a array then which php function is to used to save the column................ ...

In a site like StackOverflow should the Question and its Votes be separate tables?

I'm making a site like StackOverflow in Rails but I'm not sure if it's necessary for the Votes on a question to be stored in a separate table in the database. Is there any good reason to separate the data? Or could I store the Votes as a single sum in a field of the Questions table? ...

Return Value from Stored Procedure not set

I have the following very basic stored procedure: CREATE PROCEDURE [dbo].[GetNumberToProcess] AS RETURN 999 I then have some code using Enterprise Library to run and get the return value: Dim cmd As DbCommand Dim ResultValue as String Dim lDBCommand as String = "dbo.GetNumberToProcess" Dim actionDB As...

Rails SQL Query with find

I want this SQL query to be written in rails controller using find select id,name from questions where id not in (select question_id from levels_questions where level_id=15) How will I do this?I am using Rails framework and MySQL db thanks in advance. ...

Can you define "literal" tables in SQL?

Is there any SQL subquery syntax that lets you define, literally, a temporary table? For example, something like SELECT MAX(count) AS max, COUNT(*) AS count FROM ( (1 AS id, 7 AS count), (2, 6), (3, 13), (4, 12), (5, 9) ) AS mytable INNER JOIN someothertable ON someothertable.id=mytable.id This would sav...

Cascading Delete / Update in LINQ-to-SQL class

Hi, I am not deleting records permanently (just maintaining flag) but I'd like to know how cascading delete / update works in LINQ-to-SQL class. EDIT If I have similar situation e.g. maintaining flag for Delete option. How do you achieve Cascading Delete for your database? ...

Which tables/views contain the list of objects used by Service Broker?

Hey StackOverflow, I work with Service Broker. I need to know which Service Broker entities (message types, contracts, etc.) have been added to the database I am dealing with. The question refers to MS SQL Server 2005. Thank you! ...

Delete duplicate records from a SQL table without a primary key

I have the below table with the below records in it create table employee ( EmpId number, EmpName varchar2(10), EmpSSN varchar2(11) ); insert into employee values(1, 'Jack', '555-55-5555'); insert into employee values (2, 'Joe', '555-56-5555'); insert into employee values (3, 'Fred', '555-57-5555'); insert into employee values (4, '...