Stupid request of the day
-
From a colleague in our release team: >Do we have any field in the live database that contains "G:"? The database has approximately 600 tables, each having an average of about 25 columns, and the data stretches to about 3TB at the moment. WTF!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
From a colleague in our release team: >Do we have any field in the live database that contains "G:"? The database has approximately 600 tables, each having an average of about 25 columns, and the data stretches to about 3TB at the moment. WTF!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
Reply "Yes. But it's in an encrypted password"
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
From a colleague in our release team: >Do we have any field in the live database that contains "G:"? The database has approximately 600 tables, each having an average of about 25 columns, and the data stretches to about 3TB at the moment. WTF!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
I've had similar problem once, here is the solution: SELECT c.name AS 'ColumnName' ,t.name AS 'TableName' FROM sys.columns c JOIN sys.tables t ON c.object_id = t.object_id WHERE c.name LIKE '%MyName%' ORDER BY TableName ,ColumnName; [sql - Find all tables containing column with specified name - Stack Overflow](http://stackoverflow.com/questions/4849652/find-all-tables-containing-column-with-specified-name)
-
I've had similar problem once, here is the solution: SELECT c.name AS 'ColumnName' ,t.name AS 'TableName' FROM sys.columns c JOIN sys.tables t ON c.object_id = t.object_id WHERE c.name LIKE '%MyName%' ORDER BY TableName ,ColumnName; [sql - Find all tables containing column with specified name - Stack Overflow](http://stackoverflow.com/questions/4849652/find-all-tables-containing-column-with-specified-name)
That will show you if there is a column of a particular name - what he was asking was "is there any column in any table on the database that contains "G:" in the data
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
That will show you if there is a column of a particular name - what he was asking was "is there any column in any table on the database that contains "G:" in the data
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
Oh, well, from top of my head, I would just select all the tables, all the columns and would loop through them with a select query :)
-
-
Oh, well, from top of my head, I would just select all the tables, all the columns and would loop through them with a select query :)
No, write the query, and send it to him to execute... :-D
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
From a colleague in our release team: >Do we have any field in the live database that contains "G:"? The database has approximately 600 tables, each having an average of about 25 columns, and the data stretches to about 3TB at the moment. WTF!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
The easiest way to solve this is to insert a new row into a table and have G: as part of the content for a column's data. Now answer "yes" and if he asks for the data, just send him the row you just inserted. You are welcome. :cool:
Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com
-
Yes, with a cursor that locks each table, to prevent anyone inserting the G: value after you already checked. It is the only exhaustive, thread-safe, conclusive, and accurate way to know! A better method by be to ask "why".
-
-
The easiest way to solve this is to insert a new row into a table and have G: as part of the content for a column's data. Now answer "yes" and if he asks for the data, just send him the row you just inserted. You are welcome. :cool:
Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com
Genius!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
The easiest way to solve this is to insert a new row into a table and have G: as part of the content for a column's data. Now answer "yes" and if he asks for the data, just send him the row you just inserted. You are welcome. :cool:
Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com
-
The easiest way to solve this is to insert a new row into a table and have G: as part of the content for a column's data. Now answer "yes" and if he asks for the data, just send him the row you just inserted. You are welcome. :cool:
Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com
This guy knows what's up... :thumbsup::cool:
-
What I'm saying is this nonsense request could have an underlying question that wasn't stated, and could possibly be answered in a very simple and easy way... which would be a win for the one asking... and educational in a way that prevents stupid questions from coming up again, which anger and derail the developers.
-
Or worse, a clever programmer!
if (data.Contains("G:"))
{
// No one will ever use this value so we can use it for (some template?)...
}:~
Best, Sander arrgh.js - Bringing LINQ to JavaScript SQL Server for C# Developers Succinctly Object-Oriented Programming in C# Succinctly
-
From a colleague in our release team: >Do we have any field in the live database that contains "G:"? The database has approximately 600 tables, each having an average of about 25 columns, and the data stretches to about 3TB at the moment. WTF!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
Time for the Wally Deflector... Dilbert Comic Strip on 2005-07-10 | Dilbert by Scott Adams[^]
-
From a colleague in our release team: >Do we have any field in the live database that contains "G:"? The database has approximately 600 tables, each having an average of about 25 columns, and the data stretches to about 3TB at the moment. WTF!
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
"So, you wanna know if we've a 'G' string riding up next to someone's colon, then?" :wtf:
Ask a stupid question...
-
Nope, sys.tables gives you the tables, sys.colums gives you the columns and sys.types gives the data types. You have to execute select statements on text type columns. You would have around 1000 select statements to loop through, not the actual data
You'd be looping all text-columns and memo-fields (up to 2Gb potentially), within all tables. That's two loops, continously crunching on the DB-server. To find a two-character string? The only correct answer can be that there'd better be a friggin' good reason for the request, and to request what the elephant they were doing so you can write a more specific query. I doubt that the two characters could hide 'anywhere'.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
You'd be looping all text-columns and memo-fields (up to 2Gb potentially), within all tables. That's two loops, continously crunching on the DB-server. To find a two-character string? The only correct answer can be that there'd better be a friggin' good reason for the request, and to request what the elephant they were doing so you can write a more specific query. I doubt that the two characters could hide 'anywhere'.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Hey, if his live depends on it, I'm suggesting a solution. Actually it's not that bad. you can: select TableName, columnName from whatever joins you need to do on all columns that are text, varchar, nchar etc. Then you run select count(ColumnName) from TableName where columName like '%whatever you search%' Let's say 1-2 secs per query on a table up to 1 million records, he will have the answers in a hour or two. It's a ridiculous request, but you know, if he absolutely needs to do it ...