Hello,I have 4 tables: Folders, Files, Tags and FilesTags.I need to insert some dummy data for testing as follows:1. Insert 100 records in Tags tables. Give Tag 01, Tag 02, Tag 03, ... to Tag names. For this I have the following: declare @i integer select @i = 1 while @i <= 100 begin insert into Tags ([text]) select 'Tag ' + right('000' + convert(varchar(3), @i), 3) select @i = @i + 1 end What I am missing is the following:2. Insert 10 records in Folders tables. Each folder should be filled as follows: FolderID = New Guid Name = "Name" + N (1, 2, 3, ...) CreatedDate = Current Date3. For each Folder I want to insert a random number of Files. It can be added 0 to 10 Files. Each file should be filled as follows: FileID = New Guid FolderID = Folder ID Description = "Description" + Folder Number + File Number4. For each file added associate it with a random number of Tags. It can be 0 to 10 Tags and it should be done as follows: Insert record in FilesTags where: TagID = Random TagID taken from table Tags That has still not be used in current File FileID = Current FileIDCould someone, please, help me doing this?My tables are as follows: create table dbo.Tags( TagID uniqueidentifier not null constraint PK_Tag primary key clustered, [Name] nvarchar(200) not null)create table dbo.Folders( FolderID uniqueidentifier not null constraint PK_Folder primary key clustered, CreatedDate datetime not null, [Name] nvarchar(200) null)create table dbo.Files( FileID uniqueidentifier not null constraint PK_File primary key clustered, FolderID uniqueidentifier not null, Description nvarchar(2000) null, constraint FK_Files_Folders foreign key(FolderID) references dbo.Folders(FolderID) on delete cascade, )create table dbo.FilesTags( FileID uniqueidentifier not null, TagID uniqueidentifier not null, constraint PK_FilesTags primary key clustered (FileID, TagID), constraint FK_FilesTags_Files foreign key(FileID) references dbo.Files(FileID) on delete cascade, constraint FK_FilesTags_Tags foreign key(TagID) references dbo.Tags(TagID))
Thank You,Miguel