December 31, 2011 at 12:32 pm
hi Guys,
I need a db with at least 200,000 sample addresses. Which sample db in Sql Server 2008 has the most number of addresses? If it is bigpubs2008, where can I download the db from?
Thanks!
December 31, 2011 at 2:53 pm
Why not build your own table. For example:
CREATE TABLE #Address(Id INT IDENTITY(1,1),Address VARCHAR(50));
DECLARE @N INT
SET @N = 1
WHILE @N < 100
BEGIN
INSERT INTO #Address(Address)
SELECT CAST(@N AS VARCHAR(10)) + ' Maden Lane Clevland Ohio' UNION ALL
SELECT CAST(@N AS VARCHAR(10)) + ' Walnut Ave Clevland Ohio' UNION ALL
SELECT CAST(@N AS VARCHAR(10)) + ' Ghanta Street Timbucktwo Alabama'
SET @N = @N + 1
END
SELECT * FROM #Address ORDER BY Id DESC
-- Clean up after testing
DROP TABLE #Address
--Now if you just require unique values for the address and not
--something that can be read as an address by a person
-- try this
CREATE TABLE #T(Address VARCHAR(40),Id INT IDENTITY(1,1))
DECLARE @myid uniqueidentifier
DECLARE @Count INT
SET @Count = 1
WHILE @Count < 10001 --Set for desired number of rows
BEGIN
SET @myid = NEWID()
INSERT INTO #T(Address)
SELECT SUBSTRING(CONVERT(varchar(255), @myid),1,40)
SET @Count = @Count + 1
END
--To verify and check results
SELECT COUNT(Address) FROM #T
SELECT Address FROM #T WHERE ID > 9900
-- DROP TABLE #T
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply