I have a stored procedure which is doing a lot of delete. Hundreds of thousands of records. It is not going to be runnable from the application, but still, i am concerned, that one of my clients accidentally runs it (i had problems earlier due to their "curiosity") :D
Yes. there are backups and stuff like that, but I was thinking .... n...
I am in need of a lightweight way to store dictionaries of data into a database. What I need is something that:
Creates a database table from a simple type description (int, float, datetime etc)
Takes a dictionary object and inserts it into the database (including handling datetime objects!)
If possible: Can handle basic references, s...
I have a simple SQL query (using SqlCommand, SqlTransaction) in .NET 2.0 that returns a table of integer-string pairs (ID, Name). I want to get this data into a dictionary like Dictionary<int, string>.
I can get the result into a DataTable, but even iterating over it, I'm not sure how to do the typing and all that stuff. I feel like t...
I saw nHibernate video during the weekend. In the tutorial, the programmer was using MBunit to test his code. One neat thing i liked about nhibernate was, if you tell nhibernate to 'showSql', it displays sql in Mbunit dialog box after the unit test. I was wondering if there is something similar for ibatis using nUnit?
...
I have two tables in my database schema that represent an entity having a many-to-many relationship with itself.
Role
---------------------
+RoleID
+Name
RoleHasChildRole
---------------------
+ParentRoleID
+ChildRoleID
Essentially, I need to to be able to write a query such that:
Given a set of roles, return the unique set o...
Hi!
i have 2 tables:
account: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE
flex: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE
I want to show differences comparing only by: AE_CCY, DRCR_IND, AMOUNT, MODULE and ACC by first 4 characters
Example:
ID ACC AE_CCY DRCR_IND AMOUNT MODULE
-- --------- ------ -------- ------ ------
1 734647...
Hi All,
I'm working on a development with over 700 tables. I need to see a listing of all related tables to a given table. Can you reccommed a app that is able to provide such a thing.
Many thanks
Gillian
...
I have a MS SQL view that I want to make available as a CSV download in my ASPNET Web Forms app. I am using Entity Framework for other views and tables in the project. What's the best way to enable this download?
I could add a LinkButton whose click handler iterates over the view, writes its CSV form to the disk, and then serves that fi...
Sql server 2005 (even 2008) strips the insignificant whitespaces by default. To keep one can use the CONVERT funtction with the last argument as '1' (Ref. Article). How can we do the same thing in Entity Framework?
thanks
...
a) SqlCommand.ExecuteNonQuery is used for update, insert and delete operations.
Besides the fact that by using ExecuteNonQuery instead of ExecuteReader we automatically know there won’t be any query results returned, are there some other benefits/reasons why ExecuteNonQuery should be used?
b) Similarly, if we want a database operation...
I'm building a database class and thought it'd be a good idea to incorporate some form of SQL injection prevention (duh!). Here's the method that runs a database query:
class DB
{
var $db_host = 'localhost';
var $db_user = 'root';
var $db_passwd = '';
var $db_name = 'whatever';
function query($sql)
{
...
In Microsoft SQL 2008 Enterprise manager, when you right click a table to open it the option only grabs the first 1000 rows. Same thing with an edit except it limits the result to 200 rows. Is there a way to increase this in the context menu? I know I change the SQL once it loads, but I'd like to set the default value myself so I don't h...
Problem
There are data gaps that need to be filled. Would like to avoid UNION or PARTITION BY if possible.
Query Statement
The select statement reads as follows:
SELECT
count( r.incident_id ) AS incident_tally,
r.severity_cd,
r.incident_typ_cd
FROM
report_vw r
GROUP BY
r.severity_cd, r.incident_typ_cd
ORDER BY
r.severity_...
I am trying to query a table in PostgreSQL 8.4.2 server for to get open-high-low-close data. The table and my first query are below.
Question:
Is there a way to get the same results without using subqueries as in the example query below? Perhaps using FIRST_VALUE() or LAST_VALUE() window methods?
-- FIRST ATTEMPT AT OHLC
SELECT
con...
I'm trying to do pagination with a very old version of DB2 and the only way I could figure out selecting a range of rows was to use the OVER command.
This query provide's the correct results (the results that I want to paginate over).
select MIN(REFID) as REFID, REFGROUPID from ARMS_REFERRAL where REFERRAL_ID<>'Draft' and REFERRAL_ID n...
Take a simple table like below:
Column Headings: || Agent's Name || Time Logged In || Center ||
Row 1: Andrew || 12:30 PM || Home Base
Row 2: Jeff || 7:00 AM || Virtual Base
Row 3: Ryan || 6:30 PM || Test Base
Now lets say that a single cell is deleted so the table now looks like this:
Column Headings: || Agent's Name || Time ...
Hello all,
I am creating a social bookmarking app. I am having a re-thought of the DB design in the middle of development.
Should I normalise the bookmarks table and remove the tag columns that I have into a separate table. I have 10 tags per bookmark and therefore 10 columns per record (per bookmark).
It seems to me that breaking the...
How is it possible to execute a direct SQL command to an ADO.NET connected database?
I want to send a DBCC SHRINKDATABASE to the SQL server, to compress the current datafile after a big deletion process. The function ObjectContext::CreateQuery returns a parser error after the DBCC command. Is there any other way to shrink the database f...
this is my invoice table:
Invoice Table:
invoice_id
creation_date
due_date
payment_date
status enum('not paid','paid','expired')
user_id
total_price
I wonder if it's Useful to have a payment table in order to record user payments for invoices.
payment table can be like this:
payment_id
payment_date
invoice_id
...
Hello,
I have an audit record table that I am writing to. I am connecting to MyDb, which has a stored procedure called 'CreateAudit', which is a passthrough stored procedure to another database on the same machine called MyOther DB with a stored procedure called 'CreatedAudit' as well.
In other words in MyDB I have CreateAudit, which d...