Choosing a MySQL statement in SQL Server

I am converting mysql sprocs to SQL Server. I came across a select statement in mysql that I don’t quite understand what it is doing and my google-fu / so-fu failed. Here is its essence:

    SELECT AccountType = dbo.functionToGetAccountType() FROM AccountLookup

I have no way to debug the original mysql. I know that a function returns only one value.

Is the mysql statement the default "AccountType" if there are no rows in the AccountLookup table?

Thank you for your time.

+3
source share
1 answer

The select statement executes the function dbo.functionToGetAccountType()and aligns the column as AccountType. It can be rewritten as follows:

SELECT dbo.functionToGetAccountType() as AccountType
FROM AccountLookup 
+5
source

All Articles