1

I'd like to try and gauge my users internet speeds based on the downloading of a dataset of known size (1MB).

Using T-SQL only, how can I quickly create a table with exactly 1MB of data in it?

I want to be able to run EXEC sp_spaceused N'dbo.myTableName to verify data size.

Dale K
  • 25,246
  • 15
  • 42
  • 71
ericOnline
  • 1,586
  • 1
  • 19
  • 54
  • 1
    You mean like a table with a `VarChar(max)` column and a single row containing 1MB of data? – HABO Apr 23 '19 at 00:58
  • https://learn.microsoft.com/en-us/sql/t-sql/functions/replicate-transact-sql?view=sql-server-2017 - REPLICATE might be useful. Pay attention to the note. Also consider a CTE and/or a 'numbers table' (easy to add 'N rows', eg). – user2864740 Apr 23 '19 at 00:59
  • 1
    there are lots of other way to determine the internet speed. This is not a good way. – Squirrel Apr 23 '19 at 02:33
  • Hi @HABO, Yes, that would work. I do like user2864740's idea of a numbers table. Squirrel, not in PowerApps there isn't ! – ericOnline Apr 23 '19 at 14:45
  • Possible duplicate of [What is the best way to create and populate a numbers table?](https://stackoverflow.com/questions/1393951/what-is-the-best-way-to-create-and-populate-a-numbers-table) – recnac Apr 28 '19 at 01:17

1 Answers1

0

The SO search keywords ended up being Numbers Table. Searching for this term, I found a great post. Closing this as duplicate of: What is the best way to create and populate a numbers table?

I think i'm going to move a different direction for my use case with

fsutil file createnew C:\Desktop\testFile.png 1000000

ericOnline
  • 1,586
  • 1
  • 19
  • 54