sql

How to process SqlCommand result (rows) as they come?

How to process SqlCommand result (rows) as they come? In other words, I am trying to do exactly what Sql Management Studio 2005 does when executing a query with many thousand rows. To me, it looks like as soon as Sql has found the first result, it notify the UI and display the rows as they come... I suppose that it can be done asynchron...

What is Visual Studio GDR R2, and do I still need the Power Tools?

I am working on quite a large DB based project and I like the look of a few of the power tools. Looking through the related downloads, I found out about GDR R2, I cannot find out that much information about it - Not even sure what GDR stands for, but one thing that caught my eye - "this release incorporates many previously released Pow...

Report Generation Tabbing error

I have a procedure using a util file and cursor where i have to generate a report for the table cl_masd_payments in the format given in the code I have written the procedure but its still giving errors...don know what is the problem Any help will be highly appreciated. Anand The procedure i have written is such: CREATE OR REPLACE P...

Sql Get all children of a parent

Lets say I have an Areas Table ( id, parentId, name, path ). Given an Id, I'd like to get all childrens (children of children included, recursively) of the given area. I do store in the path the path from the parents to the child. Example: 1 NULL New York /1/ 2 1 BRONX /1/2/ 3 1 MANH /1/3/ 4 3 UpWest /1/3/4/ 5 3 ...

FILESTREAM files being left behind after row deleted

I have successfully set up FILESTREAM on my SQL 2008 server; however I've noticed that even when I have deleted rows containing FILESTREAM data, the physical data file doesn't seem to get deleted. By the physical file, I mean the file in SQLServer's managed directory with a uniqueidentifer as the filename not the original file added to ...

Splitting out one table to a separate server

Hi all, Background, I am running MS SQL Server 2005. What do you guys think about this. I have an analytics process whereby a stored procedure is fired off on every page of my website and the results logged into my analytics table. Given that I have thousands of users on my site daily, this a very frequent albeit "light" overhead to ...

SQL Server - OPENQUERY

I am using an Openquey which has been working fine on SQL Server 2005, I have 1 server that is SQL Server 2008 which this does not work on. If I run the following: SELECT * FROM OPENQUERY([Manchester], '[Manchester].[PilotWebApp].[DBO].rsp_HandheldPerformance ''10/01/2009'', ''10/10/2009''') I get this error: Cannot ...

mysql order varchar field as integer

I have a varchar field in my table and I want to sort it. But I need to handle this field as integer. Meaning if sort as text the order is "19,2,20" but I want to get the right order "2,19,20". Can anyone help me? ...

Handling .NET object-relational impedence mismatch in a special case

I would like to abstract out pure SQL calls in my code as much as possible. I'd like to research nHibernate or LINQ-to-SQL, but I'm wondering how the scenario I'm dealing with affects my decisions. The database I'm reading from is a legacy database, and I can't change its schema or anything - I'm stuck with what's there. The bigger prob...

Zend DB Table Where Clause

I'm trying to use an array to set the where parameters for a Zend DB Table. I am trying to follow an example in the documentation: $select = $table->select()->where(array('bug_status = ?' => 'NEW')); I have a class that inherits Zend_Db_Table and am trying to select like the example: $select = $this->select()->where(array('FirstName...

Slow (to none) performance on SQL 2005 after attaching SQL 2000 database

Issue: Using the detach/attach SQL database from a SQL 2000 SP4 instance to a much beefier SQL 2005 SP2 server. Run reindex, reorganize and update statistics a couple of times, but without any success. Queries on SQL 2000 took about 1-2 sec. to complete, now the same queries take 2-3 min on the SQL 2005 (and even 2008 - tested it there...

ORA-04098: Simple trigger is invalid. Why?

There is something wrong with this trigger. But what? CREATE TRIGGER MYCOOLTRIGGER AFTER INSERT ON MYCOOLTABLE REFERENCING NEW AS newRow FOR EACH ROW DECLARE BEGIN END MYCOOLTRIGGER; SQL Developer output: Warning: execution completed with warning TRIGGER MYCOOLTRIGGER Compiled. Is there any way to get more info on this Warning? ...

Bewildered student vs. ORA-00257 Error--can I fix this? How?

Of course my boss is out the day something goes wrong. It's just me, an inexperienced little student here, trying to get our website back up and running. All alone. The oracle database our site pulls data from won't let me connect (throwing the error on our site), giving me the error: ORA-00257. In full: ORA-00257: archiver error. Con...

Prevent error when dropping not existing sequences, creating existing users.

Hi, I have a bunch of sql scripts that create / drop sequences, users and other objects. I'm running these scripts through liquibase, but they fail because oracle complains when I try to drop a non existing sequence, or create an existing user. Is there an oracle way to prevent errors from happening? Something of the sort Create ...

Oracle Parameters with IN statement?

Hi Guys, Got a c#.net app which I need to modify. The query at the moment effectively does this: select * from contract where contractnum = :ContractNum (very simplified, just to show we're using an = and one parameter) That parameter is read in from the Settings.Settings file on the C# app and has one string in it. I need to modif...

mySql unknown column

I have the following query SELECT s.name, s.surname, s.id_nr, s.student_nr, s.createdate, s.enddate, (SELECT count(*) FROM Student_Attendance WHERE absent = 1) AS count_absent FROM Student AS s, Student_Contact AS sc, Student_Payment AS p, Student_Courses AS scou...

JPA custom script at startup

What is the best way to fill tables create with jpa at application startup/shutdown of application ? like but with data manipulation language instead data definition language. i'm using HibernatePersistence as persistence provider. ...

How to Insert the proper DataType into Excel 97-2003 format

I'm unable to find the correct DataType for inserting into EXCEL 97-2003 format. I'm able to insert but when veiwing the Excel 97-2003 document every column is coming up with Number saved as text. Even when inserting Double from C# Excel still recognizing it as numbers saved as text and asks the viewer to convert to number. Any help w...

How do I script my table to generate INSERT INTO commands?

I have a lookup table with about 10 records, I know I can script the structure to a text file, but how can I script the data to insert into commands? ...

Oracle Trace File Browsers?

Can anyone recommend a graphical tool to make browsing Oracle SQL Trace files easier? TKProf is great for summary info, but lately I am needing more detail on a specific run of a statement and end up going back to the trace file directly. Summarization and filtering would be pluses, but mainly looking for something with some basic dril...