need help in Sql script
how to Delete Child Record And Later Delete The Parent Record if it has no child
Trigger might be the answer but i don t know how!
if someone has another way tell me
View Complete Post
Hello, I have write the code for deleting the data in excel sheet. but we have got the error" Deleting data in a linked table is not supported by this ISAM." below I paste some code snippest.string strDelete = "Delete from [" + strSheetName + "$]"; cmdExcel.Connection = con; cmdExcel.CommandType = CommandType.Text; cmdExcel.CommandText = strDelete; cmdExcel.ExecuteNonQuery();Please can anybody this answer.It is urgent
I'm trying to include a method in my application (for a delete button) that completely deletes a user from all relevant tables in the entire aspnet membership system in SQL. Is there syntax I can use to combine the following Delete statements
-- or do I have to include each of these individually on my code behind page, as per below? Thank you.
DELETE FROM aspnet_Profile WHERE UserID = @UserID
DELETE FROM aspnet_UsersInRoles WHERE UserID = @UserID
DELETE FROM aspnet_PersonalizationPerUser WHERE UserID = @UserID
DELETE FROM aspnet_Membership WHERE UserID = @UserID
DELETE FROM aspnet_Users WHERE UserID = @UserID
How can I get the numbers of records affected in the Merge statement, INSERT,UPDATE,DELETE separately and store it in a variable so I can get it in the application side?
I have an application where the users can define up to 5 extra fields for a particular table (e.g. tblMaster). The custom data is all held in one table (e.g. tblCustom) so there could be up to 5 records in tblCustom for each tblMaster record. In my application
I build a select statement based on the number of custom fields so that I can get a single row of data for each tblMaster record (sample below). I am now adding new features to the application and I want to expose an SQL View to the users for a report writer
that will achieve the same result but still cater for the variable number of custom fields. I realise this needs to use probably a RIGHT OUTER JOIN so that NULL is returned if there is no matching field but I can't work it out. If I had five separate
files it would be easy as each one would be a RIGHT OUTER JOIN for each. I could build 6 views (e.g. with no custom fields, with one custom field, with two custom fields etc) but that is not very efficient. I don't particulaly want to restructure the
database as there would be a lot of work and retesting.
Any help would be very welcome!
SELECT tblProcess.ProcessNumber, tblProcess.Process, tblProcess.Risk, tblProcess.MRR, tblProcess.Version, tblProcess.LastChange, tblProcess.SecurityLevel,
i have a treeView which display organization chart as hierarchical view. i want when end-user remove a treeNode, all childs of the selected node also being removed and then update database. to do this, i've used this code :
private void btnDeleteReceiver_Click(object sender, EventArgs e)
private void DeleteNode(TreeNode node)
foreach (TreeNode childNode in node.Nodes)
TestDataSet.ReceiversRow receiver = node.Tag as TestDataSet.ReceiversRow;
as u see in above code, i have a recursive method which delete all child nodes of the parentNode. but i'm facing a problem to delete all childs of the node. this loop could not iterate all childs node correctly. i don't know
I need to get output parameter (flag) from db after
saving record in database. I am using Microsoft Enterprise Library 4.1 for DB.
I am inserting record using I Data reader.