sql

SSRS 2008 - How to hide the plus icon in a group visibility toggle cell

I have a report that shows or hides columns in a group based on a header cell. SSRS makes this pretty easy and is kind enough to place a little plus/minus icon in the toggling cell. I want to HIDE this plus/minus icon when there is only one column of data in the subgroup, because it shows that one column by default so expanding the gro...

How to join nearly identical several queries into one?

Hi, Assume I have an order_dummy table where order_dummy_id, order_id, user_id, book_id, author_id are stored. You may complain the logic of my table but I somehow need to do it that way. I want to execute following queries. SELECT * FROM order_dummy WHERE order_id = 1 AND user_id = 1 AND book_id = 1 ORDER BY `order_dummy_id` DESC LIMI...

How to set up an insert to a grails created file with next sequence number?

I'm using a JMS queue to read from and insert data into a postgres table created by grails. The problem is obtaining the next sequence value. I thought I had found the solution with the following statement (by putting "DEFAULT" where the ID should go), but it's no longer working. I must have changed something, because I needed to recreat...

How do I code this relationship in SQLAlchemy?

I am new to SQLAlchemy (and SQL, for that matter). I can't figure out how to code the idea I have in my head. I am creating a database of performance-test results. A test run consists of a test type and a number (this is class TestRun below) A test suite consists the version string of the software being tested, and one or more TestRu...

how do i update database using ADODB.Recordset?

i am using excel to connect to a mysql database: Dim dpath, atime, rtime, lcalib, aname, rname, bstate, instrument As String Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset ConnectDB With wsBooks rs.Open "batchinfo", oConn, adOpenKeyset, adLockOptimistic, adCmdTable Worksheets.Item("Report 1").Select ...

sql - ModifyDate column - Is using a Computed Column a correct way to implement this?

I just want to have a "ModifyDate" column automatically populated for me when a record is either inserted or updated. Should I be using triggers or is it OK to use a Computed Column? (Using SSMS2005 and SQL Server 2005 Express) ...

difference between cn.execute and rs.update?

i am connecting to mysql from excel using odbc. the following illustrates how i am updating the rs With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields("analysistime") = atime .Fields("reporttime") = rtime .Fields("lastcalib") = lcalib .Fields("ana...

hierarchical data from self referencing table in tree form

It looks like this has been asked and answered in all the simple cases, excluding the one that I'm having trouble with. I've tried using a recursive CTE to generate this; however maybe a cursor would be better? Or maybe a set of recursive functions will do the trick? Can this be done in a cte? consider the following table PrimaryKey ...

why is ADODB inserting NULL values on update?

i have: With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields("analysistime") = "atime" .Fields("reporttime") = "rtime" .Fields("lastcalib") = "lcalib" .Fields("analystname") = "aname" .Fields("reportname") = "rname" .Fields("batchstate") = ...

sql - Update Trigger to populate a ModifyDate field

I'm looking for an example of a good update trigger to update the ModifyDate field of a table. It would be nice to handle the case where an update command updated more than one record in the table. Is there a good template or tutorial for this? Thanks ...

SqlBulkCopy causes Deadlock on SQL Server 2000.

I have a customized data import executable in .NET 3.5 which the SqlBulkCopy to basically do faster inserts on large amounts of data. The app basically takes an input file, massages the data and bulk uploads it into a SQL Server 2000. It was written by a consultant who was building it with a SQL 2008 database environment. Would that env ...

Oracle SQL: Multiple Subqueries Unioned Without Running Original Query Multiple Times.

So I've got a very large database, and need to work on a subset ~1% of the data to dump into an excel spreadsheet to make a graph. Ideally, I could select out the subset of data and then run multiple select queries on that, which are then UNION'ed together. Is this even possible? I can't seem to find anyone else trying to do this and ...

SQL algorithm question to convert a table

i have a table like this: number stuff1 stuff2 stuff3 ------------------------------- 1 x y 2 a 3 b 4 c d e i want to use a sql statement to turn it into this: number stuff1 stuff2 stuff3 ------------------------------- 1 x 1 y 2 a 3 b 4 c ...

what does this ADO OPEN Method do?

in plain english can you explain to me what happens here: rs.Open "batchinfo", oConn, adOpenKeyset, adLockOptimistic, adCmdTable what i need to do is to be able to insert values into a table called batchinfo. would this be the best way to do an OPEN? the only thing i would be doing is inserting values. ...

sql query for 3 tables

i have 3 tables (A,B,C) Table A - ID Name 1 Sam 2 Manuel 3 Jane Table B ID Tab_A_ID Name 1 1 Meer 2 1 Kutti 3 2 Mikaro Table C ID Tab_B_ID Price 1 1 255.11 2 1 30.52 3 3 125.22 I need a query that shall pick up the top price for TableA-Name from TableC. So only 1 top price for 1...

SQL - .NET - SqlParameters - AddWithValue - Are there any negative performance implications when Param Type is not specified?

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx I'm used to adding sql parameters to a sqlCommand using the add() function. This allows me to specify the type of the sqlParameter, but it requires another line to set the value. It's nice to use the AddWithValue function, but it ski...

free sql code editor?

i am breaking my eyes trying to write sql code in ms access. is there a free editor out there? ...

ms-access: missing operator in query expression

i have this sql statement in access: SELECT * FROM (SELECT [Occurrence Number], [1 0 Preanalytical (Before Testing)], NULL, NULL,NULL FROM [Lab Occurrence Form] WHERE NOT ([1 0 Preanalytical (Before Testing)] IS NULL) UNION SELECT [Occurrence Number], NULL, [2 0 Analytical (Testing Phase)], NULL,NULL FROM [Lab Occurrence Form] W...

ADODB: difference between ADDNEW and UPDATE methods?

i am updating a table in mysql using ADODB i am adding new entries into a table should i be using addnew or update? ...

How can I load a sql "dump" file into sql alchemy

I have a large sql dump file ... with multiple CREATE TABLE and INSERT INTO statements. Is there any way to load these all into a SQLAlchemy sqlite database at once. I plan to use the introspected ORM from sqlsoup after I've created the tables. However, when I use the engine.execute() method it complains: sqlite3.Warning: You can only...