Hi again all,
I'm trying to pull some data from a SQL table in my dataset using C#.
In this case I do not need all the columns just a few specific ones, however as I am not pulling back a column with a mandatory NOT NULL, the copy of the table is throwing the exception
"Failed to enable constraints. One or more rows contain values...
Hello everyone!
I'm trying to create an SQL query that will order the results by a version number (e.g. 1.1, 4.5.10, etc.)
Here's what I tried:
$bQuery = "SELECT * FROM Requirements WHERE Requirements.Release NOT LIKE '%Obsolete%' ORDER BY Requirements.ReqNum";
Now, the ReqNum field is a string field and unfortunately I can't change ...
I'm calling SQL's sp_changeobjectowner from C#. I want to check afterwards if it worked. How do I check if a table's owner is who I want it to be?
...
Hi, I have two tables tbl1 and tbl2, both with two columns, one for id and one for product. I want to extract the rows that are in both, i.e. rows where tbl1.id = tbl2.id and tbl1.product = tbl2.product and join the row from tbl1 and tbl2 into one row.
I imagine this goes something like this:
SELECT tbl1.\*, tbl2.\*
FROM tbl1, tbl2
WH...
I have a Cube which draws its data from 4 fact/dim tables.
FactCaseEvents (EventID,CaseID,TimeID)
DimEvents (EventID, EventName)
DimCases (CaseID,StateID,ClientID)
DimTime (TimeID,FullDate)
Events would be: CaseReceived,CaseOpened,CaseClientContacted,CaseClosed
DimTime holds an entry for every hour.
I would like to write an ...
Which is your preference?
Let's say we have a generic Product table that has an ID, a name, and a foreign key reference to a category. Would you prefer to name your table like:
CREATE TABLE Products
(
ProductID int NOT NULL IDENTITY(1,1) PRIMARY KEY,
CategoryID int NOT NULL FOREIGN KEY REFERENCES Categories(CategoryID),
Pr...
So I am importing some images stored in SQL image columns, and I need to change them to Byte arrays since I store my images as varbinary(max) and recreate them. I would LOVE it if there was a program to do this, or a really easy way since I don't have a ton of time.
Any ideas out there?
...
I am trying to use java.util.Date as input and then creating a query with it - so I need java.sql.Date.
I was surprised to find that it couldn't do the conversion implicitly or explicitly - but I don't even know how I would do this, as the Java API is still fairly new to me. Any suggestions? It seems like this should be an easy feat...
I have a database with event information, including date (in MMDDYYYY format). is it possible to write an SQL Server statement to only get rows that fall within a certain time frame?
something like this pseudo-statement:
SELECT * FROM events WHERE [current_date minus date <= 31] ORDER BY date ASC
where date is the date in the SQL Ser...
I'd like to be able to better access the database so I can execute queries (primarily because I don't understand/know the API for it, but I do know SQL). I don't want to remove everything Visual Studio has done because a lot is already built upon it, but how can I get an object that I can use to execute SQL queries.
This is Visual Studi...
I have a mysql database with a table of ebay users, and their individual auctions. What I wish to do is to be able to "monitor" certain users, which would basically include retriving all of the auctions of any monitored users. I would like to know the best way to do this.
I am thinking of having another table, with just one column cont...
I would like to provide a WHERE condition on an inner query by specifying innertable.id = outertable.id. However, MySQL (5.0.45) reports "Unknown column 'outertable.id' in 'where clause'". Is this type of query possible?
The inner query is pivoting rows to columns using a GROUP BY. This could be entirely be performed in the outer query,...
I need to display a list of records from a database table ordered by some numeric column. The table looks like this:
CREATE TABLE items (
position int NOT NULL,
name varchar(100) NOT NULL,
);
INSERT INTO items (position, name) VALUE
(1, 'first'),
(5, 'second'),
(8, 'third'),
(9, 'fourth'),
(15, 'fifth'),
(20, 'sixth');
Now, the o...
Is it possible to get a query string from a PDO object with bound parameters without executing it first? I have code similar to the following (where $dbc is the PDO object):
$query = 'SELECT * FROM users WHERE username = ?';
$result = $dbc->prepare($query);
$username = 'bob';
$result->bindParam(1, $username);
echo $result->queryString;
...
Hi,
I need to transfer data from one table to another. The second table got a primary key constraint (and the first one have no constraint). They have the same structure. What I want is to select all rows from table A and insert it in table B without the duplicate row (if a row is0 duplicate, I only want to take the first one I found)
...
Hello all!
I am trying to use jSecurity for an enterprise java app, but the documentation is...well...lacking.
Has anyone out there in SO-land been able to get the JDBCRealm setup, and if so did you find a SQL setup script or did you just derive it on your own? Either way, can you provide the create SQL statements to make this work?
...
I am trying to port this line from MS SQL Server to SQLite
IF NOT EXISTS(SELECT 1 FROM EVENTTYPE WHERE EventTypeName = 'ANI Received')
INSERT INTO EVENTTYPE (EventTypeName) VALUES ('ANI Received');
It seems that SQLite does not support IF NOT EXISTS or at least I can't make it work.
Am I missing something simple? Is there a work...
I've built a very simple chatroom-like ASP.NET application which displays current Online/Offline users:
I have a Table with a DateTime column used as a TimeStamp. Every time a user causes a Postback or similar Get event, I update the TimeStamp. I want to, on the server, create a periodic process of some sort that I can use to check how ...
This one is nasty complicated to solve.
I have a table containing date ranges, each date range has a priority. Highest priority means this date range is the most important.
Or in SQL
create table #ranges (Start int, Finish int, Priority int)
insert #ranges values (1 , 10, 0)
insert #ranges values (2 , 5 , 1)
insert #ranges value...
My database background is mainly Oracle, but I've recently been helping with some SQL Server work. My group has inherited some SQL server DTS packages that do daily loads and updates of large amounts of data. Currently it is running in SQL Server 2000, but will soon be upgraded to SQL Server 2005 or 2008. The mass updates are running ...