Hello, I have a SQL Server 2000 and receive an error message when calling a function within a execute statement. I'm not sure if you can call a function
within an execute statement but I would think I would just receive an error message and it wouldn't crash my server. I had to restart the server for anyone to access it. Below is my query I ran from query analyzer and the error message it produces.
I'm going to rewrite my sql to not use UFYearMonth but would fell better knowing why this happened.
Thanks
exec('update a1 set a1.AmountEntity2 = a2.AdjustedAmount
from #tmpDetail a1 join
(select acType,sum(t1.amount* t3.BalanceSheetFactor) as AdjustedAmount from ledger t1
JOIN ConversionRates t3 ON dbo.UFYearMonth(t1.tdate) = t3.ACPeriod AND t1.CurrencyTypeID = t3.CurrencyTypeID
AND t3.BaseCurrencyTypeID = 1
left join lstAccountCodes t2 on t1.Accode = t2.Accode
' + @sWHERE + ' group by t2.acType) a2 on a1.acType = a2.acType')
Server: Msg 11, Level 16, State 1, Line 0
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error.
Check your network documentation.
Server: Msg 10060, Level 16, State 1, Line 0
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
(PreLoginHandshake()).
within an execute statement but I would think I would just receive an error message and it wouldn't crash my server. I had to restart the server for anyone to access it. Below is my query I ran from query analyzer and the error message it produces.
I'm going to rewrite my sql to not use UFYearMonth but would fell better knowing why this happened.
Thanks
exec('update a1 set a1.AmountEntity2 = a2.AdjustedAmount
from #tmpDetail a1 join
(select acType,sum(t1.amount* t3.BalanceSheetFactor) as AdjustedAmount from ledger t1
JOIN ConversionRates t3 ON dbo.UFYearMonth(t1.tdate) = t3.ACPeriod AND t1.CurrencyTypeID = t3.CurrencyTypeID
AND t3.BaseCurrencyTypeID = 1
left join lstAccountCodes t2 on t1.Accode = t2.Accode
' + @sWHERE + ' group by t2.acType) a2 on a1.acType = a2.acType')
Server: Msg 11, Level 16, State 1, Line 0
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error.
Check your network documentation.
Server: Msg 10060, Level 16, State 1, Line 0
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
(PreLoginHandshake()).