Question about Microsoft SQL Server 2005 Enterprise Edition for PC

1 Answer

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.

Posted by on

1 Answer

  • 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

Quikheal

Posted on Jul 13, 2009

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

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

×

Loading...
Loading...

Related Questions:

3 Answers

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

3 Answers

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/

May 13, 2015 | Microsoft SQL Server 2005 Enterprise...

1 Answer

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

1 Answer

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.

Mar 16, 2009 | Microsoft SQL Server 2005 Enterprise...

1 Answer

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.

Dec 24, 2008 | Microsoft SQL Server 2005 Standard Edition

1 Answer

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


Dec 18, 2008 | Microsoft Computers & Internet

1 Answer

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.

Jul 03, 2008 | Microsoft SQL Server 2000 Standard Edition...

1 Answer

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.

Dec 07, 2007 | Computers & Internet

1 Answer

I need solution for those questions


Here are the answers:

1. Use the MOD operator
DECLARE @i AS INT; SET @i = 0
WHILE true BEGIN
SET @i = @i + 1
IF @i % 10 BEGIN -- This is the MOD operator
UPDATE table SET Fields FROM table WHERE clause
END
END

% This is the MOD operator to find the remainder, which when @i is divisible by 10, the remainder (MODULAS) is 0.

2. You can't. Only the first and last can be defined. Any other AFTER triggers besides the first and last will fire in undetermined order.

Please rate FixYa! ThankYa! Happy db'ing.

Dec 04, 2007 | Microsoft SQL Server 2000 Standard Edition...

Not finding what you are looking for?
Microsoft SQL Server 2005 Enterprise Edition for PC Logo

Related Topics:

310 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2716 Answers

Piyal Perera
Piyal Perera

Level 3 Expert

528 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18390 Answers

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

Answer questions

Manuals & User Guides

Loading...