Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.
Insert into TblSource (oldTableName) Select Name From sys.tables Where type_desc ='USER_TABLE' AND (Name like 'emp%') Declare @ID int , @srcTblName nvarchar(50) , @country varchar(3) , @desTblName varchar(50) , @loopCntr int Set @loopCntr = @@ROWCOUNT While @loopCntr <> 0 Begin Set @ID = ( Select ID From TblSource Where ID = @loopCntr ) Set @srcTblName = ( Select oldTableName From TblSource Where ID = @ID) Set @Country = ( Select Country From tblCountry Where C_Abr = ( CASE substring(@srcTblName,6,2) WHEN 'U' THEN 'US' WHEN 'U' THEN 'UK' END)) Set @desTblName = RIGHT(@srcTblName,LEN(@srcTblName) --don't pay much attention to this formula, imagin it works fine and return correct name. Update TblSource Set Country = @Country , desTblName = @desTblName Where ID = @ID Set @ID = (Select ID From TblSource Where oldTblName = 'employee') set @srcTblName =(Select oldTblName From TblSource Where ID = @ID ) If (@ID <> '') Begin Insert Into @desTblName ( location_ID, [country], [Active]) Select Distinct (s.location) ,@Country 1 From (Select oldTblName From TblSource Where ID = @ID) AS s --@srcTblName -- End End set @loopcntr = @loopcntr -1 END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|MS SQL page split per second is high||19||136|
|why sql server only update some statistics in the database ?||3||45|
|Backing up Large SQL Server VM Best practice [using Veeam Backup]||8||63|
Join the community of 500,000 technology professionals and ask your questions.