Skip to content

Instantly share code, notes, and snippets.

@waldyrfelix
Created November 8, 2011 17:46
Show Gist options
  • Save waldyrfelix/1348509 to your computer and use it in GitHub Desktop.
Save waldyrfelix/1348509 to your computer and use it in GitHub Desktop.
Preenchimento das tabelas para teste
-- inserindo categorias
insert into categoria (nome) values ('categoria ')
go 2000
-- inserindo produtos até demais...
declare @i int = 0
while @i < 100000
begin
insert into produto (nome, preco, categoria_id)
values ('produto '+ CONVERT(varchar, @i), @i + 23.2, (@i % 1000) + 1)
set @i = @i + 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment