I need to make the string/varchar variable with value 20061212 to be string/varchar value 2006-12-12 00:00:00
I can’t find the right SQL syntax code to make it happened in SQL Server.
The code can be created as stored procedure or similar in SQL Server.
You could cast your string to a DATETIME and then convert it back to a string in your chosen format. But that would likely be slower than this more explicit option.