How to find who deleted records from table
View Complete Post
Dealing with error handling between T-SQL and a calling application, evaluating when a field's value has changed, and creating auditing tables in SQL ServerT are all common issues that developers must tackle.
MSDN Magazine April 2004
I am well versed with Join/Outer Join/Inner Join. My question is not related to normal Joining of two tables. Its little complex. Let me see if I can explain well.
There are two tables, were data is stored.
Name_Info : nvarchar(10)
Date_Info : smalldate()
Spec_Info_1 : tinyint
Spec_Info_2 : tinyint
Spec_Info_3 ; tinyint
Name_Data : nvarchar(10)
City_Data : nvarchar(10)
State_Data : nvarchar(10)
To join these two tables, I use the following query (joined on Name_Info ON Name_Data)
SELECT Name, Date=CONVERT(varchar, Date, 101), City, State,
CASE Spec_Info_1 WHEN '0' THEN 'House' WHEN '2' THEN 'Shop' WHEN '3' THEN 'Bay' ELSE '-'
END AS Spec_Info_1,
CASE Spec_Info_2 WHEN '0' THEN '10 Feet' WHEN '2' THEN '20 Feet' WHEN '3' THEN '40 Feet' ELSE '-' END AS Spec_Info_2,
CASE Spec_Info_3 WHEN '0' THEN '2 Windows' WHEN '2' THEN '4 Windows' WHEN '3' THEN '6 Windows' ELSE '-'
END AS Spec_Info_3
FROM Table_Spec_Data LEFT OUTER JOIN Table_Name_Data On Table_Spec_Data.Name_Info=Table_Name_Data.Name_Data
I need to insert/update data to 3 or more tables on a single button click.What is best method for achieving this?I am using mysql as my DB.
Thanks for your valuable reply in advance.
Suppose I have two tables "t1" and "t2"
t1 :id FirstName Age1 Joe 222 James 333 Bart 28t2:id LastName 1 Coymer2 Manes
I can combine the data from the two tables using an inner join.
1 Joe 22 CoyLap2 James 33 Manes
The problem though is that the person "Bart" with an Id of 3 isleft out because he does not have an entry in the second table.So how can I include Bart in the output in such a way that the outputmight look like this:
1 Joe 22 CoyLap2 James 33 Manes3 Bart null null
Or spaces can instead appear for Barts last name and age instead of null.Basically I just need Bart in the output as well even thoughhe has no age and last name.
If I have the following XML being passed as a parameter into a stored procedure.