How to add dummy Data in a sql server table
How to add dummy Data in a sql server table
1) Write Query that will insert data in a table
INSERT [dbo].[Ads] ( [ReferenceNumber], [AdName], [AdDescription], [City_Id], [Model_Id], [Year], [TransmittionType], [Color], [FuelType], [RegionalSpecs], [MortgageDetails], [AskingPrice], [MileageKM], [IsFeatured], [Account_Id], [AdStatus_Id], [TicketsQuantity], [RemainingTicketsQuantity], [CreatedDate], [ExpiryDate], [TicketPrice], [AboutWarrenty], [BodyType], [ServiceHistory], [DeleteReason], [MulkiyaFrontURL], [MulkiyaBackURL], [OwnershipDocumentURL], [OwnershipType], [IsUserFavouirte]) VALUES (N'WD-1492555', N'Audi for sale', N'Description', 2, 432, 2010, N'Automatic Transmission', N'Silver', N'Diesel', N'Japanese Specs', NULL, CAST(10000.00 AS Decimal(18, 2)), 123, 1, 133, 1, 600, 598, CAST(0x0000A8CB01187186 AS DateTime), CAST(0x0000A8D2013A36E0 AS DateTime), CAST(25.00 AS Decimal(18, 2)), N'Yes', N'Sports Car', 1, NULL, NULL, NULL, N'6366006006380526061.pdf', N'otherOwnershipDoc', NULL)
2) Create a while loop that will repate that query
DECLARE @i int = 0
WHILE @i < 20
BEGIN
SET @i = @i + 1
/* do some work */
END
3) merg result will be below
DECLARE @i int = 0
WHILE @i < 20
BEGIN
SET @i = @i + 1
/* do some work */
INSERT [dbo].[Ads] ( [ReferenceNumber], [AdName], [AdDescription], [City_Id], [Model_Id], [Year], [TransmittionType], [Color], [FuelType], [RegionalSpecs], [MortgageDetails], [AskingPrice], [MileageKM], [IsFeatured], [Account_Id], [AdStatus_Id], [TicketsQuantity], [RemainingTicketsQuantity], [CreatedDate], [ExpiryDate], [TicketPrice], [AboutWarrenty], [BodyType], [ServiceHistory], [DeleteReason], [MulkiyaFrontURL], [MulkiyaBackURL], [OwnershipDocumentURL], [OwnershipType], [IsUserFavouirte]) VALUES (N'WD-1492555', N'Audi for sale', N'Description', 2, 432, 2010, N'Automatic Transmission', N'Silver', N'Diesel', N'Japanese Specs', NULL, CAST(10000.00 AS Decimal(18, 2)), 123, 1, 133, 1, 600, 598, CAST(0x0000A8CB01187186 AS DateTime), CAST(0x0000A8D2013A36E0 AS DateTime), CAST(25.00 AS Decimal(18, 2)), N'Yes', N'Sports Car', 1, NULL, NULL, NULL, N'6366006006380526061.pdf', N'otherOwnershipDoc', NULL)
/**/
END
Share This with your friend by choosing any social account
Your Comments
You may also read following recent articles
|
Top Software Testing Trends in 2023!
01-Feb-2023 53 |
![]() |
How To Make Money on YouTube in 2023!
31-Jan-2023 34 |
![]() |
The 6 Best Entry-Level Sales Jobs To Start Your Career!
31-Jan-2023 20 |
![]() |
Affiliate Marketing Program for Beginners!
31-Jan-2023 5 |
|
Top 20 Best Test Management Tools New 2023 Rankings!
31-Jan-2023 60 |
![]() |
23 Things To Do After High School!
30-Jan-2023 26 |
![]() |
Google, Meta, Amazon: Who Was Impacted by 2023 Tech Layoffs!
30-Jan-2023 19 |
![]() |
Can Earth change its direction rotation?!
30-Jan-2023 22 |
![]() |
How to Mine Crypto on Android?!
30-Jan-2023 31 |
![]() |
How to Use Competitive Intelligence to Grow Your Business?!
30-Jan-2023 28 |
![]() |
How do I get Google traffic data?!
28-Jan-2023 13 |
![]() |
How to get free traffic from Quora?!
28-Jan-2023 25 |