April 20, 2016 at 5:51 am
Eirikur Eiriksson (4/20/2016)
Phil Parkin (4/19/2016)
Ed Wagner (4/19/2016)
SQLRNNR (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?Do it!
Are you thinking something along the lines of this? Full credit to Eirikur for the query - it's all him.
* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)') AS VERSION_NAME;
Now where's that apostrophe gone? Eirikur, you need to fix this.
Sorry about that, here's a quick spelling correction
😎
/* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(7)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
STUFF((
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)'),DATALENGTH(@version_string) ^ 4,0,CHAR((POWER(3,DATALENGTH(@VERSION_STRING)) & 0x28) - 1)) AS VERSION_NAME;
GO
Edit: Typo
I apologise in advance for what I am about to say. In my spare time, I'm a proofreader and that probably explains some things. Forgive me, but ...
... your apostrophe is in the wrong place. There is more than one fool (we know that's true, based on empirical evidence from just this site, right?), therefore it's Fools' 🙂
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
April 20, 2016 at 6:13 am
SQLRNNR (4/19/2016)
Personally, this strikes me as more interesting!
/* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(max) = 0x6E7976777926807C71767771798078697977337C35778938398D3B8B8F80408F9594848597949C8E9B978F929293A2A5A05253A19A9AA6999E9FA05CA1B0A4B261A3;
--DECLARE @VERSION_STRING VARBINARY(max) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(MAX)') AS VERSION_NAME;
GO
HA!
April 20, 2016 at 6:20 am
Ed Wagner (4/20/2016)
GilaMonster (4/20/2016)
Ed Wagner (4/19/2016)
SQLRNNR (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?Do it!
Are you thinking something along the lines of this?
No, I was thinking more something like
SELECT a.article_id, a.title, SUM(ISNULL(av.page_views)) AS TotalViews
FROM articles a OUTER JOIN article_views av on articles.article_id = article_views.article_id
WHERE latest_comment IS NULL
GROUP BY article_id
ORDER BY page_views DESC;
Looks legit at a first glance. If someone doesn't know SQL it's near-impossible to see where the errors are, but will not run.
Kind-of a pseudo-code using SQL syntax. More along the lines of showing the logic without giving the answer. I don't know if it would illicit the normal "that won't run. please fix." comment or if it would help them see what you're trying to say.
Probably neither. Since he doesn't appear to be testing (or even have tables created), he wouldn't notice all the errors in it, and would probably submit it as-is. But I suspect he won't be back, too much work required here.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 20, 2016 at 6:29 am
Phil Parkin (4/20/2016)
I apologise in advance for what I am about to say. In my spare time, I'm a proofreader and that probably explains some things. Forgive me, but ...... your apostrophe is in the wrong place. There is more than one fool (we know that's true, based on empirical evidence from just this site, right?), therefore it's Fools' 🙂
Thanks Phil, always trying to improve my broken English;-)
😎
So finally we have the correct output
/* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(7)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
STUFF((
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)'),CONVERT(INT,FLOOR(REVERSE(DATALENGTH(@version_string)) / CEILING(SQRT(DATALENGTH(@version_string)))),0)
,0
,CHAR((POWER(3,DATALENGTH(@VERSION_STRING)) & 0x28) - 1)) AS VERSION_NAME;
GO
April 20, 2016 at 8:19 am
Ed Wagner (4/19/2016)
SQLRNNR (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?Do it!
Are you thinking something along the lines of this? Full credit to Eirikur for the query - it's all him.
* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)') AS VERSION_NAME;
Arg! There's a begininator in this code
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 20, 2016 at 8:32 am
Personally, I think this would be the most useful for the OP:
/* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(MAX) = 0x666377247978767F6E2A6C803C3D7B8376808281817B42687E8D4A658F8A8D88419B8F8D8D8D474863A19C9190A2925F94A5A7A698656E9E59A69CA1695EABAEB5B7A8ACB5BDBABABBBC79ADB67DC2B1BA888674CACFCEC4C9C0CAC37DC7C3D4D5D991DACAC7D3DADDACD0CFE19FA4E9E092;
/* Inline Tally for parsing the binary string */
WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2, T T3)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(MAX)') AS VERSION_NAME;
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 20, 2016 at 9:34 am
Probably yes, if manufacturers fool consumers into believing that whatever certificate UL issues means their product is safe. I think it's probable that the UL standard is about using secure protocols and minimum privilege (if it even covers that much) and not about hardware issues like the rowhammer hole and resulting exploits which apply to both DDR3 and DDR4 ram, so to probably to many of the things in the iot; and of course rowhammer drives a bus through minimum privilege since manipulation of writable rows in RAM can be so organised as to alter bits in unreadable (let alone unwritable) rows, and protecting against it is a rather interesting problem. (Latest rowhammer discoveries are in A New Approach for Rowhammer Attacks published a week ago by Rui Qiao (research student at Stony Brook U) and Mark Seaborn of Google.) Google has on at least two occassions modified Chrome to eliminate rowhammer-based exploits. And the real bad news is that it looks as if the GNU C Library (and hence Linux and anything else that uses it) is vulnerable. There is a risk that UL, now that it has changed from a non-profit to a for-profit outfit, will not want to spend a lot on keeping up with this kind of bleeding edge security research so things like this may slip through without being checked in their certification process. And we know from experience that banks will happily lie through their teeth about the security or otherwise of their credit cards and debit cards and ATMs and claim that there stuff is certified as safe and secure because it conforms to whatever their latest totally useless pseudo-security rubbish is, so if the UL security certificate is as useful as the banks stuff we can expect manufacturers to swear it's a guarantee of utter security and do their best to convince the courts to absolve them of all liability because they hold that certificate.
Tom
April 20, 2016 at 9:51 am
WayneS (4/20/2016)
Personally, I think this would be the most useful for the OP:
/* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(MAX) = 0x666377247978767F6E2A6C803C3D7B8376808281817B42687E8D4A658F8A8D88419B8F8D8D8D474863A19C9190A2925F94A5A7A698656E9E59A69CA1695EABAEB5B7A8ACB5BDBABABBBC79ADB67DC2B1BA888674CACFCEC4C9C0CAC37DC7C3D4D5D991DACAC7D3DADDACD0CFE19FA4E9E092;
/* Inline Tally for parsing the binary string */
WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2, T T3)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(MAX)') AS VERSION_NAME;
That's a very nice way of restating the old RTFM directive from many moons ago.
April 20, 2016 at 10:13 am
WayneS (4/20/2016)
Ed Wagner (4/19/2016)
SQLRNNR (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?Do it!
Are you thinking something along the lines of this? Full credit to Eirikur for the query - it's all him.
* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)') AS VERSION_NAME;
Arg! There's a begininator in this code
Down with the begin-inator!!
edit: fixed quote bug
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 20, 2016 at 11:46 am
WayneS (4/20/2016)
Ed Wagner (4/19/2016)
SQLRNNR (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?Do it!
Are you thinking something along the lines of this? Full credit to Eirikur for the query - it's all him.
* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)') AS VERSION_NAME;
Arg! There's a begininator in this code
Thinking of changing my name to ;Eirikur, has a nice begininator feel to it 🙂
😎
April 20, 2016 at 11:54 am
SQLRNNR (4/20/2016)
WayneS (4/20/2016)
Ed Wagner (4/19/2016)
SQLRNNR (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?Do it!
Are you thinking something along the lines of this? Full credit to Eirikur for the query - it's all him.
* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)
/* Human readable output */
SELECT
(
SELECT
CHAR(ASCII(SUBSTRING(@VERSION_STRING,NM.N,1)) - NM.N)
FROM NUMS NM
ORDER BY (NM.N % (DATALENGTH(@VERSION_STRING) / 4)) % (DATALENGTH(@VERSION_STRING) / 3)
FOR XML PATH(''),TYPE
).value('.[1]','VARCHAR(24)') AS VERSION_NAME;
Arg! There's a begininator in this code
Down with the begin-inator!!
edit: fixed quote bug
I see I'm not the only one who used to watch Phineas and Ferb. 😀 My daughter and I used to love that show.
April 20, 2016 at 8:08 pm
Steve Jones - SSC Editor (4/19/2016)
Luis Cazares (4/19/2016)
GilaMonster (4/19/2016)
And more homework in the forums. Is it wrong to want to post a sensible-looking but completely incorrect query as answers?That would be too easy for them. Just keep saying their guesses are wrong without even checking them. Maybe they'll eventually test them to prove they're right.
My vote here is to lead them on a path. 2-3 people try to help them learn how to test things, or learn, without giving a solution. Unless they have tried something and show results that don't seem to match.
However, after giving them info, if they don't want to try, cease to help. I'd also prefer more people (4, 5, 6) not pile on. Just let the thread drop off.
I've been meaning to comment on this as well, finally got around to it...
While it sounds like it would be "fun" to post some crazy-complicated query that doesn't work (or Eirikur query,) if that started to be the default response to the homework questions, it wouldn't take long for this site to get a bad reputation. I think Steve's recommendation is the right one. Try to point them in the right direction without giving them the answer, if they don't try to work it out from there (which can be fairly easy to spot, if you ask them to post what they've come up with and they post nothing beyond "it's not working," they're not trying) bail on the topic.
Bear in mind, too, I don't think *ANY* of the "big guns" here (you all know who we think you are) would post garbage answers.
But it can be fun to kibitz here at the water cooler about doing it...
:hehe:
(Edit: Corrected Eirikur's name)
April 21, 2016 at 7:20 am
Okay, this is weird. I went searching for an error I got in SSIS 2012 and the first thread that pops up in Google is a thread I posted about the issue a few weeks ago (I forgot I'd posted about it).
So the weird part? The link was NOT pointing to SSC. It was pointing to a website called DB-PUB. And the link (with all text reposted verbatim and no indication that it came from SSC) is here.
Steve, did anyone at RedGate give these people permission to repost from this site without attribution?
April 21, 2016 at 7:25 am
Brandie Tarvin (4/21/2016)
Okay, this is weird. I went searching for an error I got in SSIS 2012 and the first thread that pops up in Google is a thread I posted about the issue a few weeks ago (I forgot I'd posted about it).So the weird part? The link was NOT pointing to SSC. It was pointing to a website called DB-PUB. And the link (with all text reposted verbatim and no indication that it came from SSC) is here.
Steve, did anyone at RedGate give these people permission to repost from this site without attribution?
They actually have most of the forums reproduced. :crazy:
April 21, 2016 at 7:28 am
Luis Cazares (4/21/2016)
Brandie Tarvin (4/21/2016)
Okay, this is weird. I went searching for an error I got in SSIS 2012 and the first thread that pops up in Google is a thread I posted about the issue a few weeks ago (I forgot I'd posted about it).So the weird part? The link was NOT pointing to SSC. It was pointing to a website called DB-PUB. And the link (with all text reposted verbatim and no indication that it came from SSC) is here.
Steve, did anyone at RedGate give these people permission to repost from this site without attribution?
They actually have most of the forums reproduced. :crazy:
They have a SSC section....like for like :unsure:
Viewing 15 posts - 53,641 through 53,655 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply