473,387 Members | 1,791 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.

Execution

Hi,

The sql script i try to execute in c# code fails to insert data in table but no error occurs. If I copy the sql code right before execution and paste it into the management studio it works fine. The script looks something like this.

create table #tempHolder1(RecipientID int, SMSMessageQueueID int)
create table #tempHolder2(SMSMessageQueueID int, RecipientID int, SMSResponseText nvarchar(32), ResponseDate datetime)

insert into #tempHolder1 select RecipientID, SmsMessageQueueID from tSmsMessageSendInfo where DestinationNumber = @mobileNumber
and SMSMessageQueueID in (select SMSMessageQueueID from tSMSMessageQueue where IRP = @irpID)

insert into #tempHolder2 (SMSMessageQueueID, RecipientID)
select SMSMessageQueueID, RecipientID from #tempHolder1

update #tempHolder2 set SMSResponseText = @smsResponseText, ResponseDate = @responseDate

insert into tSmsResponse (SMSMessageQueueID, RecipientID, SMSResponseText, ResponseDate)
select * from #tempHolder2

drop table #tempHolder1
drop table #tempHolder2
Dec 3 '08 #1
3 1182
ck9663
2,878 Expert 2GB
The only reason I can't think of is because of your temp table.I don't know how you executed the entire code, if this is a single batch or one code at a time.

-- CK
Dec 3 '08 #2
Thanx for the reply. I do it all in one execution.
Dec 3 '08 #3
ck9663
2,878 Expert 2GB
Try using a table variable or a physical table instead.

-- CK
Dec 3 '08 #4

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

Similar topics

6
by: Paolo Losi | last post by:
Hi all, I'm pretty new to the python language so please excuse me if this is FAQ... I'm very glad to be part of the list! :-) I'm looking into a way to implement a generic workflow framework...
30
by: Sean R. Lynch | last post by:
I've been playing around with Zope's RestrictedPython, and I think I'm on the way to making the modifications necessary to create a capabilities-based restricted execution system. The idea is to...
2
by: Jenny Zhang | last post by:
The osdl-dbt3 test starts with building and vacuuming the database. The execution plans were taken after the vacuuming. I did two tests with the same database parameters: 1. run two osdl-dbt3...
5
by: Johannes Lebek | last post by:
Hi there, lately, I experienced a strange thing on my DB2 V8.1 on Windows: Some queries took a very long time. A snapshot discovered the following: Number of executions = 47...
75
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
3
by: iam980 | last post by:
Hello All. We have tested following SQL script from query analyzer: -- Script begin DECLARE @I int; SET @I = 1; WHILE @I < 10000000 BEGIN SET @I = @I + 1; END -- Script end
2
by: Ina Schmitz | last post by:
Hi NG, does IBM Universal Database 8.2 make any difference between actual and estimated execution plans like in SQL Server ("set showplan_all on" for estimated execution plan and "set statistics...
17
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also...
4
by: TheRealPawn | last post by:
I'm trying to get the execution plan for a single stored procedure from Profiler. Now, I've isolated the procedure but I get all execution plans. Any ideas on how to connect the SPIDs so that I...
2
by: abhaybhat | last post by:
I run a batch file, which is nothing but a make file of my project. It also does linting for me. Hence the execution of the batch file in the DOS window can be seen, which is very huge(i have...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.