April 21, 2010 at 9:33 am
Roy Ernest (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.I hope it is just a joke....
I doubt it's a joke. I've seen stuff like this before, never this bad.
---------------------------------------------------------------------
Use Full Links:
KB Article from Microsoft on how to ask a question on a Forum
April 21, 2010 at 9:41 am
Gianluca Sartori (4/21/2010)
I've seen even worse things in my app (Visual Basic):
Public const SC AS String = "'" 'Yes, you got it right, it's a single quote
....
' Everywhere in the code at least 1000 times:
sql = "SELECT someField FROM someTable WHERE someField = " & SC & variable & SC
Nice, isn't it?
Actually, I've used stuff like that before. Can potentially make it easier to see when you're using dynamic SQL and you need to add single quotes around strings, etc. Here's an example where I'm helping folks to generate deidentified test data to get help:
-- GENERATE INSERT STATEMENTS TO HELP OTHERS POPULATE #temp WITH TEST DATA
SELECT @columns = @columns + char(9) + cols.name + ' ' + systypes.name
+ CASE WHEN systypes.name IN ('char','varchar') THEN '('+convert(varchar(4),cols.length)+')' ELSE '' END
+ ',' + char(13),
@mySelectList = @mySelectList + cols.name + ', ',
@myInsertList = @myInsertList + @sq + ',' + @sq + char(13)
+
CASE
WHEN systypes.name IN ('char','varchar','datetime','smalldatetime')
THEN '+' +@sq+@sq+@sq+@sq+ ' + '
+CASE
WHEN cols.name IN ('memid','carriermemid','fullname','enrollid','member')
THEN
@sq+'member'+@sq+'+convert(varchar(25),abs(checksum(ISNULL('+objs.name+'.'+cols.name+','+@sq+@sq+')))) + '
WHEN cols.name = 'ssn'
THEN 'convert(varchar(9),100000000+abs(checksum('+objs.name+'.'+cols.name+','+@sq+@sq+'))) + '
WHEN cols.name IN ('provid','affiliateid','affiliationid','fedid','provider')
THEN
@sq+'provider'+@sq+'+convert(varchar(25),abs(checksum(ISNULL('+objs.name+'.'+cols.name+','+@sq+@sq+')))) + '
WHEN cols.name IN ('claimid','claim','encounter')
THEN 'convert(varchar(11),10000000000+abs(checksum('+objs.name+'.'+cols.name+','+@sq+@sq+'))) + '
WHEN systypes.name IN ('datetime','smalldatetime')
THEN 'convert(varchar,'+objs.name+'.'+cols.name+',20) + '
ELSE
'convert(varchar(25),ISNULL('+objs.name+'.'+cols.name+','+@sq+@sq+')) + '
END
+ @sq+@sq+@sq+@sq
ELSE '+ CONVERT(varchar(255),ISNULL(' + objs.name+'.'+cols.name+',0))'
END
+ ' + '
FROM dbo.sysobjects AS objs
INNER JOIN dbo.syscolumns AS cols ON cols.id = objs.id
INNER JOIN dbo.systypes systypes ON cols.xtype = systypes.xusertype
WHERE objs.name+'.'+cols.name IN (
SELECT objs.name + '.'+ cols.name
FROM sysobjects AS objs
INNER JOIN syscolumns AS cols
ON cols.id = objs.id
WHERE objs.name = '##myTemp'
)
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
April 21, 2010 at 10:04 am
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.
AWESOME.
I have seen stuff like that - ripped it out.
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 21, 2010 at 10:06 am
Greg Edwards-268690 (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.Looks like someone was either paid by the line or had a quota of lines of code to meet.:-D
Similar to paying a programmer by number of bug fixes....someone could get rich.
Greg E
HA, where do I sign up:-D
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 21, 2010 at 10:11 am
Trey Staker (4/21/2010)
Roy Ernest (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.I hope it is just a joke....
I doubt it's a joke. I've seen stuff like this before, never this bad.
I too doubt it to be a joke.
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 21, 2010 at 10:16 am
Trey Staker (4/21/2010)
Roy Ernest (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.I hope it is just a joke....
I doubt it's a joke. I've seen stuff like this before, never this bad.
I'm positive it's real.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 21, 2010 at 10:47 am
Lynn Pettis (4/21/2010)
Not someone I may consider hiring as a consultant or direct-hire.
I agree. Using ftp in the discussion as an example of security.
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 21, 2010 at 11:08 am
Lynn Pettis (4/21/2010)
Not someone I may consider hiring as a consultant or direct-hire.
Wow. Stubborn as a rock also. I sure hope he hires someone to come in and secure it, but I don't think he will.
He's been warned... it's on him now.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 21, 2010 at 11:18 am
WayneS (4/21/2010)
Lynn Pettis (4/21/2010)
Not someone I may consider hiring as a consultant or direct-hire.Wow. Stubborn as a rock also. I sure hope he hires someone to come in and secure it, but I don't think he will.
He's been warned... it's on him now.
yup
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 21, 2010 at 11:21 am
Tom.Thomson (4/20/2010)
Jeff Moden (4/20/2010)
Hmmmm... I'd really be interested in the translation for "If you want it real bad, you'll usually get it that way."
The pun on "bad" doesn't really work in SG, the nearest I can get is
Ma 's ann gu h-uamhasach a luigeas tu rudeigin, mar as trice gheibh thu greoig uamhasach.
If you want something terribly, you'll usually get a terrible bodge
which isn't really the same at all.
Thanks Tom... it may not work as a pun but it might be close enough.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 21, 2010 at 11:26 am
Grant Fritchey (4/21/2010)
Trey Staker (4/21/2010)
Roy Ernest (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.I hope it is just a joke....
I doubt it's a joke. I've seen stuff like this before, never this bad.
I'm positive it's real.
If everyone thinks it's a joke, what does that make of Oracle? Oracle has a table called "DUAL" and it contains precisely one row of nothing. The reason why it exists is because Oracle will not allow the following code (for example)...
SELECT 'This is a ' +@FillInTheWord
Instead, you must write it like the following in Oracle...
SELECT 'This is a ' +@FillInTheWord FROM Dual;
--Jeff Moden
Change is inevitable... Change for the better is not.
April 21, 2010 at 11:31 am
Apparently nothing comes in pairs in Oracle?
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
April 21, 2010 at 11:40 am
Jeff Moden (4/21/2010)
Grant Fritchey (4/21/2010)
Trey Staker (4/21/2010)
Roy Ernest (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.I hope it is just a joke....
I doubt it's a joke. I've seen stuff like this before, never this bad.
I'm positive it's real.
If everyone thinks it's a joke, what does that make of Oracle? Oracle has a table called "DUAL" and it contains precisely one row of nothing. The reason why it exists is because Oracle will not allow the following code (for example)...
SELECT 'This is a ' +@FillInTheWord
Instead, you must write it like the following in Oracle...
SELECT 'This is a ' +@FillInTheWord FROM Dual;
I have run into that in the past with Oracle. Specifically when converting code to TSQL. Had to research it and it makes a little sense in the way Oracle uses it.
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 21, 2010 at 11:42 am
Jeff Moden (4/21/2010)
Grant Fritchey (4/21/2010)
Trey Staker (4/21/2010)
Roy Ernest (4/21/2010)
GabyYYZ (4/21/2010)
Please tell me THIS doesn't happen a lot...*groan*.I hope it is just a joke....
I doubt it's a joke. I've seen stuff like this before, never this bad.
I'm positive it's real.
If everyone thinks it's a joke, what does that make of Oracle? Oracle has a table called "DUAL" and it contains precisely one row of nothing. The reason why it exists is because Oracle will not allow the following code (for example)...
SELECT 'This is a ' +@FillInTheWord
Instead, you must write it like the following in Oracle...
SELECT 'This is a ' +@FillInTheWord FROM Dual;
So in summary, Oracle Sucks!
Thanks for that important safety tip Jeff.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 15 posts - 14,626 through 14,640 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply