3

I would like to suggest we have page for how to present test data.

It would need to be product specific.

My object is to be able to run the data against proposed solution(s) with the least amount of overhead.

My answer will below better explains my suggestion.

If you disagree fine you can comment or down vote.

3

This is a people problem, not a technical problem.

You can't force people to do things a specific way without a LOT of hand-coding.

What you can do is to go and edit people's posts for them to help them out.

That's the only valid solution in this case.

It's just not reasonable to expect people to format just like you want it. Imagine if I1 made it a site-rule1 that you had to comma-first or comma-last. That would piss half of everyone off, no matter which way I went.

1hahahahahahahaha like I have any power here. This is a user run community. My job is as a janitor. That's it.

  • 1
    My thought is not to force them but give them guidelines if they are willing. Cannot give them a guideline if you don't have one. – paparazzo Mar 6 '18 at 18:08
  • And like Aaron said, we've tried to convince people for a thousand internet years to please format things consistently. We even have things like Markdown. And they still can't do it. This isn't a technology problem, this is a people problem. Either they will be motivated to do so or they won't. Also, the network isn't really primed for "custom education on formatting topics" as it's niche. I agree having a style guide is nice, but let's just use one off-site and get the regulars (via chat?) to reference that in their pre-made-comments apps. – jcolebrand Mar 6 '18 at 18:10
  • I don't follow but I don't want it to appear as I am arguing – paparazzo Mar 6 '18 at 18:22
  • Wanting to understand is fine, I don't mind. Which part is difficult for you to follow? – jcolebrand Mar 6 '18 at 18:23
1

It is great that we get test data from users but it is rarely formatted for easy testing.

In the case of SQL Server you have:

  • ad hoc matrix

    ID| Item  
    1 | Hat  
    2 | Coat  
    3 | Jacket 
    
  • #temp

    create table #t (pk int identity primary key, id char(1), col1 char(1), col2 char(1), col3 char(1), col4 char(1), col5 char(1));
    insert into #t (id, col1, col2, col3, col4, col5) values
                   ('g', 'a', 'b', 'c', 'd', 'e')
                 , ('g' ,'j', 'k', 'l', 'm','n')
                 , ('g' ,'a' ,'b' ,'c' ,'d' ,null)
                 , ('g', 'x', 'y', NULL, NULL, NULL)
                 , ('g', 'x', 'z', 'w', NULL, NULL)
                 , ('g', 'J', NULL, NULL, NULL, NULL)
                 , ('q', 'a', 'b', NULL, NULL, NULL)
                 , ('q', 'x', 'z', 'v', NULL, NULL);
    select * from #t;
    drop table #t;
    
  • table variable

    declare @t table (pk int identity primary key, id char(1), col1 char(1), col2 char(1), col3 char(1), col4 char(1), col5 char(1))
    insert into @t (id, col1, col2, col3, col4, col5) values
                   ('g', 'a', 'b', 'c', 'd', 'e')
                 , ('g' ,'j', 'k', 'l', 'm', 'n')
                 , ('g' ,'a' ,'b' ,'c' ,'d' ,null)
                 , ('g', 'x', 'y', NULL, NULL, NULL)
                 , ('g', 'x', 'z', 'w', NULL, NULL)
                 , ('g', 'J', NULL, NULL, NULL, NULL)
                 , ('q', 'a', 'b', NULL, NULL, NULL)
                 , ('q', 'x', 'z', 'v', NULL, NULL);
    

I happen to prefer table variable as it cleans up more easily. For some stuff you need #temp to evaluate indexes, etc.

I am happy to use #temp if that is what is presented.

The ad hoc matrix is easier to read but takes time to load.

Can run a select on the table for typically nice results.

pk          id   col1 col2 col3 col4 col5
----------- ---- ---- ---- ---- ---- ----
1           g    a    b    c    d    e
2           g    j    k    l    m    n
3           g    a    b    c    d    NULL
4           g    x    y    NULL NULL NULL
5           g    x    z    w    NULL NULL
6           g    J    NULL NULL NULL NULL
7           q    a    b    NULL NULL NULL
8           q    x    z    v    NULL NULL

Queries please always include the table. table.column

select t1.pk, t1.id, t1.col2 
     , t2.col3, t2.col4
from @t t1 
join #t t2 
  on t1.id = t2.pk 
drop table #t;
  • @AaronBertrand For now this does not have traction – paparazzo Mar 5 '18 at 0:24
  • I know. How would a new page get more traction? There's no shortage of ideas of what to tell people to do. The problem is putting it somewhere where they'll actually read it, and follow through. – Aaron Bertrand Mar 5 '18 at 0:29
  • Uh, can't help. All I can do it put it out and let it get voted up or down. – paparazzo Mar 5 '18 at 0:38
  • Well, you have a solution, but it's to the wrong problem. The problem is visibility, not a lack of guidelines. We can point people to Jon Skeet's blogs posts about this, to the help center, etc. But we don't. – Aaron Bertrand Mar 5 '18 at 0:39
  • @AaronBertrand Just trying to work in the system not define it. Not going to try and debate with you. – paparazzo Mar 5 '18 at 0:47
  • I'm not trying to debate with you. Just offering my input. That's why you posted the question, right? To get input? You can't say I only want the input I like. – Aaron Bertrand Mar 5 '18 at 5:35
  • @AaronBertrand I can say I am not going to debate it with you. I am not trying to fix viability with this post. – paparazzo Mar 5 '18 at 6:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .