Here is how we can delete using JOINS. I have used inner join here.
DELETE
Table1
FROM
Table1 INNER JOIN Table2
ON Table1.Field2 = Table2.Field2
WHERE -- YOUR WHERE CONDITIONS
Table2.Field3 IS NOT NULL
Hope this helps
Here is how we can delete using JOINS. I have used inner join here.
DELETE
Table1
FROM
Table1 INNER JOIN Table2
ON Table1.Field2 = Table2.Field2
WHERE -- YOUR WHERE CONDITIONS
Table2.Field3 IS NOT NULL
Here is how we can update a table using JOINS in SQL SERVER.
UPDATE
Table1
SET
Table1.Field1 = Table2.Field1
FROM
Table1
INNER JOIN Table2 ON Table1.Field2 = Table2.Field2
WHERE -- YOUR WHERE CONDITIONS
Table2.Field3 IS NOT NULL
Hope this helps
Here is how you can hide all validator messages from below JavaScript.
function HideValidators() {
if (window.Page_Validators)
for (var vI = 0; vI < Page_Validators.length; vI++) {
var vValidator = Page_Validators[vI];
vValidator.isvalid = true;
ValidatorUpdateDisplay(vValidator);
}
}
Here is how you can hide validation summary using the below JavaScript. Call this in your aspx page. This should do trick for you.
// Hiding all validation contorls
for (i = 0; i < Page_Validators.length; i++) {
ValidatorEnable(Page_Validators[i], false)
}
Happy New Year to you all, Its been while I have stopped blogging. To get started back to blogging I have started with this small tip which saves your time. After all time is what we don’t have these days.
In SSMS whenever we connect to any database server by default the master database. Which forces us in changing the database to the one we want work using the USE statement or by using mouse and changing the selected db from the drop-down list. So this we will be doing this all-day and wasting time by doing this multiple times.
As a developer by default we mostly connect to single database at times specific to our project. So SQL Server Management Studio (SSMS) provides a way to change this. And next time onwards this new selected database will selected by default instead of the MASTER DB.
Here are the Steps:
Alternatively, we can change this by below simple statement as well:
-- @loginame --login name is the you use for SQL authentication
-- @defdb -- name of the default database
Exec sp_defaultdb @loginame='sa', @defdb='Test'