Initiate a stored procedure on MsSQL from UNIX/sh

I have an interesting issue, I need to pass 3-6 parameters to a stored procedure in a MsSQL database from a sh script on a Sun server and I need the output from this stored procedure in a file on the Sun server.There are numerous ways to do this, I'm sure, does anyone recognize the terrain ?Extra po ...

convert stored procedure from Mssql to Mysql

there. can someone assist me to convert the following stored proc into Mysql stored proc /****** Object: Stored Procedure spBanner_d Script Date: 18/06/2008 3:31:18 PM ******/ CREATE PROCEDURE spBanner_d ( @BannerID int, @title nvarchar(256), @userID nvarchar(20) ) AS /* if exists(SELECT * FROM tblB ...

Microsoft SQL Server Conversion of STored Procedure from MSSQL to MYSQL

Is there any tool which assists in conversion of stored procedures from Microsoft SQL server to MYSQL ...

MSSQL Server 2005- Problem creating stored procedure.

I'm trying to create a stored procedure in MSSQL Server 2005 that'll perform the following jobs:1) Create a login.2) Create an user in TestDB database for the login created in step 1.3) Assign the role 'db_generaluser' to the user created in step 2.The login name and password for the login to be cre ...

Calling MSSQL SERVER STORED PROCEDURE FROM ORACLE STORED PROCEDURE

I want to call a stored procedure from mssql server 2005 as part of a stored procedure in PL/SQL. How do I go about this? I've already set up the linked servers. ...

Oracle help in stored procedure

i have a stored procedure in MSSQL which needs to be migrated to oracle 10g,i have got problem related to migration.My mssql stored procedure is like as follows:create procedure sample(var1 varchar(20),var2 varchar(20) )asdeclare @V_TBL table(col1 varchar(20), col2 varchar(20))begininsert into @V_TB ...

MSSQL 7 Stored Procedure Translation

What will be the equivalent stored procedure in DB2 for the following MSSQL7 SP.The migration tool does not translate it properly.CREATE PROCEDURE selectTasks@USER_ID int,@ROWLIMIT int = 10ASset rowcount @ROWLIMITSELECT TASK_IDFROM TASKSWHERE TASKS.USER_ID = @USER_IDORDER BY TIME Thank you in advanc ...

mssql stored procedure call trought adodb, some problems

i have some troubles working with php+mssql ....my problem is : 1) call select statement2) call stored procedure statement1 and 2 i call one by one......for example when i am using this method...... (method_1)===========================================$result_set1 = $mssqlconnection->EXECUTE( ...

mssql stored procedure execution failed (???)

Hi, I'm a complete novice at PHP and SQL. I'm trying to get data put into a form to be entered into a mssql database table. I didn't write this code from scratch (someone sent it to me and I've changed the fields/variables, etc.), and I really can't troubleshoot beyond the absolute, bare basics. Any ...

PHP, MSSQL + Stored Procedure = help!

I have Mac-mini running a small corporate intranet site, I have installed PHP 5 with FreeTDS so that I can access MSSQL databases that run on other company servers. My problem is that I want I have a search form that queries a database fine, but I have a stored procedure that modifies the input on o ...

Help MsSQL stored procedure

please help for MsSQL stored procedure for ASP.net/C#. Inside stored procedure i used 4 different statements in where clause . first one is working but last 3's are not . Statements are given below-FILENAME LIKE ''%'+ @FILENAMETEXT +'%'' FILENAME LIKE '+ @FILENAMETEXT +'%'' SUBSTRING(FILENAME,1,4)=' ...

Error retreiving text field from MSSQL stored procedure using CRecordset

I am having problems returning a SQL Server text field from a SELECT statement in a stored procedure. In my CRecordset derived class I use the RFX_LongBinary call to retrieve the text data. However, when I open the recordset an error "Result not returned from a SELECT statement". I'm not s ...

Can MSSQL Stored Procedure Return A String ?

Does anyone know if MSSQL stored procedure can return a string? As far as I know a stored procedure can only return an integer that tells whether the stored procedure fails or not. What I want to do is to use two stored procedures - one calls the other procedure, that returns a string to the calling ...

How to call MSSQL stored procedure from oracle database

MSSQL and Oracle databases are linked thru ODBC link using Oracle HSODBC.I can query MSSQL table or view from Oracle Database using standard notation for acessing remote objects schema.object@dblink_name...Can anybody give me syntax for calling MSSQL stored procedure thru ODBC database link?I tried ...

PHP MSSQL Stored Procedure problem

I'm having a problem with that code. Im getting this error: Warning: mssql_execute() [function.mssql-execute]: message: Error de conversi�n al convertir una cadena de caracteres a datetime. (severity 16) (Translate: error converting string to datetime)Warning: mssql_execute() [function.mssql-execu ...

Failed to execute stored procedure - MSSQL

Alright. Right now, I'm working on a Register script. The POST data, and stuff like that works fine, it's only the Stored Procedure that's bothering me. Everytime I "attempt to register", it comes up with the error: Warning: mssql_execute() [function.mssql-execute]: stored procedure execut ...

How to get recordset in ASP from MSSQL stored procedure

I have stored procedure with couple input parameters (MS SQL) which creates temporary table and returns recordset as the result from that tamporary table. Stored procedure works ok on its own.I need to get that recordset in ASP but it doesn't work !?!Set cmd = Server.CreateObject("ADODB.Command ...

ADO/MSSQL Stored Procedure oddity

I'm running a stored procedure that is supposed to make an insert and return an output param with ADO from C++. The update is performed, but the output parameter comes out VT_NULL every time. (I've also tried return value and a select after the update, both returned a null) After days of trying to f ...

MSSQL, executing Stored Procedure not returning correct characters using JSON

I'm using PHP to access SQL Server Stored Procedure. However, the characters are not returning correctly using JSON.Database value--------------_ResourceGuid '341EEB0B-9D71-4805-8380-000C53BAE950'ResourceGuid '341EEB0B-9D71-4805-8380-000C53BAE950'status 'Active'PHP Returned JSON array--------------- ...

Utterly Baffled : mssql stored procedure

i'm utterly baffled as to how to get a stored procedure to function under php4 on a windows2000/apache box.i'm connecting to the db succesfully, however any attempts to execute a stroed procedure fail. any ideas.i have tried several approaches:$conn=mssql_connect("server","un", ...

PHP MSSQL Stored Procedure with Parameters (In and Out)

Any could give me a PHP script on how to call or execute a MS SQL Server stored procedure, passing parameters to it and receiving a value from it using an Output parameter? ...

Convert MSSQL stored procedure to Oracle (TABLE data type)

I have an MS SQL Server stored procedure that I need to convert to Oracle. Most of it is ok but it uses a TABLE data type, what would the equivalent be in Oracle?Here is an example of the stored procedure:CREATE PROCEDURE AWSP_REMOVECOMPLETEDJOBS @DateFrom datetime,@DateTo datetimeAS --First grab th ...

Please help convert MSSQL Stored Procedure to Oracle PL/SQL

this be my first post to these forums. I have already posted this question on a microsoft msdn forum, until someone advised that I ask my question here - dunno why I didnt think of that! Im working with an Oracle 10g Database from an ASP.NET 2.0 application, and want to know if it Oracle supports OP ...

Textbox doesn't display full result from mssql stored procedure

Hey, i run a stored procedure from php that returns results into variables but when i write these variables to textboxes it only writes the first word and nothing after a space, how can i get it to show the whole string sent back by the stored procedure?//binds the variablemssql_bind($sp,"@user ...

Create Table in Stored Procedure

I'm new to DB2. I need to create a physical table in my stored procedure. I cant use the session.temp table. how can i do it in my stored procedure. And also how can I create the physical table into a different database? For example i have 2 database. database1 and database2. my Stored proc is in da ...

Parameters passed to Stored Procedure from ASP

I'm relatively new to stored procedure writing. My situation is an ASP page allowing multiple selections from a <select> option passing 1 to x number of options to a stored proc. for the WHERE clause.For instance, a user selects 1,3,5 and 6. These would need to be passed to the sp and then:... ...

how do you create a database within a stored procedure

I am trying to create a database within a stored procedure, so that the database name is generated each time. Please review the attached code, as sql seems to error out on '@dname'select @iStatus = 0select @dbname = 'offline' + '_' + convert(char(6),getdate(),112)create database @dbnameon( name = @d ...

How to open a text file in a stored Procedure

Hai..I have data in text files ( not in csv format but in a properitary format).My requirment is to read the text files and parse it into corresponding data and then store it into the MSSQL Server Database.Is there any way to do this by using Stored Procedure or extended stored prodcedure in SQL Ser ...

Exporting data from SQL Server to Excel from a Stored Procedure

I need to export data, from within a MSSql stored procedure to excel. Right now we use DTS, but its cumbersome and the users always screw it up.I would usually just send the tabel to a .csv fiel and pick it up in excel, but I have a field that has preceding zeros and excel truncates them and uses a ...

Stored Procedure Query Optimization - Query TimeOut error

How to optimize the following Stored procedure running on MSSQL server 2000 sp4 :CREATE PROCEDURE proc1@Franchise ObjectId, @dtmStart DATETIME, @dtmEnd DATETIMEASBEGINSET NOCOUNT ONSELECT p.Product, c.Currency, c.Minor, a.ACDef, e.Event, t.Dec, count(1) "Count", sum(Amount) "Total ...

Passing in variable number of parameters to a stored procedure

I am fairly new to MSSQL. Looking for a answer to a simple question. I have a application which passes in lot of stuff from the UI into a stored procedure that has to be inserted into a MSSQL 2005 database. All the information that is passed will be spilt into 4 inserts hitting 4 seperate tables. Al ...

MySQL Stored Procedure result in sqlDeveloper

I'm a newbie in MySQL. My system supports Oracle, JavaDB & MSSQL so I use sqlDeveloper for SQL statements. I wrote a simple stored procedure which receives an INTEGER and returns a result set. When running it from MySQL Query Browser the result set is returned just fine, but when running it from ...

bcp_bind to stored procedure params?

I am using MSSQL 2005(SP 3). Is it possible to bind the parameters of a stored procedure using "bcp_bind" API? I just want to bind the in-memory buffers to the stored procedure parameters (STP will simply insert the data i.e params into the table). So that, when I call "bcp_sendrow ...

Import data from a foreign database using a stored procedure and a ODBC connection

I got a database in MS SQL 2000 that needs to be converted temporarily to MSSQL 2008 (year 2011) that will then be converted to PostgreSQL in the beginning of 2012. There is a DTS package in MSSQL 2000 that pumps data from a third party helpdesk request software (BMC Remedy) to a temp table in MSSQL ...

Stored Procedure - Multiple Recordset - Temporary Tables

I hope someone can help me out of here. I have to migrate from MSSQL2000 to Oracle 9x. On MSSQL I have a Stored Procedure that returns one Recordset. The Procedure calls itself many times (recursive) and the results are stored in a temporary table. At the end the procedure returns only the temporary ...

executing stored procedure

Im in the process of writing a java code to execute sp_sysmon .But i use callable statement to execute this stored procedure it says the query doent return resultset.How can i access result of this stored procedure.also is there is any table or stored procedure in sybase to get performance details l ...

Stored Procedures w/ MSSQL via ADODB

I need to call a stored procedure in php to a mssql database. The stored procedure does not return a recordset but I need to read one of the out values. The following vb script works (not complete code) and msgbox's me the right value:<--snip-->Set tx = cmd.Parameters("@p_claimtype") ...

Stored Procedure not running

I have a weird problem.I constuct a query to call a stored procedure with some parameters, and the stored procedure is for inserting data into the db (into a couple of tables)When I send this to the SQL Server (MSSQL), using ODBC or the mssql_ calls, the record does not always get inserted (works 20 ...

Postgres Stored Procedure programming

I'm migrating a webapp from MSSQL to Postgresql and I'm having some problems with the store procedure. This is what I have so far, but it doesn't seem to be working. I'm getting an error that says ERROR: parser: parse error at or near "INTO" at character 9What I need to do1.) Get the visit ...

MySQL Default Column Value From Stored Procedure?

Is there a way to assign a default value to a column from the result of a stored procedure? Example: I have two servers using merge replication in MSSQL and I have a stored procedure that determines what server the record is being inserted into and assigns the next odd or even number respectively. I ...

MySQL Is there any function or special variable to get current stored procedure name?

I want to log the error to a table when error occurred, in MSSQL, I can use OBJECT_NAME(@@PROCID) to get the current stored procedure name in each stored procedure, but can anyone tell how to implement this function in MySQL? ...

problem running stored procs w/mssql

I am using PHP 5.1.6 on a Linux server and need to access a MS SQL Server 2005 database. The PHP docs at http://us2.php.net/manual/en/ref.mssql.php say installing FreeTDS is a requirement for using the mssql extensions.FreeTDS is installed and configured for connection to a MS SQL 2005 server on my ...

Call Stored Procedure from PHP with ODBC

I have the following stored procedure call working fine with MSSQL and Windows. But now I am trying to use the same logic with odbc_connect from a Linux box to a SQL database. I think instead of mssql_execute I need to use obdc_execute, but I don't know how to change the rest of this statement to wo ...

Create stored procedure to make satic html content

first off I'd like to state that I am pretty new to ms sql and stored procedures tho I have worked with sql for quite some time.My employer would like me to write a script which takes html content from a mssql db (originally delivered dynamically) and create static pages from them and also would lik ...

Multiple Result Sets from Stored Procedure

I have a stiored procedure in MSSQL 7 that I access with a CRecordset derived class. The stored procedure has two select statements. CRCREATE PROCEDURE getlistoftopjobs .........asSELECT ......do something elseSELECT ......... The recordset always uses the first result set. Even when the column sele ...

C++ ODBC Stored Procedure Executing

I'm having problems executing a MSSQL 7.0 stored procedure from C++ ODBC. I have followed the syntax but I still get an error.Here is the call:{? = CALL csp_getContentInfo;1 (?)}When I view the (Profiler) trace of the call it looks like this:declare @P3 intset @P3=NULLexec sp_executesql N'= CALL csp ...

Oracle Can i return select statement from stored procedure!!!!!!!!!!!!

I want to write an stored procedure which return select statement like in "MSSQL SERVER 2000" I can wrote a stored procedure:"create procedure test@id char(2), @name varchar(50)ASset nocount oninsert into table1(id,name)select @id, @nameselect * from table1go". Please help meR.S. Mridha ...

COM trouble in extended stored procedure

I'm not sure what I'm doing wrong here... I have a COM object that I'm calling in an extended stored procedure. When I tested the COM in an .exe it worked with no problems, but when I call it from the stored procedure I get a message box that says:Microsoft Visual C++ Runtime LibraryRuntime Error!Pr ...

Problem firing stored procedure with PHP

I'm trying to use a stored proc via PHP, keep getting this error and can't figure out why:Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failedHere's my script:<?php$Server = "x";$User = "x";$Pass = "x";$DB = "x";$s = @mssql_c ...

results are not retrieved if temp tables are used in stored procedure not

I have created a stored procedure which first creates an temporary table, insert the values and queries it. This works perfectly in MSSQL management studio, but when i try to execute the same procedure using php, it does not returns any rows.I am using PEAR DB and MSSQL 2005$sql="Exec up_parmse ...