I am trying to get data from different sever, and the sever name might change. So I set the server name as a parameter. The idea of my sql store procedure is something like this
CREATE PROCEDURE [dbo].[GetData]
@ServerName
AS
BEGIN
SELECT * FROM @ServerName.ClientDataBase.dbo.Client
END
Does anyone know how to achieve this...
Which operator: / or * will have the higher priority in MySQL?
...
I am looking to do some modeling and would like to have a tool that can capture not only a relational model like ERWIN but also allow us to easily port to LDAP as an option.
NOTE: Visio can connect to an existing LDAP server and draw, but does not allow for you to model first and then deploy, unlike its relational capabilities.
...
Hey there I got a problem with my code, I compared three ways of implementing a query on a database
Standard SQL Query (From * Select ...)
LinQ Query
Precompiled LinqQuery (CompiledQuery)
Now the result I got is that the Precompiled LingQuery is 5 times faster than the LinQ Query but much more interesting ist that the Standard SQL Q...
There are 3 different ways to get data out of a Blob column:
getBytes
getBinaryStream
getBlob
Also, the Blob object returned by getBlob also has a getBytes and getBinaryStream on it.
Are there any particular reasons (performance, memory, database specific problems) that I should pick one over the other?
The Blob object also has a fre...
I have a table containing a unique ID field. Another field (REF) contains a reference to another dataset's ID field.
Now I have to select all datasets where REF points to a dataset that doesn't exist.
SELECT * FROM table WHERE ("no dataset with ID=REF exists")
How can I do this?
...
I have a forum application using asp.net, c#, sql server and linq to sql. It suffers from multiple inserts, I think when the insert button is pressed but also maybe when the browser is refreshed or back is clicked.
What's the most comprehensive way, or ways to prevent this.
UPDATE:
I currently use response.redirect after inserting text...
Duplicate:
How to do a Select in a Select
I have 2 tables:
TABLE1
Table1Id
TABLE2
Table2Id
Table1Id
UserId
TABLE2 has thousands of entries in it. I want to return a list of TABLE1 entries where there isn't an entry in TABLE2 for it for a particular user. So, where there isn't a foreign key entry in TABLE2. A query like:
select...
After prepairing an answer for this question I found I couldn't verify my answer.
In my first programming job I was told that a query within the IN () predicate gets executed for every row contained in the parent query, and therefore using IN should be avoided.
For example, given the query:
SELECT count(*) FROM Table1 WHERE Table1Id N...
There are some tool (free preferentially) to to migrate data between different DBMS (like from MySql to Firebird, or Sql Server to Sqlite, etc)?
Edit:
I want specifically to migrate from "Firebird Embed" to "Sqlite". But in another situations (like migration of my customers websites) I need migrate from MySql to Sql Server (and vice-ver...
I'm attempting to insert multiple rows into a DB2 database using C# code like this:
string query = "INSERT INTO TESTDB2.RG_Table (V,E,L,N,Q,B,S,P) values" +
"('lkjlkj', 'iouoiu', '2009-03-27 12:01:19', 'nnne', 'sdfdf', NULL, NULL, NULL)," +
"('lkjlk2', 'iuoiu2', '2009-03-27 12:01:19', 'nnne2', 'sddf2', NULL, NULL, NULL)";
DB2Command cm...
I am having a problem with Hibernate generating invalid SQL. Specifically, mixing and matching implicit and explicit joins. This seems to be an open bug.
However, I'm not sure why this is invalid SQL. I have come up with a small toy example that generates the same syntax exception.
Schema
CREATE TABLE Employee (
employeeID INT,
name...
This query fails:
SELECT xpath('/my/xpath/expr', my_xml)[1] FROM my_table
ERROR: syntax error at or near "["
But this one works:
SELECT x[1] FROM
(SELECT xpath('/my/xpath/expr', my_xml) as x FROM my_table) as ss
My xpath expression always returns only a single value, but the Postgres xpath function returns an array. I want t...
I have a set of call detail records, and from those records, I'm supposed to determine the average concurrent active calls per system, per hour (at a precision of one minute). If I query 7pm to 8pm, I should see the average concurrent calls for the hour (averaging the concurrent calls for each minute) within that hour (for each system). ...
This is really a VB.NET/C# question. Ok, so I essentially have a database layer that is totally isolated from any business logic. This means that whenever I get ready to commit some business data to a database, I have to pass all of the business properties into the data method's parameter. For example:
Public Function Commit(foo as o...
I have created a letter game in java and i need to include a high score function into it. Using Microsoft access database through JDBC.
The table in the database contains the following
Table name Easy
fields
Name
Score
Time
In need an SQL statement that displays the top 5 scores in the order highest score and lowest time.
eg.
if the...
Up to now in my programming career (two years) I have not had much database experience, but the company where I now work uses databases extensively for their product, and I feel behind the curve.
So I would like to know how best to start learning database interaction with C#. I've read about LINQ-to-SQL and ADO.net. Are these the right ...
Greetings SQL gurus,
I don't know if you can help me, but I will try. I have several large databases grouped by year (each year in a different database). I want to be able to compare values from a particular week from one year to the next. For example, "show me week 17 of 2008 vs. week 17 of 2002."
I have the following definition of w...
I have created a letter game in Java and I need to include a high score function in it using a Microsoft Access database through JDBC. The table in the database contains the following fields
Table Name: Scores
Name (Text)
Difficulty (Text)
Characters (Number)
Accuracy (Text)
Time (Text)
Score (Text)
I need a SQL st...
Hello guys, i dont know how to go about this but i need urgent assistance from you guys.
I have two tables namely States, Package_Details. Below are the details of the table.
States
state_id
state_name
Package_Details
id
sender_state //Stores state with state ID
receiver_state //Stores state with state ID
...