I still have problems.
DECLARE @SQLString nvarchar(2000),
@paramList nvarchar(1000),
@RtnCount int
SET @SQLString = N'SELECT @RtnCount = COUNT(t1.PersonsID) FROM @thisTable t1
INNER JOIN Students
ON Students.PersonID = t1.PersonID
WHERE Students.StudentsID...
declare @table varchar(20),
@stmt varchar(200),
@count int
set @table = 'Persons'
set @stmt = N'select ' + QUOTENAME(@count) + ' = count(*) from [' + @table + ']'
execute (@stmt)
Can you tell why this script outputs no error, no result?
Bloomberg
Thanks for helping me. It works.
One more thing,
declare @table varchar(20),
@stmt varchar(200),
@count int
set @table = 'Persons'
set @stmt = 'select @count = count(*) from [' + @table + ']'
execute (@stmt)
I want the @count holding the number of records.
Thanks again...
declare @table varchar(20)
set @table = 'Persons'
select count(*) from "@table"
Hi,
Would you please tell me why the above script gave me an error meassage of Must declare the variable '@table'?
How can I improve it?
Thanks alot.
Bloomberg
Hi,
CRXI on SQL Server 2005
I have a report with invisible sup reports. Values on the main report should act as hyperlinks to sub reports. For example, a value displayed in main report as follows,
EligibleRules
Clicking it should show the detailed information on sub report.
Is it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.