473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create stored procedure using sp_executeSQL with temp Table

We currently have a stored procedure with a few parameters and one of them is a list of invoice numbers that is comma separated.

The stored procedure creates a temp table, uses a local function to split out the invoice numbers, populate the temp table and uses the data in the temp table to select data from another table.

I would like to modify this stored procedure to add another parameters to control the sort order of the data. It appears I will need to use sp_executeSQL to get this to happen. I am not sure how to do this for the portion to create, populate the temp table and to
use the data in the temp table in my select statement.

Attached is the original SP and the changes I have tried



Thanks in advance for your help,
tsharp
Attached Files
File Type: txt StoredProcedureQuestion.txt (2.1 KB, 252 views)
Jul 30 '15 #1
0 1991

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: gwaddell | last post by:
I have a stored procedure that is loading data into a global temp table. Here is all the code for that stored procedure. CREATE PROCEDURE AS SET NOCOUNT ON BEGIN
0
by: Mike | last post by:
Hi, I am trying to insert parameters into a stored procedure using DAAB (see code at the bottom of this post). I am getting the following error: Object reference not set to an instance of an...
3
by: michelle | last post by:
I am trying to get an output value from a stored procedure using sqlDataSource in asp.net 2.0. But I only get a null value for the output. Can someone please help? The sqlDataSource: ...
2
donilourdu
by: donilourdu | last post by:
hi all, I want to know how to create stored procedure from clinet when i try it says error. but i can able to create same in server. Looking for nice reply,...... ERROR ACCESS...
0
by: Khushboo Chhabra | last post by:
Hello, I’m working on mainframes platform and have been trying to collect some knowledge on Stored Procedures. I referred to IBM’s red book. And found details regarding how to create stored...
1
by: ssrirao | last post by:
Hi, I have a table in the database and I want to insert the values into this table by using JavaScript. Does anyone know how to execute the Sql stored procedure using Javascript. Thanks
0
by: SLauren | last post by:
Hi, Can anyone please help me how can i debug a mysql stored procedure using toad software?? Thanks in advance, Lauren
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.