Skip to content

Instantly share code, notes, and snippets.

@swaters86
Created October 30, 2014 16:07
Show Gist options
  • Save swaters86/0da9b6efea7450a0ef48 to your computer and use it in GitHub Desktop.
Save swaters86/0da9b6efea7450a0ef48 to your computer and use it in GitHub Desktop.
set nocount on
declare @ASite varchar(2)
select *
from web.dbo.profile (nolock)
where Avis='zz' and profile_id=1030377
declare sitecodes cursor scroll for
select avis from web.dbo.siteinfo (nolock)
open sitecodes
fetch first from sitecodes into @ASite
while @@fetch_status = 0
begin
print 'Inserted Convenience Profile ID for site: ' + @ASite
insert into
webextras.dbo.Profile_ExtraFields (Avis,ProfileID,Varname,VarValue)
values (@ASite,1030377,'ActualAPProfile','1030377')
fetch next from sitecodes into @asite
end
close sitecodes
deallocate sitecodes
set nocount off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment