Category: SQL

S

Sitecore: Value cannot be null. Parameter name uri

While working on Sitecore off late I have had my content authors complain about the Workbox not working and user was unable to expand a specific folder in the Content Tree. Here is Sitecore error observed in the logs: Exception: System.ArgumentNullException Message: Value cannot be null. Parameter name: uri Source: Sitecore.Kernel at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String ...

T

T-SQL equivalent for NEXT_DAY() of ORACLE

I thought of creating a simple function for this operation, in T-SQL. Function Name: Next_Day Input Params: @FromDate - Date from which you wish to get the next day; @DayNumber - Day of week for which you wish to get the next day (6=>Saturday, 7=>Sunday) Operation: SELECT dbo.Next_Day(GETDATE(),6) //Returns the next Saturday (6) from today Function: Function body ...

C

Convert a comma separted list to a table in SQL

I thought of sharing this simple function that you can use for splitting a list or nvarchar(max) or anything that is coma separated and sent to DB, into a temp table. Reason: Performance is a bottle neck for us. As for that matter, for any SP executions. We cannot live with the IN operator. It ...

E

Encrypting and Decrypting passwords in SQL server

We have come across scenarios wherein highly sensitive information like passwords being stored in our database. It is a highly likely chance that during SQL Injection or unprecedented attacks, these table values gets exposed. I will explain here a simple means of encrypting, followed by decrypting the same password for user authentication. But let me ...