SQL Case Statement Syntax? What is the complete and correct syntax for the SQL Case statement? Solution : The complete syntax depends on the database engine you're working with: For SQL Server: CASE case-expression WHEN when-expression-1 THEN value-1 [ WHEN when-expression-n THEN value-n ... ] [ ELSE else-value ] END or: CASE WHEN boolean-when-expression-1 THEN value-1 [ WHEN boolean-when-expression-n THEN value-n ... ] [ ELSE else-value ] END expressions, etc: case-expression - something that produces a value when-expression-x - something that is compared against the case-expression value-1 -
undefined
Inheritance in database? Is there any way to use inheritance in database (Specifically in SQL Server 2005)? Suppose I have few field like CreatedOn, CreatedBy which I want to add on all of my entities. I looking for an alternative way instead of adding these fields to every table. Solution : There is no such thing as inheritance between tables in SQL Server 2005, and as noted by the others, you can get as far as getting help adding the necessary columns to the tables when
undefined
Check for changes to an SQL Server table? How can I monitor an SQL Server database for changes to a table without using triggers or modifying the structure of the database in any way? My preferred programming environment is .NET and C#. I'd like to be able to support any SQL Server 2000 SP4 or newer. My application is a bolt-on data visualization for another company's product. Our customer base is in the thousands, so I don't want to have to put in requirements that we modify
undefined
How do I split a string so I can access item x? Using SQL Server 2005, how do I split a string so I can access item x? For example Take a string "Hello John Smith". How can I split the string by space and access the item at index 1 which should return "John"? Solution: You may find the solution in SQL User Defined Function to Parse a Delimited String helpful (from The Code Project). You can use this simple logic: Declare @products varchar(200) = '1|20|3|343|44|6|8765' Declare @individual varchar(20) =
undefined
Differences between MySQL and SQL Server I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and for personal projects). I am considering trying out the LAMP stack for some of my personal projects. What are some of the main differences between MySQL and SQL Server? Is using stored procedures a common practice in MySQL? Any advice or resources you'd recommend to help me with the switch? To those who have experience with both, are there any missing features from MySQL? Best answer