stored-procedures

Using SQL Stored Procedure as data for a Microsoft Dynamics CRM report

We need to have a semi complex report in CRM that displays some accumulated lead values. The only way I see this report working is writing a stored procedure that creates a couple of temporary tables and calculates/accumulates data utilizing cursors. Then is the issue of getting the data from the stored procedure to be accessible from ...

Using Linq SubmitChanges without TimeStamp and StoredProcedures the same time

I am using Sql tables without rowversion or timestamp. However, I need to use Linq to update certain values in the table. Since Linq cannot know which values to update, I am using a second DataContext to retrieve the current object from database and use both the database and the actual object as Input for the Attach method like so: Publ...

What's the syntax of calling a stored procedure in oracle

Little help needed here. I'm new to Oracle and i'm not understaning the the syntax of calling a store procedure that has a single in-out parameter. Any example please? ...

SQL injection - no danger on stored procedure call (on iSeries)?

I've done some searching around but I have a specific question on SQL Injection and hope I can get some input as I believe I may be getting the wrong end of the stick to do with field data sanitising etc :- I have a java program calling a stored procedure on an iSeries. The stored procedure has CL / RPG code behind the scenes. The store...

Developing MySQL Stored Procedures with Intellisense?

Hello, i've looking for an IDE for MySQL with intellisense, which would help a lot. Any suggestions? Thanks! ...

Is it possible to refactor this MySQL stored procedure loop?

Hi! I have a loop in MySQL stored procedure where i insert record almost for each iteration. Well known problem is that inserting row-by-row is inefficient and i'd rather see inserts with multiple value lists instead. Pseudo-example of current procedure: CREATE PROCEDURE p_foo_bar() BEGIN DECLARE foo VARCHAR(255); DECLARE my_cursor...

Problems running a stored procedure owned by another user

We have a 3rd-party app that wants to call a stored proc using SQL 2005-style "schema" syntax: Customer.InsertNewOrder This db is still on SQL 2000, though, so we're trying to make it "look" like a SQL 2005 schema, and still work right (with minimum necessary permissions). So we: Created a user called "Customer" Created the stored p...

Unit Testing and Stored Procedures

How do you unit test your code that utilizes stored procedure calls? In my applications, I use a lot of unit testing (NUnit). For my DAL, I use the DevExpress XPO ORM. One benefit of XPO is that it lets you use in-memory data storage. This allows me to set up test data in my test fixtures without having an external dependency on a da...

How can I speed up batch processing job in Coldfusion?

Every once in awhile I am fed a large data file that my client uploads and that needs to be processed through CMFL. The problem is that if I put the processing on a CF page, then it runs into a timeout issue after 120 seconds. I was able to move the processing code to a CFC where it seems to not have the timeout issue. However, sometime ...

Immediate Window while debugging Stored Procs in Visual Studio 2005

Debugging stored sproc can be menace, & I was not able to use the Immediate Window like the way I thought I would be. Is the immediate window available while debugging Stored Procs in VS 2005? Is there any other way I would be able to run queries on a Temporary Table which I am creating inside a Stored Proc ? As the scope of the Temp...

Iterate Xml Column elements and comapre against Xml Variable

Hi, I'm not sure how to word this correctly but I'm very (very) new to XML in Sql Server. I have an XML Column defined in a table and I want to retrieve the id of the record if the data in the Xml Column matches elements in a predefined list. The data looks a bit like this: <Parameters> <Parameter> <Name>Param1</Name> ...

Is possible to get a constant value declared in a database package? (SQL or Java)

I have some Packages in a Oracle database. They contain stored procedures, functions and constants. I can call functions, in Java, using a Java CallableStatement. Also, I could execute a SQL statement as "select package1.function1(value1) from dual;". But I can't find how to get the value of a constant declared in the package, in Java. ...

Parsing Multiple values and sending it in a query string

I have a grid view with multiple select check boxes. I want to return an array of the items that have been selected and put this in a label (comma-separated) 12,34,34,54,54,5 I want it to be parsed and then sent to a query string or send the whole value to the query string. How do a get multiple selected check boxes and return an ar...

Bind LINQ data via stored procedure to Gridview

The function in dbml is, [Function(Name = "dbo.sp_GetQuestions")] public ISingleResult<vw_QuestionMaster> sp_GetQuestions([Parameter(Name = "Sort", DbType = "Int")] System.Nullable<int> sort, [Parameter(Name = "Title", DbType = "VarChar(50)")] string title, [Parameter(Name = "Tags", DbType = "VarChar(50)")] string tags, [Paramet...

Passing an array of ID's to a stored procedure

I have stored procedure, i want to send it an array of values. When i send more than one i'm getting an error Error converting data type varchar to numeric. Here is the code. set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[sp_getTransfer] @TRANSFER_ID int = null, @COMPANY VARCHAR(5),@FORMTYPE VARCHAR(30), @TRANSF...

Empty report when using VS2008 report wizard and stored procedure

I'm using VS2008, writing a C# .NET app. I have an SQL Server 2005 database server with a database which contains several stored procedures. I want to show the stored procedure data in a report. So, as a test I created a brand new VS2008 C# project based on the "Reporting -> Reports Application" project type. I went through the wizard,...

How to write a stored procedure that will create 20 databases

Hi Can anybody tell me how to write a stored procedure that creates 20 databases in c:\test\ if i put a storedprocedure for database creation in a loop then if i create a first db as test again loop will calls sp.but it shows test alredy there. I don't know how to concatenate a variable to this so that i wil create test1 test2 test3...

Random Records & SQL2005 Stored Procedure Insert

Hi, I need to submit data from a form to an SQL2005 database via a stored procedure. The difficult part is that i also need to get 5 random records from a secondary table and insert these as part of the inserted record in table 1. My structure is akin to this: Tbl_Organisations (table to get the 5 random records from) Key | organis...

functional reason why stored procedures don't support INSERT/EXECUTE INTO?

In SQL Server, there's no way to create a temp table on the fly from the results of a stored procedure, ala: CREATE TABLE #temptable AS EXEC spMyStoredProc or EXEC spMyStoredProc INTO #temptable or something like that. Instead, you have to know the SP layout beforehand, and have to do something like this: CREATE TABLE #temptable (...

What are the ramifications of granting a DB User with limited access Execute permission?

If I have a user that only has limited permissions - just db_datareader and db_datawriter, which should only permit the user to query data and insert/edit/delete data, without allowing the user to add/modify/delete tables in the database. There may be a need for the user to be able to execute stored procedures. If the user is given exe...