How to pass a comma separated list to a stored procedure? * Cinema Guy 13:48 Add Comment Edit Question So I have a Sybase stored proc that takes 1 parameter that's a comma separated list of strings and runs a query with in in an I... Read More
Multiple foreign keys? * Cinema Guy 13:07 Add Comment Edit Question I've got a table that is supposed to track days and costs for shipping product from one vendor to another. We (brilliantly :p) ... Read More
Inheritance in database? * Cinema Guy 03:41 Add Comment Edit Question Is there any way to use inheritance in database (Specifically in SQL Server 2005)? Suppose I have few field like CreatedOn , C... Read More
What point should someone decide to switch Database Systems * Cinema Guy 09:06 Add Comment Edit Question When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc Answer It dep... Read More
SQL Case Statement Syntax? * Cinema Guy 05:13 Add Comment Edit Question What is the complete and correct syntax for the SQL Case statement? Answer The complete syntax depends on the database engine y... Read More
Drop all tables whose names begin with a certain string * Cinema Guy 21:41 Add Comment Edit Question I'd like a script to drop all tables whose name begins with a given string. I'm sure this can be done with some dynamic sql... Read More
What program can I use to generate diagrams of SQL view/table structure? * Cinema Guy 16:19 Add Comment Edit Question I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which co... Read More
How do I Concatenate entire result sets in MySQL? * Cinema Guy 11:47 Add Comment Edit Question I'm trying out the following query: SELECT A,B,C FROM table WHERE field LIKE 'query%' UNION SELECT A,B,C FROM table ... Read More
Distribution of table in time * Cinema Guy 09:58 Add Comment Edit Question I have a MySQL table with approximately 3000 rows per user. One of the columns is a datetime field, which is mutable, so the rows a... Read More
Backup SQL Schema Only? * Cinema Guy 08:53 Add Comment Edit Question I need to create a backup of a SQL Server 2005 Database that's only the structure...no records, just the schema. Is there any w... Read More
Sql to query a dbs scheme * Cinema Guy 08:41 Add Comment Edit Question In SqlServer. How do you query a db to bring back all the tables that have a field of a specific name? Answer The following query... Read More
Multiple Updates in MySQL * Cinema Guy 07:12 Add Comment Edit Question I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL? ... Read More
Timer-based event triggers * Cinema Guy 03:43 Add Comment Edit Question I am currently working on a project with specific requirements. A brief overview of these are as follows: Data is retrieved ... Read More
SQL query, count and group by * Cinema Guy 02:00 Add Comment Edit Question If I have data like this: +---+----+ |Key|Name| +---+----+ |1 |Dan | +---+----+ |2 |Tom | +---+----+ |3 |Jon | +---+----+ |4 ... Read More
Paging SQL Server 2005 Results * Cinema Guy 13:57 Add Comment Edit Question How do I page results in SQL Server 2005? I tried it in SQL Server 2000, but there was no reliable way to do this. I'm now w... Read More
SQL Server 2005 For XML Explicit - Need help formatting * Cinema Guy 13:35 Add Comment Edit Question I have a table with a structure like the following: ------------------------------ LocationID | AccountNumber --------------... Read More
How do I use T-SQL Group By * Cinema Guy 11:55 Add Comment Edit Question I know I need to have (although I don't know why) an Order By clause on the end of a SQL query that uses any aggregate function... Read More
How do I split a string so I can access item x * Cinema Guy 11:15 Add Comment Edit Question Using SQL Server 2005, how do I split a string so I can access item x? For example, take the string "Hello John Smith"... Read More
Convert HashBytes to VarChar * Cinema Guy 04:49 Add Comment Edit Question I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command: SELECT HashBytes('MD5... Read More
What is the best way to avoid SQL injection attacks? * Cinema Guy 23:48 Add Comment Edit Question I've provided a solution for Python... please flesh this out with examples for other languages. Answer Oracle has got an exte... Read More