SQL Functions in Azure

  • BOR15K

    SSCertifiable

    Points: 5748

    I am not familiar with Azure, hence my question below might sound cretinoid.
    We use SQL Server 2014 and our company has made a decision to move to Azure within 6 months. I tend to write my code without adding schema and let customer's DBA's to deal with it.
    But when it comes to functions, they must have schema, e.g. 

    DECLARE @v_xml XML

    SELECT @v_xml = dbo.MyFunction (set of params)
     

    Will it work on Azure or perhaps we shall take some steps already, whilst developing our SQL code, please?

    Much appreciated.

  • Joe Torre

    SSChampion

    Points: 10225

    Schema qualifying in your t-sql code is a best practice. I recommend getting into the the habit of specifying the schema in all your SQL.

  • Grant Fritchey

    SSC Guru

    Points: 395316

    100% agreement with Joe. You should be following best practices and writing the code correctly including object ownership. However, Azure SQL Database is SQL Server. If you have a valid (if poorly written) T-SQL statement that works in SQL Sever 2014, it'll work in Azure SQL Database.

    ----------------------------------------------------
    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
    Theodore Roosevelt

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

  • BOR15K

    SSCertifiable

    Points: 5748

    Grant Fritchey - Friday, December 14, 2018 1:43 AM

    100% agreement with Joe. You should be following best practices and writing the code correctly including object ownership. However, Azure SQL Database is SQL Server. If you have a valid (if poorly written) T-SQL statement that works in SQL Sever 2014, it'll work in Azure SQL Database.

    I could agree with you if I was in a position to force / dictate the ownership to the customers.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply