SQL Server Data Source Issue

Stimulsoft Reports.NET discussion
mws
Posts: 1
Joined: Wed Apr 11, 2007 4:15 pm
Location: Allentown, PA

SQL Server Data Source Issue

Post by mws »

I am trying to use a stored procedure with temp tables as a data source. The 'View Query' function works correctly, returning records. If I click on 'Retrieve Columns', I get an error message 'Invalid Object Name '#tSample.

Here is a very simple version of the stored procedure...

Create Procedure xTest AS
SET NOCOUNT ON
create table #tSample ( setting_value varchar(5) )
insert into #tSample values('test')
select * from #tSample

GO
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

SQL Server Data Source Issue

Post by Vital »

At this moment StimulReport.Net does not support function "retrieve columns" for stored proc with temp tables. We hope fix this problem soon.

Thank you.
rknunna
Posts: 1
Joined: Fri Aug 24, 2007 1:31 pm
Location: USA

SQL Server Data Source Issue

Post by rknunna »

Create Procedure xTest AS
SET NOCOUNT ON
create table #tSample ( setting_value varchar(5) )
insert into #tSample values('test')
select * from #tSample

GO

You can use to solve the problem.

Create Procedure xTest AS
SET NOCOUNT ON
declare @tSample table ( setting_value varchar(5) )
insert into @tSample values('test')
select * from @tSample

GO
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

SQL Server Data Source Issue

Post by Vital »

In latest prerelease builds this problem already solved.

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

SQL Server Data Source Issue

Post by Vital »

In latest prerelease builds function "Retrieve columns" works fine for stored proc.

Thank you.
adinac
Posts: 16
Joined: Mon Apr 22, 2013 11:59 am

Re: SQL Server Data Source Issue

Post by adinac »

Hello,

I am experiencing the same problem in the MVC designer. Is this not fixed or implemented for mvc? I am using Version=2013.1.1600.0.

Thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: SQL Server Data Source Issue

Post by Alex K. »

Hello,

Unfortunately, but retrieve columns does not work directly in Web designer.
As a way you can create datasource with stored procedure with parameters in standalone designer and then uses it in web version.
We have added this issue in our to-do list.

Thank you.
adinac
Posts: 16
Joined: Mon Apr 22, 2013 11:59 am

Re: SQL Server Data Source Issue

Post by adinac »

Hello,

I have also tried it from Demo.exe and still get the same error:(
If I make 'view data', data is displayed properly.

Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: SQL Server Data Source Issue

Post by Alex K. »

Hello,

Can you please send us a sample procedure with test data which reproduce the issue for analysis.

Thank you.
adinac
Posts: 16
Joined: Mon Apr 22, 2013 11:59 am

Re: SQL Server Data Source Issue

Post by adinac »

Hello,

Back from vacation with additional information.
This would be the script to create the db and everything necessary for this problem:

Code: Select all

create database TestTemporaryTable;
go
USE [TestTemporaryTable]
GO
CREATE TABLE [dbo].[myTable](
	[serial] [int] NULL,
	[locationname] [nvarchar](50) NULL,
	[statusid] [int] NULL,
	[locationid] [int] NULL
) ON [PRIMARY]
GO


insert into myTable values (1, null, 3, null);
insert into myTable values  (2, 'asa', 3, 5);
go 
CREATE PROCEDURE [dbo].[TestProcedure]
	(@locationname varchar(50) = 'All Locations')
AS
begin
	declare @locationid int;
	begin try
	drop table #tempDuedates
	end try
	begin catch
	end catch
	select * into #tempDuedates from myTable
	
	select @locationid = locationid from
	(
	select distinct locationid, locationname,2 as ordernb  from #tempDuedates
	where statusid = 3 
	) t
	where t.locationname like @locationname
END
GO

Thanks,

Adina
Attachments
screenshot.png
screenshot.png (40.22 KiB) Viewed 3972 times
Post Reply