Click here to Skip to main content
15,891,513 members
Home / Discussions / Database
   

Database

 
GeneralRe: SUM Problem in MSSQL Pin
Eddy Vluggen12-Sep-12 6:00
professionalEddy Vluggen12-Sep-12 6:00 
AnswerRe: SUM Problem in MSSQL Pin
Jörgen Andersson12-Sep-12 1:00
professionalJörgen Andersson12-Sep-12 1:00 
QuestionSQL Seconds to Day, Hour, Minute, Second Pin
ahsansharjeel11-Sep-12 13:49
ahsansharjeel11-Sep-12 13:49 
AnswerRe: SQL Seconds to Day, Hour, Minute, Second Pin
Mycroft Holmes11-Sep-12 14:24
professionalMycroft Holmes11-Sep-12 14:24 
GeneralRe: SQL Seconds to Day, Hour, Minute, Second Pin
cbeglobal12-Sep-12 1:46
cbeglobal12-Sep-12 1:46 
GeneralRe: SQL Seconds to Day, Hour, Minute, Second Pin
Mycroft Holmes12-Sep-12 12:36
professionalMycroft Holmes12-Sep-12 12:36 
AnswerRe: SQL Seconds to Day, Hour, Minute, Second Pin
Hitesh R6-Nov-12 0:21
Hitesh R6-Nov-12 0:21 
QuestionTableAdapters results differ from Stored Procedure results, C# - SQL 2000 Pin
lowhitaker10-Sep-12 11:15
lowhitaker10-Sep-12 11:15 
Using Sql 2000 and C#.

I have a stored procedure where I pass in my identifier and use it to select a set of rows from several tables. When I execute this SP in query analyzer it works great, returning only the rows that do not exist in @Data. When executed in C# it is returning the entire set of data relevant to that identifier.

I'm at a loss on this. I've spent hours changing the SP around trying to get different results. I've tried both temp tables and var tables with the same results. Again, it always works in QA but never in C#.

Any thoughts? I've shortened some of the repetitive data from this query to save on screen space (and your eyes) but let me know if there is anything else i can show that could help.


Also, here's the weird part. I have a near exact duplicate of this query that works in both C# and QA. The only difference is that #Chas is populated via a select statement that returns a range of values instead of just being populated by the passed in value. I know i don't have to insert this value into #Chas but instead could just compare directly against it. It was like this just to make it as identical to the original as possible since the original works.


SQL
USE [B_D_DashPanel]
GO
/****** Object:  StoredProcedure [dbo].[sp_BD_PermConflicts]    Script Date: 09/10/2012 15:55:45 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[sp_BD_PermConflicts_Chassis_Only]
@Chassis_Search nvarchar(50)
AS


Declare @Data TABLE(
Chassis nvarchar(50),
ItemC nvarchar(50),
Location nvarchar(50),
Panel nvarchar(13),
Part nvarchar(50)
)

Create TABLE #Chas (
Chassis_No nvarchar(50)
)

set nocount on

insert into #Chas (Chassis_No) values (@Chassis_Search)


insert into @Data (Chassis, ItemC, Location, Panel, Part)
select distinct WorkPlacementorder.salesorderno, workplacementorder.itemcode, workplacementorder.location, workplacementorder.panel, 
itembompn.partnumber1
from #Chas,  workplacementorder 
join itembompn 
on workplacementorder.itemcode = itembompn.itemcode
inner join chassisdb.dbo.tblopenjit 
on workplacementorder.salesorderno = chassisdb.dbo.tblopenjit.chassisnbr 
where chassisdb.dbo.tblopenjit.chassisnbr like #Chas.Chassis_No and chassisdb.dbo.tblopenjit.itemid = itembompn.partnumber1
and WorkPlacementorder.salesorderno like #Chas.Chassis_No



SELECT b_d_Dashpanel.dbo.workplacementorder.ItemCode, b_d_Dashpanel.dbo.items.itemdescription
FROM #Chas, B_D_DashPanel.dbo.WorkPlacementOrder join b_d_Dashpanel.dbo.items on b_d_Dashpanel.dbo.workplacementorder.itemcode = b_d_Dashpanel.dbo.items.itemcode
where salesorderno = Chassis_No and b_d_DashPanel.dbo.workplacementorder.itemcode not in (select itemc from @Data)



drop table #Chas

AnswerRe: TableAdapters results differ from Stored Procedure results, C# - SQL 2000 Pin
Mycroft Holmes10-Sep-12 14:19
professionalMycroft Holmes10-Sep-12 14:19 
GeneralRe: TableAdapters results differ from Stored Procedure results, C# - SQL 2000 Pin
Jörgen Andersson11-Sep-12 0:37
professionalJörgen Andersson11-Sep-12 0:37 
GeneralRe: TableAdapters results differ from Stored Procedure results, C# - SQL 2000 Pin
Mycroft Holmes11-Sep-12 1:10
professionalMycroft Holmes11-Sep-12 1:10 
AnswerRe: TableAdapters results differ from Stored Procedure results, C# - SQL 2000 Pin
Michael Potter11-Sep-12 4:06
Michael Potter11-Sep-12 4:06 
GeneralRe: TableAdapters results differ from Stored Procedure results, C# - SQL 2000 Pin
lowhitaker11-Sep-12 4:31
lowhitaker11-Sep-12 4:31 
QuestionHow do i solved Timeout Expired Error in ASP.net with Backend as SQL 2008 Pin
Pratibha Mhatre7-Sep-12 2:01
Pratibha Mhatre7-Sep-12 2:01 
QuestionRe: How do i solved Timeout Expired Error in ASP.net with Backend as SQL 2008 Pin
Eddy Vluggen7-Sep-12 2:53
professionalEddy Vluggen7-Sep-12 2:53 
Answerclose and dispose Pin
David Mujica7-Sep-12 5:10
David Mujica7-Sep-12 5:10 
GeneralRe: close and dispose Pin
Pratibha Mhatre19-Sep-12 20:05
Pratibha Mhatre19-Sep-12 20:05 
GeneralRe: close and dispose Pin
David Mujica20-Sep-12 10:22
David Mujica20-Sep-12 10:22 
QuestionSequence of events inside a stored procedure Pin
Clive D. Pottinger6-Sep-12 8:13
Clive D. Pottinger6-Sep-12 8:13 
AnswerRe: Sequence of events inside a stored procedure Pin
Andrei Straut6-Sep-12 9:23
Andrei Straut6-Sep-12 9:23 
AnswerRe: Sequence of events inside a stored procedure Pin
PIEBALDconsult6-Sep-12 9:49
mvePIEBALDconsult6-Sep-12 9:49 
AnswerRe: Sequence of events inside a stored procedure Pin
Clive D. Pottinger7-Sep-12 6:42
Clive D. Pottinger7-Sep-12 6:42 
JokeRe: Sequence of events inside a stored procedure Pin
cbeglobal12-Sep-12 1:44
cbeglobal12-Sep-12 1:44 
Questioni m new in sql.i want print a message(the table employe is not exist in database) in error handling with try and catch Pin
Rashid Choudhary6-Sep-12 2:02
Rashid Choudhary6-Sep-12 2:02 
AnswerRe: i m new in sql.i want print a message(the table employe is not exist in database) in error handling with try and catch Pin
Wes Aday6-Sep-12 2:26
professionalWes Aday6-Sep-12 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.