New answers tagged


To address the immediate question: Any reason why the convert function isn't working the way it should? The CONVERT function works with various types. What kind of conversion to apply is determined principally by the types specified by the first argument (explicitly) and the second argument (implicitly as the type of the expression). The presence of ...


Unless you are using SSMS to just present the dates, your presentation layer should handle the part of presenting the date in whatever format you want to display. I normally use the date-format help to find out the style :-) SELECT [borrower#], -- use square brackets when you have special characters in the output column name location, ...


Your parameter _source in the added MWE is not referenced anywhere. The identifier source in the function body has no leading underscore and is interpreted as constant table name independently. More importantly, it would not work like this anyway. SQL only allows to parameterize values in DML statements. Details in this related answer: Error when setting ...


Do I need to create a store procedure first that way the inputs are recognized? You are missing @ symbols at the beginning of each parameter. Find out more about writing functions here Once you know the basics this article by Jeremiah Peschka explains the benefits of inline functions and much more. Basically if your table valued function is not ...


Callbacks are totally against the idea behind SQL. It's designed as declarative language which queries describe the task and query optimizer builds composition of sorts, index seeks, merges, etc to meet the query. No any row-by-row processing by callbacks. Oracle supports overloading, with restrictions




want to set the CMS.DES to 'USD' when CMS.DES IS NULL else CMS.DES isnull(CMS.DES, 'USD') isnull


Yes. Failing to specify WITH SCHEMABINDING means SQL Server skips the detailed checks it normally makes on the function body. It simply marks the function as accessing data (as mentioned in the link given in the question). This is a performance optimization. If it did not make this assumption, SQL Server would have to perform the detailed checks on every ...

Top 50 recent answers are included