Try UNION ALL between select statements. I used this the other day in a view to accomplish something similar. It would look something like this:
SELECT a,b,c
FROM table
UNION ALL
SELECT a,b,c
FROM table
Remember: (1) The number and the order of the columns must be identical in all queries...
THIS IS THE MAIN PROC:
CREATE PROCEDURE dbo.TestTableProc (@PropertyNumber int)
AS
BEGIN
declare @Premium table(
PropertyNumber int,
UnitNumber int,
Unit varchar(10),
Price int null,
Code varchar(20) null,
Description varchar(40) null...
I am using a table variable (as opposed to a temporary table) in a stored procedure. I am calling a cursor from within the proc and it updates the table variable. My problem is that I am being prompted to declare the table variable within the cursor - but I don't want to because it has already...
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.