Hello,
I've been trying for a couple of days to write to "translate" this query in LINQ with no success so far. Could you guys please help me? I would also appreciate some explanation to learn actually something out of it.
Here is the T-SQL query:
SELECT R.ResourceID, R.DefaultValue
FROM Resources as R
JOIN
(SELECT [t0].[NameResou...
I have a list of records that I want to page through using LIMIT however the first record that is returned without LIMIT is also the root identifier for the rest of the records and I need to keep it for every page. Is this possible? (I would just prefer not to run a extra sql statement)
id | index | title
1 | 0 | index of t...
How do I convert hexadecimal to decimal (and back again) using Oracle SQL?
...
Hello folks,
this statement I use in a sproc (where the search phrase 'reiseportal*' is a parameter) does not work with a wildcard, as I recognized:
DECLARE @strSQL NVARCHAR(MAX)
SELECT @strSQL= 'SELECT FileName, path, size, vpath from "GRIP-SERVER"."Web2"..SCOPE() where contains
('SELECT @strSQL=@strSQL + CHAR(39) + CHAR(39)+ 'reise...
Hi,
Im trying to create a easy sine curv in SQL which alternates between the values (0-23).
I have the following variables: x, which is the current offset. y which is the destinated offset, and z which is my max value(23).
Anyone that could help me with the expression? Have googled and read about it, but havent got it to work yet..
W...
I want to retrieve the most recent requestid from table tblquoteproposal` for perticular customerId here 3, in this example ID 2 & ID 4.
table tblrequest
requestid Customerid
6 2
7 4
8 3
9 3
Table tblquoteproposal
id requestid QuotePraposalLink comment
1 6 ...
I need to create two tables.
The first one I can get via database with a command. No sweat.
The second one is built from the first one with nested SELECT
statements, JOINs, and operators like SUM, AVG etc.
So it needs more functionality than filtering and sorting.
It is done in C# with .NET 2.0, so no advanced features
available.
Ess...
Say I have two tables:
KnownHours:
ChargeNum CategoryID Month Hours
111111 1 2/1/09 10
111111 1 3/1/09 30
111111 1 4/1/09 50
222222 1 3/1/09 40
111111 2 4/1/09 50
UnknownHours:
ChargeNum Month Hours
111111 2/1/09 ...
In a SELECT call we are returning two different timestamps, but because each column is each called 'timetag' we cannot differentiate between them in the results. The obvious solution of renaming one of the columns will result in a large amount of refactoring which we want to avoid. Our query looks something like this:
DECLARE
p_cur...
Hello, In a database table with a structure like this :
Table 1
Name | Id
A 1
B 2
Table 2
Table1's ID | IntValue
1 11
2 66
now, there is a query which joins the 2 tables and outputs something like
A | 11
B | 66
but the problem is that when, let's say row (A,1) gets deleted from table1 the...
Duplicate: this exact question was asked by the same author in http://stackoverflow.com/questions/1221583/how-do-i-update-a-xml-string-in-an-ntext-column-in-sql-server. Please close this one and answer in the original question.
I have a SQL table with 2 columns. ID(int) and Value(ntext)
The value rows have all sorts of xml strings in...
Is there a portable way of determining if a database table already exists or not?
...
I have the following DataTable (counting hours of work):
start | end | time
-----------------+------------------+------------------
2009-05-01 08:00 | 2009-05-01 10:00 | 2009-05-01 02:00
2009-05-02 07:30 | 2009-05-02 11:00 | 2009-05-02 03:30
2009-05-03 23:00 | 2009-05-04 02:00 | 2009-05-03 03:00
There's a ...
I want to read lots of data(single column nvarchar(max)) from SQL Server 2005 and deserialize it to an object. We are currently using the following, but this is not fast enough is there a better/efficient way to do it?
using(MemoryStream stream = Encoding.UTF8.GetBytes((string)cmd.ExecuteScalar()))
{
XmlTextReader xmlReader;
DataCon...
ok so this is what I am trying to achieve is to have two SELECT statements and then join results of each so I have something like this
SELECT table.ID, tst.Value
FROM blah AS table JOIN results AS tst ON tst.RUNID = table.RUNID
WHERE table.RUNID IN
(
...// nothing important but in the end i get my tst.Value
)
second statement is ...
I was wondering how I would return the result of the left most condition in a OR clause used in a LEFT JOIN if both evaluate to be true.
The solutions I've come upon thus far both involve using CASE statement in the SELECT, this does mean I'd abandon the OR clause.
The other solution involved using a CASE statement in an ORDER BY.
Is ...
I am using ECPG with PostgreSQL 8.4. I have a function which takes a struct containing pointers to a couple of dynamically allocated, "null"-terminated arrays of integers (I have defined null in this case to be -1, as there is no need for negative values, as in
#define INT_ARR_NULL -1
struct foobar {
int * foo;
int * bar;
};
v...
Is it possible to output SQL query result in one string or variable? (i'm bad in php and mysql)
Let's say I have db "agents" with columns - agent_id, agent_fname, agent_lname, agent_dept.
Using this query:
$sql = SELECT a.`agent_fname` FROM agents a WHERE a.`agent_dept` = 'FCA'
I want to get a string or a variable, so I can use it in...
Although I have experience with SQL and generating HTML reports with PHP, I'm a relative beginner with Microsoft Access.
I'm currently using Microsoft Access 2007 to connect to MSSQL Server 2005.
I have a table of Reports that looks something like this:
ReportID
DateCreated
Author
...
I'd like to create a form that allows the user t...
A Microsoft Access implementation is throwing a type mismatch error while trying to execute a macro that opens up some queries. Most of the tables are linked to a SQL Server and I need to join two of the tables together that have different datatypes.
Table A:
REFERENCE TEXT
Table B:
REFNO NUMBER
I would ordinarily want to correct the...