functions

Use NEWID() inside function in SQL Server

In SQL Server, if we use the NEWID() function inside an user-defined function, it throws an error as “Invalid use of side-effecting or time-dependent operator in ‘newid()’ within a function.” For any reason, if we need to use the NEWID() function inside an user-defined function, we need to do some work around. In this post, […]

Use NEWID() inside function in SQL Server Read More »

Dynamic management views and functions in SQL Server

In this post named “Dynamic management objects in SQL Server”, we will explore the DMVs and DMFs in SQL Server. Dynamic management views (DMVs) and dynamic management functions (DMFs) are used to extract current internal information of the Server State using T-SQL commands. Formerly such types of data were only available in Performance Monitor (a Microsoft

Dynamic management views and functions in SQL Server Read More »

Deterministic and non-deterministic functions in SQL Server

In this topic “Deterministic and non-deterministic functions”, we are going to discuss the deterministic and non-deterministic functions in sql server. Lets start with “what is a deterministic function in sql server?”. It’s a common interview question also. I will elaborate the definition of deterministic as well as non-deterministic functions and also provide some good examples. So after

Deterministic and non-deterministic functions in SQL Server Read More »