Assigning and Modifying Database Values “in Place”

Assigning and Modifying Database Values “in Place”
SQL Server 2008 introduces new compound assignment operators beyond the standard equality (=)
operator that allow you to both assign and modify the outgoing data value. These operators are similar
to what you would see in the C and Java languages. New assignment operators include the
following:
• += (add, assign)
• -= (subtract, assign)
• *= (multiply, assign)
• /= (divide, assign)
• |= (bitwise |, assign)
• ^= (bitwise exclusive OR, assign)
• &= (bitwise &, assign)
• %= (modulo, assign)

CREATE TABLE EmployeePayScale
(EmployeePayScaleID int NOT NULL PRIMARY KEY IDENTITY(1,1),
BasePayAMT numeric(9,2) NOT NULL,
ModifiedDate datetime NOT NULL DEFAULT GETDATE())
GO
– Using new multiple-row insert functionality
INSERT EmployeePayScale
(BasePayAMT)
VALUES
(30000.00),
(40000.00),
(50000.00),
(60000.00)

UPDATE EmployeePayScale
SET BasePayAMT = BasePayAMT + 10000
WHERE EmployeePayScaleID = 4

SELECT BasePayAMT
FROM EmployeePayScale
WHERE EmployeePayScaleID = 4

UPDATE EmployeePayScale
SET BasePayAMT += 10000
WHERE EmployeePayScaleID = 4

SELECT BasePayAMT
FROM EmployeePayScale
WHERE EmployeePayScaleID = 4

UPDATE EmployeePayScale
SET BasePayAMT *= 2
WHERE EmployeePayScaleID = 4

SELECT BasePayAMT
FROM EmployeePayScale
WHERE EmployeePayScaleID = 4

I Wan to share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • kick.ie
  • Live
  • MyShare
  • IndianPad
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • DotNetKicks
  • DZone
  • TwitThis

Check uncheck all checkbox in asp.net web form st using jquery

Check uncheck all check boxes on an asp.net web form using jquery.

On click of the link it behaves like a toggle button and changes its text also it check and un check all check boxes on the asp.net page

Asp.net Code

<a href=”#” id=”lnkAll”>Check all</a>

JQuery Code

$(“#lnkAll”).click(function(e) {

var currentVal = $(“#lnkAll”).text();

if (currentVal == “Check all”) {
$(‘input[type=checkbox]‘).attr(‘checked’, true);
$(“#lnkAll”).text(“Uncheck all”);

}
else if (currentVal == “Uncheck all”) {
$(‘input[type=checkbox]‘).attr(‘checked’, false);
$(“#lnkAll”).text(“Check all”);

}
});

I Wan to share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • kick.ie
  • Live
  • MyShare
  • IndianPad
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • DotNetKicks
  • DZone
  • TwitThis
|