stored-procedures

How do i call a shell app from SQL storedprocedure?

Im trying to call a notepad or calculator from a stored procedure. can anyone help? ...

Comparing stored procedure performance ex and new version

I did create two new indexes on the tables that are used on a the sp. The new results shows that on the part of problematic joins, the scans are converted to seek. I think seek is better rather than scan operations. On the other hand, the time takes more or less the same duration as it was without new indexes. So clearly, how can i get...

Validating stored procedure arguments to enforce referential integrity constraints

Hi all, Of late, I have a tendency to validate my stored procedure action query arguments before actually performing the query. An example would be to check that, on update to table 'T' that has a column 'C' which has a unique index, that the Update would not fail... by first performing a "Select Exists on the unique index" type of qu...

Catch/Work with/Handle multiple datasets in a Stored Procedure from another Stored Procedure

Is it possible to work with the returned datasets from a stored procedure? Basically I have a stored procedure (lets call it SP_1) and it calls another stored procedure (lets call it SP_2). SP_2 has 5 or so select statements. What I want to do is handle each select statement within SP_1. Basically to manipulate the data or whatever, but ...

Stored procedure causes "Commands out of sync" on the next query.

I am running a query with a mysql stored procedure : $AddProf_qr = mysql_query("call AddStudent('$d_Pass', '$d_Titl', '$d_Firs', '$d_Midd', '$d_Last', '$d_Addr', '$d_City', '$d_Stat', '$d_County', '$d_Zipc', $d_Gend, '$d_Birh', '$d_Phom', '$d_Phoh', '$d_Phoo', '$d_Email', '$d_Webs', '$d_Natn', '$d_Profsn', '$d_Compny', '$d_Desig', $d...

How many OUTPUT parameters can we declare for a stored procedure in SQL Server ?

How many OUTPUT parameters can we declare for a stored procedure in SQL Server ? ...

Sql server stored procedure

I have to write a update stored procedure. I will be asking paramters for all the columns ( Except id). User won’t be sending all the paramaters all the times. He wants to send paramter value NULL so don’t update that column, the columns he wants to update there will be valid value. How do I Write a stored proc for this. Basically I will...

What a StoredProcedure

Hi. This is a stored procedure (at least I have to be assuming so), that constructs an Sql query as a String and then calls it with exec. For some reason the dude that called himself a programmer, concatenates some values using "~" characters and them splits them back in the application layer. This SP breaks when, some checkbox is "selec...

Can I get a POCO from EF4's function import?

In the context of Entity Framework 4, the default behavior when adding a function import is to call it via ExecuteFunction<T>(), where T must apparently implement some property change notification stuff. (In my case it's generating a complex type derived from ComplexObject.) I don't need or want any change notifications, and I'm requir...

How to install or attach Sql Server Database using command line ?

I need to deploy a Sql Server Express 2008 database in unattended installation using command line or AutoIt, and I need to : 1.- Set sa password. 2.- Disable built-in\Administrators account to deny login. 3.- Attach a database with all users accounts enabled. Thx ...

how to find which task is atpresent going on based on the today date

I have a set of projectnames stored in the database projectname - project1 with startdate and enddate How to find which task is at present going on, based on today's date ( note : two projects may have same dates too). I need to take the project names which falls under today date from all the other projects. select distinct ProjectNa...

Oracle: how to avoid "java session state cleared" error when loading a java class?

Whenever I load a java class, I will get this error on my open sessions when I call a member of the class. Is it possible to avoid this? ORA-29549: class MH.Tbs has changed, Java session state cleared ORA-06512: at "MH.TBS", line 2 ORA-06512: at line 4 29549. 00000 - "class %s.%s has changed, Java session state cleared" *Cause: A c...

SQL Server custom SplitString function with several splits.

Hey peeps. Thanks in advance! I have a Function in SQL server 2008 which splits a string based on the char i give. Lovely and simple. When I pass in: Content1,Content2,Content3 I can create a lovely temp table with those values in a single column split by the comma (,). Now, that's all good, but I now need to split the following in...

how to add line breaks in a query (informix)?

I need to do a query that updates text with line break, I tried using \n but it inserts "\n" literally. Example: update table set text = "first line\nsecond line" I want it to show that text as: "first line second line" and not as "first line\nsecond line". When I do this with .net it works, but not on a stored procedure Does an...

sql server stored proc times out and query does not time out, why ?

I have a stored proc on sql server 2008 that excepts a int parameter. It does call other stored procs and have nested quires. the problem i am facing is when i run the procedure from SQL server management studio it does not execute and times out. If i run the queries in side the stored proc separately in another SQL server management s...

Keeping ORM with stored procedures

Hello, I am developing a Python web app using sqlalchemy to communicate with mysql database. So far I have mostly been using sqlalchemy's ORM layer to speak with the database. The greatest benefit to me of ORM has been the speed of development, not having to write all these sql queries and then map them to models. Recently, however, I'...

Modify SQL result set before returning from stored procedure

I have a simple table in my SQL Server 2008 DB: Tasks_Table -id -task_complete -task_active -column_1 -.. -column_N The table stores instructions for uncompleted tasks that have to be executed by a service. I want to be able to scale my system in future. Until now only 1 service on 1 computer read from the table. I have a stored proc...

How to store output of a stored procedure on to disk

Hi, We are using SQL Server 2005. I want to create the file of the output of the stored procedure. ...

MySQL triggers cannot update rows in same table the trigger is assigned to. Suggested workaround?

MySQL doesn't currently support updating rows in the same table the trigger is assigned to since the call could become recursive. Does anyone have suggestions on a good workaround/alternative? Right now my plan is to call a stored procedure that performs the logic I really wanted in a trigger, but I'd love to hear how others have gotten ...

sql stored procedure clear resultsets

Can I clear the multiple result sets that a stored procedure has already gathered so that the next result set that is created becomes the very first result set returned by the procedure? ...