Hi experts - i'm trying to update 1 columns with PART of the contents of another column.. in the same table.
Update [dbo].[KnownSQLServers]
Set ServerNameOnly = (SELECT SUBSTRING(ServerName,0, CHARINDEX('.',ServerName)) as 'new_name' from [dbo].[KnownSQLServers])
Gives error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Update [dbo].[KnownSQLServers]
Update [dbo].[KnownSQLServers]
Set ServerNameOnly = (
SELECT SUBSTRING(ServerName,0, CHARINDEX('.',ServerName)) as 'new_name' from [dbo].[KnownSQLServers])
so you want to rename all KnownSQLServers' ServerNameOnly column to the same value?