Deprecated feature 'String literals as column aliases is not supported in this version of SQL Server'

Return to previous page

  • 4/7/2015
  • 2926 Views

Comments

2926 Views

Deprecated feature 'String literals as column aliases is not supported in this version of SQL Server'

Last updated 4 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 
This error occurs in SQL Azure because of deprecated syntax.

Error
It normally appears in SQL such as this:


select
dnn_Announcements.ItemID,
dnn_Announcements.ModuleID,
dnn_Announcements.Title,
case when dnn_Files.FileName is null then dnn_Announcements.URL else dnn_Files.Folder + dnn_Files.FileName end as Url,
dnn_Announcements.ExpireDate,
dnn_Announcements.Description,
'CreatedByUser' = dnn_Users.FirstName + ' ' + dnn_Users.LastName,
dnn_Announcements.CreatedDate,
dnn_Announcements.ViewOrder,
dnn_UrlTracking.TrackClicks,
dnn_UrlTracking.NewWindow
from dnn_Announcements


Cause

The error occurs in the usage in this string:
'CreatedByUser' = dnn_Users.FirstName + ' ' + dnn_Users.LastName,

This syntax is no longer supported ; use 'AS name' instead

Fix

Change the literal column renaming to use the 'AS' syntax.
dnn_Users.FirstName + ' ' + dnn_Users.LastName as CreatedByUser,
Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out