.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

URGENT :Deleted Vlues to be inserted in new table

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server

HI, I need some help from you guys ...Please


My requirement is

I have a database called DB






---(i will have 8990 Customer)IDs




and here i have to store the deleted results it in a new physical table ...but here is the issue


Dependent Tables:  Fullfiullement( Customer_ID,Order_ID,Phone))



etc etc

dependent or referencing other tables ..so i have to DROP the Child table first with taking the Customer _ID and order_IDs from above ...



SO i need to write a Script which will delete the Child tables and then Parent tables and i have to Save each deleted tables Data ........

I will  have :Customer_ID   


---(i will have 8990 Customer_ID )



and i need to delete only the records of those customer_IDS

View Complete Post

More Related Resource Links

how to get id value from the row inserted in a table with thr trigger.


I have a reports table with column report id and and report version. I created a trigger on this table to execute an application to do some processing each time a row is inserted in reports table. I need to pass the new report id execute this application from the trigger. How do I get the report id from the row that was inserted?


Triggering an event to occur within a VB.NET app if something is inserted into an SQL Server table

Let's say SQL Server is inserting arow within a table. Is there a way to let VB.NET know that an event was fired (being the inserting of the row within the table), without the need to query anything. Bascially having SQL Server tell the VB.NET app that an event was fired. It seems like it might be possible using CLR and the .NET framework integration wthin SQL Server, but I haven't found a sample program showing what I'm attempting. I understand that this topic covers SQL Server and VB.NET.  This need being for both and this forum only set for SQL Server, I thought I'd take the risk and post in this forum. Thank you in advance for any assistance.Newbie

Get inserted ids when inserting from User Defined Table Type

Imagine this procedure:   CREATE PROCEDURE [dbo].[insertActive] ( -- Add the parameters for the stored procedure here @p_data dbo.activeUpdate readonly) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. insert into dbo.active (name,stateid) select name,stateid from @p_data END How can I get the ids of the rows that have been inserted?  I tried searching the net and the forums but could not find anything. Thanks for any and all help, Gareth.

Deleted Values Insert into a New Table

Hi All,

I have Database DB and Table CB ..CB has 3  dependent Tables OB ,CP,CI
So My Requirement is ..

delete  From CB
where ID_NUM not Like '99%'

But here delete will  not work because of FK .. so i need to delete records from OB CP CI Tables first ...and I need to store all the Deleted Records of all the 4 Tables (CB,OB,CP,CI) in a seperate Table
May be all 4 deleted values in a Table
each table deleted records in each Seperate newly created table..

all i Know to go each child table and delete but ....It may be time Running Script ...
Individuall for Each delete and Store in new table

Can any one Help me on This .....

Why users are not deleted in the aspnet_Users table?


 I am using Membership and Roles in my website. The problem is when I remove a user, it does not show up in the "ASP.net Web Site Administration Tool/Security" tab anymore. However, when I checked the dbo.aspnet_Users table, every user I ever deleted is still listed in this table. Any idea why and how do I totally get rid of everything associated with a user once I removed them?

What is causing oracle datbase table failing to save inserted Record permenantly?


I have a table in orcale database where I am inserting records. I am able to insert a record in a table but it is not being saved permenantly.When inserting there is no error. what could be causing this?

SQL Trigger INSERT, UPDATE table name (inserted updated)

I am trying to make a trigger for INSERT, UPDATE.  For INSERT you get a table named inserted that you can use, and for UPDATE you get updated.  But what is the name if you doing a trigger for both?

Additional " mark at the end of field (CSV file to SQL table) - URGENT


Hi All,


I have a csv file which I am loading into a sql table and for some reason it is leaving a " mark at the end of one of the fields.  I cannot seem to get rid of it and need some urgent help as the data is needed immediately!


When I look at the source CSV file in notepad it looks like this:


42|"BISCUITS"|2|"BRANDED SAVOURY"|5410041001204|"TUC SALT"

42|"BISCUITS"|99|"ELIMINATED"|6009171986766|"Cherry + Orange Bisc"

42|"BISCUITS"|99|"ELIMINATED"|6009171986773|"Nut + Fruit Biscuits"

92|"ITEMS FOR DELETION"|36|"ORGANIC BEEF SET"|6009171987909|"Choc Biscuit Creams"


So you can see that Ints are not qualified and text is qualified with double quotations, all fields are pipe seperated.

My CSV connection in SSIS is set as follows:

Format = Delimited

Text qualifier = "

Header row delimiter {CF}{LF}

Header rows to skip = 0

No column names in first data row

Row delimiter {LF}

Column delimiter {|}


Once the data is in SQL I get the following:

Accidentally deleted some records from a Table


 Hi to all :(

as my post say's i accidentally deleted some records from a sql table, my log file is huge so i believe my records are still there, is there a way to make a rollback or read the log file to search my records.

please tell yes and light me to the solution

i did this  delete * from myTable where 1=1 and -- column = 'something'.. forgot to uncommnet the last condition on the where  (i have SQL 2008 Enterprise server)


IT Programmer: Juan Carlos Hidalgo

Passing the values from the Deleted virtual table to another Stored Procedure



I am wondering if something can be done.  I have a large database that I would like to implement change tracking on selected tables.  We've come up with a way to do it the least painful way we can, but I do not know if it will work.

I've created a trigger that will pass the table name to a stored procedure.  That stored procedure creates a Tracking table by appending the suffix 'Changes' to the past in table name.  But now how do I get the data from the Deleted table?

I can't do a SELECT INTO or INSERT INTO because the tables have timestamp fields and blobs.  I don't care if I do net get the data from those fields but I don't want to have to enter all the field names besides those two types.  I can make a stored procedure get the column names and types from a system table and dynamically build the SQL.  But I would prefer to do that in one place instead of each trigger.

Basically the problem is how do I get the data from the Deleted table to another stored procedure without explicitly naming all \the fields in the trigger.

If you don't understand what I mean then please ask, I will clarify with examples.



Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

Insert value using Table Value Functions

a real gem in Sql Server 2008. mostly people still using Stored procedure may be they shifted to SQL Server but they are not using TVF right now.

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

RadioButton Groups, Table Rows And NamingContainers in asp.net

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

RadioButton Groups, Table Rows And NamingContainers

(In which AJAX-enhanced CheckBoxes become more useful than RadioButtons but inheritance saves the day, and a simple RadioButton-derived control establishes the purpose of a control's naming container)

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

Building a 3-Tier App with Silverlight 3, .NET RIA Services, and Azure Table Storage

Silverlight 3, .NET RIA Services, and Windows Azure Services Platform makes a 3-tier Cloud application easier to build: Silverlight 3 as presentation tier, .NET RIA services as the business logic and data access tier, and Windows Azure Table as the data storage tier. The sample application in this article demonstrates the architecture with a simple Survey application with all these technologies working together from Windows Azure.

Temporary tables in SQL Server vs. table variables

When writing T-SQL code, you often need a table in which to store data temporarily when it comes time to execute that code. You have four table options: normal tables, local temporary tables, global temporary tables and table variables. I'll discuss the differences between using temporary tables in SQL Server versus table variables.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend