﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / Output of Dynamic variable to next query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 16:04:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Output of Dynamic variable to next query</title><link>http://www.sqlservercentral.com/Forums/Topic1420029-338-1.aspx</link><description>Thanks a lot Anthony. This helped me to fix the issue with which i was struggling</description><pubDate>Thu, 14 Feb 2013 07:11:00 GMT</pubDate><dc:creator>jeganbenitto.francis</dc:creator></item><item><title>RE: Output of Dynamic variable to next query</title><link>http://www.sqlservercentral.com/Forums/Topic1420029-338-1.aspx</link><description>needs to be done in the same session but dodeclare @cnt intselect @cnt = count(*) from tableselect top 10 *, @cnt from table</description><pubDate>Thu, 14 Feb 2013 06:51:33 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>Output of Dynamic variable to next query</title><link>http://www.sqlservercentral.com/Forums/Topic1420029-338-1.aspx</link><description>Hi All,I have a table named tbl which contains 250 rowsI have a Varaible @CNT = SELECT count(*) from tblThen i have a query as Select top 10 * from tbl			Now i want to pass @CNT into second query. The output of Select top 10 * from tbl will be1	val12	val2.	..	..	.10	val 10But i want as 1	val1	250      2	val2	250.	..	..	.10	val 10	250 250 indicates the value of @CNT.Or is there any other way in which i can pass @CNT as a seperate field in SQL Server Reporitng Services RDLThanks in advance</description><pubDate>Thu, 14 Feb 2013 06:48:06 GMT</pubDate><dc:creator>jeganbenitto.francis</dc:creator></item></channel></rss>