Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rows unbounded preceding in sql server 11

Status
Not open for further replies.

whatsthehampton

Programmer
Sep 13, 2005
121
CA
Hi Guys,

I'm using this sproc in sql server 12 locally.

CODE -->
ALTER PROCEDURE [dbo].[Admin_Metrics_GetApplicationsByJobID]

(
@JobID int
)

AS

SET NOCOUNT ON

select

uniqueappid,

cast(a.appdate as datetime) as xdate ,
sum(appcounter) over (order by appdate rows unbounded preceding) as cumulativeapps,
(u.uFirstName + ' ' + u.uFamilyName) as x2name

from tbl_Applications a
INNER JOIN tbl_MD_userDetails u
ON
a.UserID=u.UserID

where jobid=@JobID AND astatus > 0
group by a.appdate, a.appcounter,a.uniqueappid, (u.uFirstName + ' ' + u.uFamilyName)
order by xdate;

RETURN

However my remote server is version 11 and this code appears not to work - I guess the highlighted line.
Does anyone know what I could use in place for sql 11 please?
It's used for a chart that shows a running order of job applications in a line chart.

Cheers,

Jack
 
1. Use TGML - look around where you post threads, and there are instructions. In this case, use the [ignore]
Code:
[/ignore] tags.
2. Highlighted? Where? Again - TGML tags will help you here. And now you can use the highlight menu item instead of typing the TGML codes.

If you've got something running fine on one version of SQL (just like any other application), in this case version 12, but it will not run without error on a prior version, the first thing to check is whether you're using a new function/method/procedure. We cannot see what line is highlighted, so I just have to guess at it. I'm not reading your unformatted code and guessing.

Next thing I'd check if no difference between versions is whether you've got this setup to run correctly against a remote SQL Server. When you say remote, I assume you mean you have a local instance of SQL Server 12 and a remote instance of SQL Server 11, both using the same Windows credentials, network, etc, but that SQL is having to make the remote connection.

And now thinking about the remote piece... it could very well be that you need to fully qualify your objects. Fully qualifying objects, such as tables, is always a good idea, and a good thing to practice. I see tbl_MD_userDetails has no qualifications.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top