Microsoft SQL Server 2005 Enterprise Edition for PC Logo

Related Topics:

Posted on Jul 13, 2009

Trigger to soft delete a row from the table in SQL

Hi,
I want to write a Trigger in SQL 2005 which will soft delete a perticular row means it will update the STATUS field of table from ACTIVATED to DELETED .
the row shpuld not get deleted.

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

Governor:

An expert whose answer got voted for 20 times.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

  • Contributor 2 Answers
  • Posted on Jul 13, 2009
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Governor:

An expert whose answer got voted for 20 times.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

Joined: Jul 13, 2009
Answers
2
Questions
0
Helped
29479
Points
18

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1helpful
1answer

SQL Server error:'execution was not successful'

Owing to the small size of MS SQL database repair utility download this program can be got immediately therefore there is a chance to avoid the losing of time and trigger the analysis and Microsoft SQL Server 2005 repair database as soon as the damage occurs.
https://www.sqlserverrepairtoolbox.com/
1helpful
6answers

Repair a corrupt SQL database in SQL 2005

Known as the leading solution provider in the field of data recovery and data conversions, the company has created a niche for another efficient tool known as SQL Server Repair Toolbox. The MS SQL repair tool reads *.mdf and *.ndf files and saves data, structure, links, etc. as SQL scripts or exports directly to Microsoft SQL Server through direct connect. read more details SQL Server Repair Toolbox
2helpful
2answers

How to restore MySQL database Windows tool?

You can restore corrupt and delete SQL database file in few steps for MySQL Restore Toolbox. With this software you can also recover triggers, keys, indexes and table. Software support multiple MDF file recovery option. Software is supported by all Windows operating system. Get more ideas and download free trial version from -http://www.filerepairforum.com/forum/databases/databases-aa/mysql/1162-dump-mysql-database-file-is-error
May 29, 2015 • Sun MySQL
1helpful
2answers

Repair database without being attached SQL 2005

Use SQL Server Repair Kit. A convenient, reliable and ultimately efficient MS SQL database repair tool for system administrators, developers and database experts. Best in class performance and outstanding usability for users with and without experience.

Read more: http://www.mssqlserver.repair/
0helpful
1answer

Need to make my table display in rows instead of column.

David, what you're looking for is pivot table functionality. Unfortunately, that is not a built-in feature for MySQL (it is for SQL Server 2005/2008).
Not knowing your table structure, or the size/number of rows/columns, I found the following link to be most helpful example: MySQL Pivot Table Example
Sep 04, 2013 • Sun MySQL
0helpful
1answer

Retribing elements from database

Hi,

If you are referring to retrieve only top 10 rows from sql server db then you can simply query like this:

SELECT TOP 10 * FROM YOURTABLENAME

If you want to retrieve latest 10 rows (the last 10 entries) then you need to add ORDER BY clause as well:

SELECT TOP 10 * FROM YOURTABLENAME
ORDER BY COLUMNNAME DESC

where columnname would be your sequential indexed or date or any datatype column by which you mean the latest ones.

Hope this helps.

Thanks.

0helpful
1answer

How to add more than one record in one row ?

You need to have two tables. One table for the reservation (each reervation having a primary key) and one table to store the people "linked" to that reservation. In the second table, each person will be on a row and one column in your second table would refer to the first (reservation) table in a one-to-many relationship. Read into database design and this will make sense. This can all be done in ADO.NET.
0helpful
1answer

Time based triggers or procedures

Syntax to create Triggers in SQL are :

Create Trigger trigger_name // "trigger_name" : Give name to the trigger
on
table_name // "table_name" : name of the table on which trigger has to created
for Update
as

Begin

// Here Query has to be written here

End


0helpful
1answer

TRIGGER IN SQL

A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server. A trigger is really an event handler. SQL Server allows users to create triggers (event handlers) for 3 types of events:
  • DML Event - Occurs when a DML (Data Manipulation Language) statement: INSERT, UPDATE or DELETE, is executed.
  • DDL Event - Occurs when a DDL (Data Definition Language) statement: CREATE, ALTER, or DROP, is executed.
  • Logon Event - Occurs when a user logins to the Server.
There are 3 different types of triggers (event handlers) based on the types of events they are triggered by:
  • DML Trigger - Executes in response to a DML event.
  • DDL Trigger - Executes in response to a DDL event.
  • Logon Trigger - Executes in response to a logon event.
0helpful
1answer

Table not gettin updated

Generally database updates either require a commit to have the database perform the appropriate checking and actually flag the rows as part of the database. That Commit can occur in two ways -- some databases can be setup with an auto commit or auto rollback when the database is disconnected. The first means the programmer needs to do nothing. The second means if the programmer does not commit the updates are backed out of the database. To commit is generally considered bad because if there are any data errors partial transactions and logically inconsistent contents can exist in a database. For example entering an order for merchandise requires a single header row to identify the customer and multiple items rows to indicate what was ordered. If the third item record added to an order had an error and the application did not rollback and the database auto committed and incomplete order with only two items would be saved in the database. Traditionally databases with an automatic action at shutdown are set to rollback to assure such partial information is not saved. Even with auto rollback good programs detect errors and rollback themselves and allow users to continue.

The net result of the above is the probability that if the inserts actually occurred as you believe the there was a missing commit to confirm their addition to the database. and an automated rollback kept them from being completely added to the database. Another alternative is that the insert was not error checked in the program code and it failed meaning despite the program counter claiming rows were inserted in fact they were not.
Not finding what you are looking for?

333 views

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

k24674

Level 3 Expert

8093 Answers

Brad Brown

Level 3 Expert

19187 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...