473,572 Members | 3,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cross / Outer Apply

1 New Member
I am passing a bunch of parameters to my stored proc. The following query uses a few of those parameters alongwith a column value from the outer table using cross apply. I get a compilation error "Incorrect Syntax near B1". this is in the From Clause. Please note that it is the last parameter in the function call

Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2.              ContractId = @ContractId, BusinessUnitId = B1.BusinessUnitId, B1.ServiceId, B1.CampaignId, 
  3.               TotalCount = F1.TotalCount,            
  4.               EligibleCount = F1.EligibleCount,
  5.               UnitPrice = F1.UnitRate,
  6.               TotalPrice = Convert(decimal(20,10),0.00),
  7.               BusinessUnitExpenseId = NULL,
  8.               IsFixed = CONVERT(bit,'False'),
  9.               FixedAmtDealType = CONVERT(varchar(3),''),
  10.              ShowFixedAmtDealType  = @ShowFixedAmountWithDealType
  11. INTO 
  12.               #TempAccountDetails 
  13. FROM            
  14.               BusinessUnitAccountingSummaryData AS B1 
  15.               CROSS APPLY dbo.func_GetServiceContractFigures(@StartDate, @EndDate, @Service, @BUId, B1.CampaignId) AS F1            
  16. WHERE
  17.               B1.ServiceId = @Service
  18.               AND B1.BusinessUnitId = @BUId
  19.               AND B1.Date BETWEEN @ContractStartDate AND @ContractEndDate            
  20. GROUP BY B1.ServiceId, B1.CampaignId, B1.BusinessUnitId
Mar 26 '08 #1
0 1613

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2040
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics, manifolds, science, physics, chemistry, law, legal, government, home, office, business, domain lookup, medical, travel, food, university students, searching,...
2
2233
by: Preston Landers | last post by:
Hello all. I am trying to write a query that "just" switches some data around so it is shown in a slightly different format. I am already able to do what I want in Oracle 8i, but I am having trouble making it work in SQL Server 2000. I am not a database newbie, but I can't seem to figure this one out so I am turning to the newsgroup. I...
0
1875
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics, manifolds, science, physics, chemistry, law, legal, government, home, office, business, domain lookup, medical, travel, food, university students, searching,...
7
31541
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins" slows the system down considerably. I've tried creating a temp db, but I can't figure out how to execute two select commands. (It throws the exception...
0
2047
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics, manifolds, science, physics, chemistry, law, legal, government, home, office, business, domain lookup, medical, travel, food, university students, searching,...
9
1851
by: MariusI | last post by:
Consider the following class layout public class Order { public ProductOrder AddProductOrder(/* variables required to create a product order */) { /* Check if the product order can be added to the order */ }
7
3047
by: Stephen Poley | last post by:
I have the following situation: - a table of employees, keyed on employee-id; - a table of training sessions, keyed on session-id; - a requirement to log who was present at which session, plus optional extra textual information (e.g. "left early due to illness"). The solution I had in mind was: 1) create a presence table, keyed on...
0
1309
by: anurag_agrawal | last post by:
Hi this i anurag, right now i am working on report genration project. I have a result set which returns me some records depend upon the EmployeeId and startdate and enddate this i passed to a stored procedure. Its a kind of weekly report which list employee data which is entered by him daily. Currently it returns me rows only for the days...
1
2422
by: Henry J. | last post by:
Is it true that the following query: SELECT emp.empno, emp.lastname, dept.deptname FROM emp LEFT OUTER JOIN dept ON emp.workdept = dept.deptno WHERE emp.salary 50000.00; will run faster in general if rewritten as: SELECT emp.empno, emp.lastname, dept.deptname
0
7733
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7957
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7705
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5248
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3685
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1240
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.