In .NET when I call a stored proc that returns two sets of data, each
set is put into a datatable within the dataset. I have an SRS report
that is calling a stored proc that does the same thing. However, SRS
doesn't show me that second data table so I can get access to it's
columns. Is there a way to see multiple data tables from within a
Dataset in SRS?On Jun 5, 1:49 pm, Doogie <dnlwh...@.dtgnet.com> wrote:
> In .NET when I call a stored proc that returns two sets of data, each
> set is put into a datatable within the dataset. I have an SRS report
> that is calling a stored proc that does the same thing. However, SRS
> doesn't show me that second data table so I can get access to it's
> columns. Is there a way to see multiple data tables from within a
> Dataset in SRS?
As far as I know, there is not; however, you can create multiple
datasets: one dataset per resultset. Sorry that I could not be of
greater assistance.
Regards,
Enrique Martinez
Sr. Software Consultant
Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts
Sunday, March 25, 2012
Accessing data in a different database?
Hi,
I'm using SQL Server 2000 and I would like to make a view in one database
that returns data from a second database on the same server/instance of SQL
Server. Is this possible? If so, how?
Thanks in advance,
LinnCREATE VIEW dbo.MyView
AS
SELECT <columns>
FROM DatabaseName.dbo.TableName;
GO
"Linn Kubler" <lkubler@.chartwellwisc2.com> wrote in message
news:OcjY0nvbGHA.4900@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I'm using SQL Server 2000 and I would like to make a view in one database
> that returns data from a second database on the same server/instance of
> SQL Server. Is this possible? If so, how?
> Thanks in advance,
> Linn
>|||Assuming that you have appropriate permissions set up, simply use
three-part naming:
SELECT columnList
FROM OtherDatabase.DatabaseOwner.TableName
HTH,
Stu|||Ah yes, that worked great. Thanks Stu and Aaron for the help.
Linn
"Linn Kubler" <lkubler@.chartwellwisc2.com> wrote in message
news:OcjY0nvbGHA.4900@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I'm using SQL Server 2000 and I would like to make a view in one database
> that returns data from a second database on the same server/instance of
> SQL Server. Is this possible? If so, how?
> Thanks in advance,
> Linn
>
I'm using SQL Server 2000 and I would like to make a view in one database
that returns data from a second database on the same server/instance of SQL
Server. Is this possible? If so, how?
Thanks in advance,
LinnCREATE VIEW dbo.MyView
AS
SELECT <columns>
FROM DatabaseName.dbo.TableName;
GO
"Linn Kubler" <lkubler@.chartwellwisc2.com> wrote in message
news:OcjY0nvbGHA.4900@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I'm using SQL Server 2000 and I would like to make a view in one database
> that returns data from a second database on the same server/instance of
> SQL Server. Is this possible? If so, how?
> Thanks in advance,
> Linn
>|||Assuming that you have appropriate permissions set up, simply use
three-part naming:
SELECT columnList
FROM OtherDatabase.DatabaseOwner.TableName
HTH,
Stu|||Ah yes, that worked great. Thanks Stu and Aaron for the help.
Linn
"Linn Kubler" <lkubler@.chartwellwisc2.com> wrote in message
news:OcjY0nvbGHA.4900@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I'm using SQL Server 2000 and I would like to make a view in one database
> that returns data from a second database on the same server/instance of
> SQL Server. Is this possible? If so, how?
> Thanks in advance,
> Linn
>
Thursday, March 22, 2012
Accessing a View from within a Stored Procedure
Hiya folks,
I'n need to access a view from within a SProc, to see if the view returns a recordset and if it does assign one the of the fields that the view returns into a variable.
The syntax I'm using is as follows :
SELECT TOP 1 @.MyJobN = IJobN FROM MyView
I keep getting an object unknown error (MyView). I've also tried calling it with the 'owner' tags.
SELECT TOP 1 @.MyJobN = IJobN FROM LimsLive.dbo.MyView
But alas to no avail!
Any offers kind people??It's a top kinda monday
top without order by is meaningless
Where's the DDL for the view?
And the actual sql statement or sproc?|||All the sorting and the like is done within the view itself. The only thing I need to know is if the view returns a recordset and if it does then proceed with the stored pro. A 'trimmed' down version of the Code is the following:
CREATE PROCEDURE SP_LastPDFCreated
AS
DECLARE @.MyLastPDFDate as DateTime, @.MyCurrentTime AS DateTime, @.MyJobN AS INT
SET @.MyJobN = ''
SET @.MyCurrentTime = GETDATE()
SELECT TOP 1 @.MyLastPDFDate = DatePDFCreated FROM dbo.TArcCert WHERE (DatePDFCreated IS NOT NULL) ORDER BY DatePDFCreated DESC
SELECT TOP 1 @.MyJobN = IJobN FROM MyView
IF @.MyJobN <> ''
BEGIN
IF DATEDIFF(n, @.MyLastPDFDate, @.MyCurrentTime) > 10
BEGIN
EXEC LimsLive.dbo.SP_TestXPSendMail
END
END
GO|||You sure the view exists?
And change the if statement...
IF EXISTS(SELECT TOP 1 IJobN FROM MyView)
BEGIN
.....
END|||God and it's only Monday!
Early entry for 'Twat of the week' award. I'd spelt my view incorrectly.
Apologies for wasting your time but thank you for your responses.
Sorry Matey|||and there's a term I haven't heard in a looooooooooooong time...
begs the question...since you didn't fill out the profile...
gender?|||That'll be Male, I've filled in bits and bobs of the profile|||I think "Twat" is the plural of "Twit" ;)|||I think "Twat" is the plural of "Twit" ;)Two points for the correct interpretation of English slang!
As I'm still a "Technical Wizard of Information Technology" with a number of UK friends, I've been informed in great detail about these things!
-PatP|||Two points for the correct interpretation of English slang!
if I can ever do that, It's an accident. I'm STILL trying to figure out what a couple gals (who CLAIMED to be speaking english) were saying in front of me in cockney at lunch one day in Croydon - something about crossing a road to see a toad or something...:scratching head:|||if I can ever do that, It's an accident. I'm STILL trying to figure out what a couple gals (who CLAIMED to be speaking english) were saying in front of me in cockney at lunch one day in Croydon - something about crossing a road to see a toad or something...:scratching head:Whenever you have two women talking to you about "crossing a road to see a toad", the best possible response I can imagine is to "play dumb" whether you have any clue or not!
-PatP|||Or put on some green and get over there before them.|||Hate to disagree folks, but I don't think Twat is a plural of anything. Rather a slang name for a part of a lady's anatomy!
I'n need to access a view from within a SProc, to see if the view returns a recordset and if it does assign one the of the fields that the view returns into a variable.
The syntax I'm using is as follows :
SELECT TOP 1 @.MyJobN = IJobN FROM MyView
I keep getting an object unknown error (MyView). I've also tried calling it with the 'owner' tags.
SELECT TOP 1 @.MyJobN = IJobN FROM LimsLive.dbo.MyView
But alas to no avail!
Any offers kind people??It's a top kinda monday
top without order by is meaningless
Where's the DDL for the view?
And the actual sql statement or sproc?|||All the sorting and the like is done within the view itself. The only thing I need to know is if the view returns a recordset and if it does then proceed with the stored pro. A 'trimmed' down version of the Code is the following:
CREATE PROCEDURE SP_LastPDFCreated
AS
DECLARE @.MyLastPDFDate as DateTime, @.MyCurrentTime AS DateTime, @.MyJobN AS INT
SET @.MyJobN = ''
SET @.MyCurrentTime = GETDATE()
SELECT TOP 1 @.MyLastPDFDate = DatePDFCreated FROM dbo.TArcCert WHERE (DatePDFCreated IS NOT NULL) ORDER BY DatePDFCreated DESC
SELECT TOP 1 @.MyJobN = IJobN FROM MyView
IF @.MyJobN <> ''
BEGIN
IF DATEDIFF(n, @.MyLastPDFDate, @.MyCurrentTime) > 10
BEGIN
EXEC LimsLive.dbo.SP_TestXPSendMail
END
END
GO|||You sure the view exists?
And change the if statement...
IF EXISTS(SELECT TOP 1 IJobN FROM MyView)
BEGIN
.....
END|||God and it's only Monday!
Early entry for 'Twat of the week' award. I'd spelt my view incorrectly.
Apologies for wasting your time but thank you for your responses.
Sorry Matey|||and there's a term I haven't heard in a looooooooooooong time...
begs the question...since you didn't fill out the profile...
gender?|||That'll be Male, I've filled in bits and bobs of the profile|||I think "Twat" is the plural of "Twit" ;)|||I think "Twat" is the plural of "Twit" ;)Two points for the correct interpretation of English slang!
As I'm still a "Technical Wizard of Information Technology" with a number of UK friends, I've been informed in great detail about these things!
-PatP|||Two points for the correct interpretation of English slang!
if I can ever do that, It's an accident. I'm STILL trying to figure out what a couple gals (who CLAIMED to be speaking english) were saying in front of me in cockney at lunch one day in Croydon - something about crossing a road to see a toad or something...:scratching head:|||if I can ever do that, It's an accident. I'm STILL trying to figure out what a couple gals (who CLAIMED to be speaking english) were saying in front of me in cockney at lunch one day in Croydon - something about crossing a road to see a toad or something...:scratching head:Whenever you have two women talking to you about "crossing a road to see a toad", the best possible response I can imagine is to "play dumb" whether you have any clue or not!
-PatP|||Or put on some green and get over there before them.|||Hate to disagree folks, but I don't think Twat is a plural of anything. Rather a slang name for a part of a lady's anatomy!
Tuesday, March 6, 2012
Access Text of Parameter
I have a report that uses parameters from a query. The query returns two
columns. One for the paramerter value and one for the parameter title. I want
the header of the report to access the same fild that I have set as the Label
Field in my report parameter dropdown.
I can add the actual parameter to the header using:
=Parameters!Property.Value
But I don't want the actual parameter, i want the alias from the second
colum of the parameter query.
I tried
=Parameters!Property.Text
but it didn't work.
Any ideas?
Thanks!try =Parameters!Property.Label
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Eric Langland [MSFT]" <EricLanglandMSFT@.discussions.microsoft.com> wrote in
message news:C60A3AB7-7C07-418B-B2F7-ECA395614511@.microsoft.com...
>I have a report that uses parameters from a query. The query returns two
> columns. One for the paramerter value and one for the parameter title. I
> want
> the header of the report to access the same fild that I have set as the
> Label
> Field in my report parameter dropdown.
> I can add the actual parameter to the header using:
> =Parameters!Property.Value
> But I don't want the actual parameter, i want the alias from the second
> colum of the parameter query.
> I tried
> =Parameters!Property.Text
> but it didn't work.
> Any ideas?
> Thanks!|||That did it.
Many thanks Lev!
"Lev Semenets [MSFT]" wrote:
> try =Parameters!Property.Label
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Eric Langland [MSFT]" <EricLanglandMSFT@.discussions.microsoft.com> wrote in
> message news:C60A3AB7-7C07-418B-B2F7-ECA395614511@.microsoft.com...
> >I have a report that uses parameters from a query. The query returns two
> > columns. One for the paramerter value and one for the parameter title. I
> > want
> > the header of the report to access the same fild that I have set as the
> > Label
> > Field in my report parameter dropdown.
> >
> > I can add the actual parameter to the header using:
> >
> > =Parameters!Property.Value
> >
> > But I don't want the actual parameter, i want the alias from the second
> > colum of the parameter query.
> >
> > I tried
> > =Parameters!Property.Text
> > but it didn't work.
> >
> > Any ideas?
> >
> > Thanks!
>
>
columns. One for the paramerter value and one for the parameter title. I want
the header of the report to access the same fild that I have set as the Label
Field in my report parameter dropdown.
I can add the actual parameter to the header using:
=Parameters!Property.Value
But I don't want the actual parameter, i want the alias from the second
colum of the parameter query.
I tried
=Parameters!Property.Text
but it didn't work.
Any ideas?
Thanks!try =Parameters!Property.Label
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Eric Langland [MSFT]" <EricLanglandMSFT@.discussions.microsoft.com> wrote in
message news:C60A3AB7-7C07-418B-B2F7-ECA395614511@.microsoft.com...
>I have a report that uses parameters from a query. The query returns two
> columns. One for the paramerter value and one for the parameter title. I
> want
> the header of the report to access the same fild that I have set as the
> Label
> Field in my report parameter dropdown.
> I can add the actual parameter to the header using:
> =Parameters!Property.Value
> But I don't want the actual parameter, i want the alias from the second
> colum of the parameter query.
> I tried
> =Parameters!Property.Text
> but it didn't work.
> Any ideas?
> Thanks!|||That did it.
Many thanks Lev!
"Lev Semenets [MSFT]" wrote:
> try =Parameters!Property.Label
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Eric Langland [MSFT]" <EricLanglandMSFT@.discussions.microsoft.com> wrote in
> message news:C60A3AB7-7C07-418B-B2F7-ECA395614511@.microsoft.com...
> >I have a report that uses parameters from a query. The query returns two
> > columns. One for the paramerter value and one for the parameter title. I
> > want
> > the header of the report to access the same fild that I have set as the
> > Label
> > Field in my report parameter dropdown.
> >
> > I can add the actual parameter to the header using:
> >
> > =Parameters!Property.Value
> >
> > But I don't want the actual parameter, i want the alias from the second
> > colum of the parameter query.
> >
> > I tried
> > =Parameters!Property.Text
> > but it didn't work.
> >
> > Any ideas?
> >
> > Thanks!
>
>
Saturday, February 25, 2012
Access second grid from SQL stored procedure
Hi:
I have a SQL stored procedure that returns 2 tables. How can I access the
fields from the second table. even though the column names are distinct in
the 2 tables, my reports do not get to the second table's fields. I cannot
join the 2 tables returned. And i cannot have them in 2 separate stored
procedures, because they use the data from the first table.
Please suggest something.
ThanksAre you using temporary tables? Not sure why you can't combine the 2 tables
into a 3rd table to return one result set. Can you explain further?
"NI" wrote:
> Hi:
> I have a SQL stored procedure that returns 2 tables. How can I access the
> fields from the second table. even though the column names are distinct in
> the 2 tables, my reports do not get to the second table's fields. I cannot
> join the 2 tables returned. And i cannot have them in 2 separate stored
> procedures, because they use the data from the first table.
> Please suggest something.
> Thanks|||well my first table is like a summary table, and the second table is like a
detailed table. One issue am having whihc is stopping me from combining both
tables is that the second table has duplicates (whihc I want to show in the
second table but not in the first table). I know SQL RS has the hide
duplicates option, ad if I do a grouping on that particular column it hides
duplicates, but the issue is with the count. If I have just one table (the
one with duplicates in it), I cannot get the right count (without duplicates)
in RS, as it always returns me the count with duplicates. so i had to
separate these two tables.
Also though there a few common columns in these tables, knowing the data I
know it wouldnt make much sense combining them, so I want to leave them as
separate tables.
Right now the workaround I have is have 2 different datasets doing the same
thing, but returning only one of the select statements. But its kinda wierd
to have 2 separate datasets doing the same thing.
Thanks
"phil" wrote:
> Are you using temporary tables? Not sure why you can't combine the 2 tables
> into a 3rd table to return one result set. Can you explain further?
> "NI" wrote:
> > Hi:
> >
> > I have a SQL stored procedure that returns 2 tables. How can I access the
> > fields from the second table. even though the column names are distinct in
> > the 2 tables, my reports do not get to the second table's fields. I cannot
> > join the 2 tables returned. And i cannot have them in 2 separate stored
> > procedures, because they use the data from the first table.
> >
> > Please suggest something.
> >
> > Thanks|||And you never will, except for using aggregation functions.
I think this is a bummer.
Look up SCOPE in the RS help and you will see what I mean.
Here's a sample assuming dataset1 and dataset2:
TextBox1.value = Fields!FirstName.Value
TextBox2.value = Sum(Fields!Income.Value, "dataset2")
BR//Jerry
I have a SQL stored procedure that returns 2 tables. How can I access the
fields from the second table. even though the column names are distinct in
the 2 tables, my reports do not get to the second table's fields. I cannot
join the 2 tables returned. And i cannot have them in 2 separate stored
procedures, because they use the data from the first table.
Please suggest something.
ThanksAre you using temporary tables? Not sure why you can't combine the 2 tables
into a 3rd table to return one result set. Can you explain further?
"NI" wrote:
> Hi:
> I have a SQL stored procedure that returns 2 tables. How can I access the
> fields from the second table. even though the column names are distinct in
> the 2 tables, my reports do not get to the second table's fields. I cannot
> join the 2 tables returned. And i cannot have them in 2 separate stored
> procedures, because they use the data from the first table.
> Please suggest something.
> Thanks|||well my first table is like a summary table, and the second table is like a
detailed table. One issue am having whihc is stopping me from combining both
tables is that the second table has duplicates (whihc I want to show in the
second table but not in the first table). I know SQL RS has the hide
duplicates option, ad if I do a grouping on that particular column it hides
duplicates, but the issue is with the count. If I have just one table (the
one with duplicates in it), I cannot get the right count (without duplicates)
in RS, as it always returns me the count with duplicates. so i had to
separate these two tables.
Also though there a few common columns in these tables, knowing the data I
know it wouldnt make much sense combining them, so I want to leave them as
separate tables.
Right now the workaround I have is have 2 different datasets doing the same
thing, but returning only one of the select statements. But its kinda wierd
to have 2 separate datasets doing the same thing.
Thanks
"phil" wrote:
> Are you using temporary tables? Not sure why you can't combine the 2 tables
> into a 3rd table to return one result set. Can you explain further?
> "NI" wrote:
> > Hi:
> >
> > I have a SQL stored procedure that returns 2 tables. How can I access the
> > fields from the second table. even though the column names are distinct in
> > the 2 tables, my reports do not get to the second table's fields. I cannot
> > join the 2 tables returned. And i cannot have them in 2 separate stored
> > procedures, because they use the data from the first table.
> >
> > Please suggest something.
> >
> > Thanks|||And you never will, except for using aggregation functions.
I think this is a bummer.
Look up SCOPE in the RS help and you will see what I mean.
Here's a sample assuming dataset1 and dataset2:
TextBox1.value = Fields!FirstName.Value
TextBox2.value = Sum(Fields!Income.Value, "dataset2")
BR//Jerry
Access returns blank results on localhost
I am running a sql query against a access database and when I run it under localhost or from a access query it does not return any records However if I run the same query using something like table editor or run the same query with the same page on the server it returns a full recordset.
Here is the query if that might help:
SELECT * FROM Rings WHERE Date Like '" & mid(Date,1,Instr(Date, "/")-1) & "%" & mid(Date,InstrRev(Date, "/")+1) & "' and Display = True ORDER BY Date Desc, ID Desc
Any help is greatly appreciated.
Thanks
-ScottDifferent dates?
-PatP|||I am trying to select all records from the current month from the db. Basically a new uploads list for users that will select all records for the current month and year but as I said does not return anything when run locally.
When the query runs it looks something like this:
SELECT * FROM Rings WHERE Date Like '11%2004' and Display = True ORDER BY Date Desc, ID Desc
Here is the query if that might help:
SELECT * FROM Rings WHERE Date Like '" & mid(Date,1,Instr(Date, "/")-1) & "%" & mid(Date,InstrRev(Date, "/")+1) & "' and Display = True ORDER BY Date Desc, ID Desc
Any help is greatly appreciated.
Thanks
-ScottDifferent dates?
-PatP|||I am trying to select all records from the current month from the db. Basically a new uploads list for users that will select all records for the current month and year but as I said does not return anything when run locally.
When the query runs it looks something like this:
SELECT * FROM Rings WHERE Date Like '11%2004' and Display = True ORDER BY Date Desc, ID Desc
Subscribe to:
Posts (Atom)