使用交叉申请时出错 [英] Error using cross apply

查看:61
本文介绍了使用交叉申请时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次尝试使用交叉申请,并且每次尝试时都会出现错误。



如果我对这些值进行了硬编码,它的工作正常,如果我尝试使用表值(这是整点),我就会收到错误。



我尝试了什么:



- 当我硬编码这个值很好的时候我打电话给TVF

s

I'm trying to use cross apply for the first time, and keep getting an error everytime I try.

If I hard coded the values it works fine, If I try to use the table values (which is the whole point), I get the error.

What I have tried:

-- I'm calling a TVF when I hard code the values this works fine
s

elect prs.*
from cifa addr
	cross apply TVFParseSourceAddress('123 First Street',null,null,'Lake Mary FL 27344',null,null,null,null) prs





但是当我尝试使用表cifa中的值调用函数时,它会给我一个错误。 。附近的语法不正确。







but when I try to call the function using the values from table cifa, it gives me an error. Incorrect syntax near '.'


select addr.ADDRESS1, addr.ADDRESS2, addr.CITY_STATE_ZIP
from cifa addr 
    cross apply TVFParseSourceAddress(addr.ADDRESS1,null,null,addr.CITY_STATE_ZIP,null,null,null,null) prs







我假设因为它与硬编码值一起工作,不是TVF就是问题,但我对这个问题可能是什么感到难过




I'm assuming since it works with hard coded values that it's not the TVF that's the problem, but I am stumped as to what the issue could be

推荐答案

结果证明它是我数据库的兼容级别。我将它从80更新到100,现在工作正常



谢谢
Its turns out it was the compatibility level of my database. I updated it from 80 to 100 and it works fine now

Thanks


这篇关于使用交叉申请时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆