Good morning,
I am attempting to execute a Stored Procedure within another stored procedure. The catch is that the stored procedure name is dynamically built within the first procedure. Here is an example of what I am trying to do ...
CREATE PROCEDURE SPINSVALUE_12345
@guid uniqueidentifier
AS
DECLARE @returnValue bit
DECLA...
I have a stored procedure that manipulates an integer table field (which represents a sequence number) based on some criteria - the criteria can reset the field back to zero. In a multiuser environment there is a possibility that the field may be referenced by 1 user before it is updated by another user so I would like to prevent this by...
Possible Duplicate:
What are the pros and cons to keeping SQL in Stored Procs versus Code
When should you use a stored procedure (such as in MySQL) instead of writing OO or procedural code (such as in PHP, Ruby or Python) that may execute simple SQL queries and does other processing but performs the same task?
...
Hi,
I've created a MySql function and would like to raise an error if the values passed for the parameters are invalid. What are my options for raising an error within a MySql function?
Thanks,
Don
...
Any pointers on how I can programmatically get exactly the identical stored procedure source from SQL Server 2005, as when I right-click on that stored procedure in SQL Server Management Studio and select modify?
I'm trying using SMO, but there are some textual differences. The procedure always has CREATE, not ALTER, and there are some...
Hi,
We have runned into a problem with an sp.
We have a pretty simple sp containing a declared table and a couple of outer joins that in the end returns between 20 and 100 rows.
Since querying this sp has been giving us poor performance both in production and in testenvironment we recently rewrote it to be more efficient and has teste...
Hi
I have been wondering how to put all the stored procedures on a SQL 2000 under source control.
We are using Subversion for all our normal source code, so it would be great if there were a solution to the problem using Subversion.
Do you have any ideas?
Update 16-02-2009: This is the vbs script i used to export all the stored proce...
There were a number of questions related to sharing data results of one stored procedure in another in MS SqlServer.
Depending of the version of SQL Server people would suggest using temporary tables, xml (SQLServer 2005) or table variables (SQL Server 2008).
There is a great article written by Erland Sommarskog that provides comprehe...
Hello everyone,
First I apologise if this has been asked. I did a quick search and didn't find anything related.
Here is my scenario. I tried to do this:
ALTER PROCEDURE [dbo].[my_sp]
@currentDate datetime = GETDATE()
All the SQL pre-compiler gives me back is this error:
Msg 102, Level 15, State 1, Procedure my_sp, Line 8
Incorrect ...
When I try to call a stored procedure from Rails, I get this exception:
ActiveRecord::StatementInvalid: Mysql::Error: PROCEDURE pipeline-ws_development.match_save_all can't return a result set in the given context: call match_save_all()
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/con...
I misremembered what the key was for this Templates table and therefore I added the wrong field as a foreign key. Now I need to add the foreign key and I want to populate its values based on this other field that is already populated. I started trying to do this with an update statement, but I'm not sure how to do it.
Part of my schema:...
Duplicate of: Is SQL The Assembly Language for Databases?
Please read and respond to that question
Based on this post from los techies, I would like to ask if you consider this to be true.
...
I would like to execute a stored procedure over each row in a set without using a cursor with something like this:
SELECT EXEC dbo.Sproc @Param1 = Table1.id
FROM Table1
I am using T-SQL in SQL Server 2005. I think this might be possible using a function, but I'd like to use a stored procedure if possible (company standards)
...
I'm in a situation where I need to make a call to a stored procedure from Rails. I can do it, but it either breaks the MySQL connection, or is a pseudo hack that requires weird changes to the stored procs. Plus the pseudo hack can't return large sets of data.
Right now my solution is to use system() and call the mysql command line dir...
all the procedure help I find is used for select purposes only.
can I write a table to truncate several tables?
similar to (but this does NOT work)
CREATE PROCEDURE clearall()
BEGIN
truncate tallgrrl.auth;
truncate tallgrrl.factory;
truncate tallgrrl.farm;
truncate tallgrrl.player;
truncate tallgrrl.timer;
END;...
I need help running a stored procedure from SQL Server in PHP. PHP is running on a Unix/Linux server. We cannot get OUTPUT variables to return in PHP. The following is the PHP code:
$conn = mssql_connect('server', 'user', 'pass');
mssql_select_db('db', $conn);
$procedure = mssql_init('usp_StoredProc', $conn);
$tmpVar1 =...
Ever wonder what wikipedia's database schema looks like? I recently read this thread from reddit.
I like how their tables are tagged with a prefix so you can sort of tell its functionality, purpose, and relationship with other tables right off the bat.
One thing I do not notice is how they name their stored procedures. Do they even u...
How can I ignore an output parameter of a stored procedure. I'm calling the sp from another sp.
e.g.:
DECLARE @param1 integer
EXEC mystoredprocedure @in_param_1, @in_param2_, @param1 OUTPUT, what do I type here to ignore the second output param
I'm using T-SQL (MS SQL 2005).
Thanks for your help.
...
Any idea if it's possible to create a procedure in another database using T-SQL alone, where the name of the database is not known up front and has to be read from a table? Kind of like this example:
Use [MasterDatabase]
Declare @FirstDatabase nvarchar(100)
Select Top 1 @FirstDatabase=[ChildDatabase] From [ChildDatabases]
Declare @SQL n...
How can you check to see if a user can execute a stored procedure in MS SQL server?
I can see if the user has explicit execute permissions by connecting to the master database and executing:
databasename..sp_helpprotect 'storedProcedureName', 'username'
however if the user is a member of a role that has execute permissions sp_helprot...