How to Alter MSDB Database SMTP Server Name


This Command Will show You All Items From sysmail_allitems table
SELECT * FROM sysmail_allitems

This will Show You Mailed Items
SELECT * FROM sysmail_mailitems

This Command Your Mail Account
SELECT * FROM sysmail_account
In this TAble You Will get Your mail SERVER Credential or His Name May be IP Address
SELECT * FROM sysmail_server
From this table you can get Mail Log Information
SELECT *FROM sysmail_log

Working with the INSERT statement in SQL Server


The INSERT statement lets you add one or more rows to a table or view in a SQL Server database. The statement is one of the primary data modification language (DML) statements available in Transact-SQL, along with UPDATE, MERGE, and DELETE. You can use the INSERT statement to add data that you specifically define, or you can add data that you retrieve from other tables or views. You can also include an OUTPUT clause in your INSERT statement to capture the statement’s results for auditing or verification purposes.
To demonstrate how to create a basic INSERT statement, I first used the following code to create the abc table
IF OBJECT_ID(‘abc’, ‘U’) IS NOT NULL

DROP TABLE abc;
CREATE TABLE abc
(
StaffID INT NOT NULL PRIMARY KEY,
FirstName NVARCHAR(30) NOT NULL,
LastName NVARCHAR(30) NOT NULL
);

INSERT INTO abc VALUES (1, ‘Stephen’, ‘Jiang’);

you might want to add multiple rows to a table in a single statement. Prior to SQL Server 2008,

INSERT abc VALUES
(2, ‘Michael’, ‘Blythe’),
(3, ‘Linda’, ‘Mitchell’),
(4, ‘Jillian’, ‘Carson’),
(5, ‘Garrett’, ‘Vargas’);

IF OBJECT_ID (‘abcd’, ‘U’) IS NOT NULL
DROP TABLE abcd;
CREATE TABLE abcd
(
StaffID INT NOT NULL IDENTITY PRIMARY KEY,
StaffGUID UNIQUEIDENTIFIER NULL,
FirstName NVARCHAR(30) NOT NULL,
LastName NVARCHAR(30) NOT NULL,
FullName AS (FirstName + ‘ ‘ + LastName),
ModifiedDate DATETIME NOT NULL DEFAULT GETDATE()
);
StaffID is an IDENTITY column, FullName is a calculated column, and ModifiedDate has been defined with a default value (retrieved through the GETDATE function). Now let’s look at an INSERT statement that provides values for the other three columns—StaffGUID, FirstName, LastName

INSERT INTO abcd
(StaffGUID, FirstName, LastName)
VALUES (NEWID(), ‘Stephen’, ‘Jiang’);
SELECT StaffID, StaffGUID, FullName, ModifiedDate
FROM abcd;

IF OBJECT_ID (‘xyz’, ‘U’) IS NOT NULL
DROP TABLE xyz;
CREATE TABLE xyz
(
StaffID INT NOT NULL PRIMARY KEY,
FullName NVARCHAR(60) NOT NULL,
ModifiedDate DATETIME NOT NULL DEFAULT GETDATE()
);

INSERT xyz
(StaffID, FullName)
SELECT TOP 5
staffID,
FirstName + ‘ ‘ + LastName AS FullName
FROM abc
ORDER BY staffID;
SELECT * FROM xyz;

A SELECT statement that’s used within an INSERT statement can reference a common table expression (CTE) as well as a table or view, as long as that CTE precedes the INSERT statement (as opposed to being part of the SELECT statement itself). For instance, in the following example, I first define a CTE and then define the INSERT statement, which pulls data from the CTE through a SELECT statement:
Insertion With CTE
WITH cteabc (StaffID, FullName)
AS
(
SELECT staffID,
FirstName + ‘ ‘ + LastName AS FullName
FROM abc
WHERE staffID BETWEEN 1 AND 3
)
INSERT xyz
(StaffID, FullName)
SELECT StaffID, FullName
FROM cteabc;
SELECT * FROM SalesStaff3
WHERE StaffID BETWEEN 279 AND 283;
————————————–
Instead of using a SELECT statement to retrieve data, you can call a stored procedure in your INSERT statement. For instance, the following stored procedure—spSalesStaff—retrieves data from the vSalesPerson view:
IF OBJECT_ID(‘spabc’, ‘P’) IS NOT NULL
DROP PROCEDURE spabc;
GO
CREATE PROCEDURE spabc
AS
SELECT staffID,
FirstName + ‘ ‘ + LastName AS FullName
FROM abc
WHERE staffID BETWEEN 1 AND 3;
I can then call this stored procedure from within an INSERT statement, as shown in the following example:
INSERT xyz (StaffID, FullName)
EXEC spabc;
SELECT * FROM xyz
WHERE StaffID BETWEEN 1 AND 3;
Starting with SQL Server 2005, DML statements supported the OUTPUT clause, which lets you output the modified table to another table or variable. In the case of the INSERT statement, you can use the OUTPUT clause to track the data that is being inserted into your table. For example, the following INSERT statement uses the OUTPUT clause to output the inserted values to a table variable:

DECLARE @InsertOutput TABLE
(
StaffID INT,
FullName VARCHAR(60)
);
INSERT INTO xyz
(StaffID, FullName)
OUTPUT INSERTED.StaffID, INSERTED.FullName
INTO @InsertOutput

SELECT
staffID,
FirstName + ‘ ‘ + LastName AS FullName
FROM abcd
WHERE staffID> 0;
SELECT * FROM xyz
WHERE StaffID >0;
SELECT * FROM @InsertOutput;

How Make Mail Sending Job In Sql Server 2005


Step 1: First of all you will have make your email account into your database with given below queries
Run to these quereis as given below

EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = ‘sample@Orient.com’,
@description = ‘Maill Account for database mail’,
@email_address = ‘sample@Orient.com’,
@display_name = ‘sample@Orient.com’,
@username = ‘sample@Orient.com’,
@password = ‘orient’,
@mailserver_name = ‘ipaddres’
GO
EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = ‘sample@Orient.com’,
@description = ‘Profile used for database mail’
GO
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = ‘sample@Orient.com’,
@account_name = ‘sample@Orient.com’,
@sequence_number = 1
GO
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@profile_name = ‘sample@Orient.com’,
@principal_name = ‘public’,
@is_default = 1;

Step 2: Now Start Your Sqlserver2005 With Short Command Sqlwb or by programm>sqlserver>managemetnstudio2005
and make new as right click given below:

Step 3: Do as given in image below Make a Job Step By click on step tab

STep 4 : how to make step is given below

Query Which you will paste Into Step 1 into command box
————————————————
DECLARE @strTenderTitle VARCHAR(500)
DECLARE @strTenderNumber VARCHAR(100)
DECLARE @dtTenderClosingDate VARCHAR(50)
DECLARE @dtTenderOpeningDate VARCHAR(50)
DECLARE @intID INT
DECLARE @strEmail_Recipients VARCHAR(MAX)

SET @strTenderTitle = ‘ ‘
SET @strTenderNumber = ‘ ‘
SET @dtTenderClosingDate = ‘ ‘
SET @dtTenderOpeningDate = ‘ ‘
SET @intID = 0
SET @strEmail_Recipients = ‘ ‘

CREATE TABLE #temp(intID INT, strTenderTitle VARCHAR(500), strTenderNumber VARCHAR(100), dtTenderClosingDate VARCHAR(50), dtTenderOpeningDate VARCHAR(50))
INSERT INTO #temp SELECT DISTINCT TOP (100) PERCENT intID, strTenderTitle, strTenderNumber, dtTenderClosingDate, dtTenderOpeningDate FROM dbo.tbl_TenderMaster WHERE (dtTenderClosingDate < GETDATE()) AND (isActivated 1)

WHILE (SELECT COUNT(strTenderTitle) FROM #temp) > 0
BEGIN
SELECT DISTINCT TOP(1) @intID = intID, @strTenderTitle = strTenderTitle, @strTenderNumber = strTenderNumber, @dtTenderClosingDate = dtTenderClosingDate, @dtTenderOpeningDate = dtTenderOpeningDate FROM #temp

SELECT TOP (100) PERCENT @strEmail_Recipients = @strEmail_Recipients + dbo.tbl_Vender.strEmail + ‘;’
FROM dbo.tbl_Vender INNER JOIN
dbo.tbl_VenderProduct ON dbo.tbl_Vender.intId = dbo.tbl_VenderProduct.intVenderId INNER JOIN
dbo.tbl_TenderMaster ON dbo.tbl_VenderProduct.intProductId = dbo.tbl_TenderMaster.intRelatedProductId
WHERE (dbo.tbl_TenderMaster.intID = @intID)

PRINT @strEmail_Recipients

DECLARE @tableHTML NVARCHAR(MAX) ;
SET @tableHTML =
N’

‘ + N” +N” +
N” +
N’ ‘ +
N” +
N” +
N’
‘ +N” +
N” +
N’

‘ +
N’

‘ +
N’REMAINDER:- TENDER CLOSING

‘ +
N’

‘ +
N’ ‘ +
N’

‘ + N” +N” +
N” +
N’
‘ +N” +
N” +
N’
‘ +N” +
N” +
N’
‘ +N” +
N” +
N’
‘ +N” +
N” +
N’

‘ +
N’

‘ +
N’Dear Vendor/Customer,’ +
N’

‘ +
N’

‘ +
N’ ‘ +
N’
‘ +
N’

‘ +
N’As you know very well that, our tender ‘+@strTenderTitle+’ under reff. no. ‘+@strTenderNumber+’‘ +
N’ was opened on ‘+@dtTenderOpeningDate+’. And now it`s going to be closed on ‘+@dtTenderClosingDate+’.’ +
N’ You are respectfully requested to float your best quotation for this tender before’ +
N’tender to be closed.

‘ +
N’

‘ +
N’Please ignore this mail, if you already had applied for this tender.

‘ +
N’

‘ +
N’ ‘ +
N’
‘ +
N’you get this mail because your are registered with our portal. please click here’ +
N’to login into your account.http://ipaddres/tenderportal‘ +
N’
‘ +
N’feel free to contact us at etender@owmnahar.com‘ +
N’for any furthur enquiry’ +
N’

‘ +
N’

‘ +
N” +
N’ ‘ +
N” +
N” +
N’
‘ +N” +
N’ ‘ +
N” +
N” +
N’ ‘ +
N” +
N” +
N’ ‘ +
N” +
N” +
N’

exec msdb.dbo.sp_send_dbmail
@recipients = @strEmail_Recipients,
@subject = ‘Mail testing’,
@body = @tableHTML,
@body_format = ‘HTML’;

–PRINT @tableHTML

DELETE TOP(1) FROM #temp
END
drop table #temp
————————————————


Note : Remember this for this don’t forget to make your sampledb named database and tbltendermaster table into your database whose queries are given below
USE [master]
GO
/****** Object: Database [SampleDb] Script Date: 10/09/2010 10:39:17 ******/
CREATE DATABASE [SampleDb] ON PRIMARY
( NAME = N’SampleDb’, FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SampleDb.mdf’ , SIZE = 6336KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N’SampleDb_log’, FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SampleDb_log.LDF’ , SIZE = 768KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
EXEC dbo.sp_dbcmptlevel @dbname=N’SampleDb’, @new_cmptlevel=90
GO
IF (1 = FULLTEXTSERVICEPROPERTY(‘IsFullTextInstalled’))
begin
EXEC [SampleDb].[dbo].[sp_fulltext_database] @action = ‘enable’
end
GO
ALTER DATABASE [SampleDb] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [SampleDb] SET ANSI_NULLS OFF
GO
ALTER DATABASE [SampleDb] SET ANSI_PADDING OFF
GO
ALTER DATABASE [SampleDb] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [SampleDb] SET ARITHABORT OFF
GO
ALTER DATABASE [SampleDb] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [SampleDb] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [SampleDb] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [SampleDb] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [SampleDb] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [SampleDb] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [SampleDb] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [SampleDb] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [SampleDb] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [SampleDb] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [SampleDb] SET ENABLE_BROKER
GO
ALTER DATABASE [SampleDb] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [SampleDb] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [SampleDb] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [SampleDb] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [SampleDb] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [SampleDb] SET READ_WRITE
GO
ALTER DATABASE [SampleDb] SET RECOVERY FULL
GO
ALTER DATABASE [SampleDb] SET MULTI_USER
GO
ALTER DATABASE [SampleDb] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [SampleDb] SET DB_CHAINING OFF

Queries For Table
USE [SampleDb]
GO
/****** Object: Table [dbo].[tbl_TenderMaster] Script Date: 10/09/2010 10:40:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_TenderMaster](
[intID] [int] NOT NULL,
[intRelatedDepartmentId] [int] NULL,
[intPublishedByPersonID] [int] NULL,
[intRelatedProductId] [int] NULL,
[intAwardedPersonId] [int] NULL,
[intUnitOfMeasurementId] [int] NULL,
[intAlternateUnitOfMeasurement] [int] NULL,
[intTenderTypeId] [int] NULL,
[fltProductQty] [float] NULL,
[strDocumentName] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[strTenderNumber] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[strTenderTitle] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[strTenderShortDesc] [varchar](2000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[strTenderFullDesc] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[dtTenderOpeningDate] [datetime] NULL,
[dtTenderClosingDate] [datetime] NULL,
[btTenderAllocationStatus] [bit] NULL,
[btTenderReleasedStatus] [bit] NULL,
[isActivated] [bit] NULL,
[dtPublishingDate] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

And Insert Some Record Into Your Database As Given Below Into Picture
INSERT INTO [SampleDb].[dbo].[tbl_TenderMaster]
([intID]
,[intRelatedDepartmentId]
,[intPublishedByPersonID]
,[intRelatedProductId]
,[intAwardedPersonId]
,[intUnitOfMeasurementId]
,[intAlternateUnitOfMeasurement]
,[intTenderTypeId]
,[fltProductQty]
,[strDocumentName]
,[strTenderNumber]
,[strTenderTitle]
,[strTenderShortDesc]
,[strTenderFullDesc]
,[dtTenderOpeningDate]
,[dtTenderClosingDate]
,[btTenderAllocationStatus]
,[btTenderReleasedStatus]
,[isActivated]
,[dtPublishingDate])
VALUES
(
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,)
as this insert 10 records into your table with data difference
query for vendor product table

CREATE TABLE [dbo].[tbl_VenderProduct](
[intId] [int] IDENTITY(1,1) NOT NULL,
[intVenderId] [int] NULL,
[intProductId] [int] NULL,
[dtDatetime] [datetime] NULL,
[btIsVerify] [bit] NULL,
CONSTRAINT [PK_tbl_VenderProduct] PRIMARY KEY CLUSTERED
(
[intId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tbl_VenderProduct] WITH CHECK ADD CONSTRAINT [FK_tbl_VenderProduct_tbl_Product] FOREIGN KEY([intProductId])
REFERENCES [dbo].[tbl_Product] ([intProductId])
GO
ALTER TABLE [dbo].[tbl_VenderProduct] WITH CHECK ADD CONSTRAINT [FK_tbl_VenderProduct_tbl_Vender] FOREIGN KEY([intVenderId])
REFERENCES [dbo].[tbl_Vender] ([intId])
Query For Product Table
CREATE TABLE [dbo].[tbl_Product](
[intProductId] [int] IDENTITY(1,1) NOT NULL,
[intUnitOfMeasurementId] [int] NULL,
[intAlternateUnitOfMeasurement] [int] NULL,
[strProductName] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[dtDatetime] [datetime] NULL,
[btIsActive] [bit] NULL,
[isSpecificationRequired] [bit] NULL,
CONSTRAINT [PK__tbl_Product__17F790F9] PRIMARY KEY CLUSTERED
(
[intProductId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[tbl_Product] WITH CHECK ADD CONSTRAINT [FK_tbl_Product_tbl_UnitOfMeasurement] FOREIGN KEY([intUnitOfMeasurementId])
REFERENCES [dbo].[tbl_UnitOfMeasurement] ([intID])
GO
ALTER TABLE [dbo].[tbl_Product] WITH CHECK ADD CONSTRAINT [FK_tbl_Product_tbl_UnitOfMeasurement1] FOREIGN KEY([intAlternateUnitOfMeasurement])
REFERENCES [dbo].[tbl_UnitOfMeasurement] ([intID])
Query for Unit of Measurement table
CREATE TABLE [dbo].[tbl_UnitOfMeasurement](
[intID] [int] IDENTITY(1,1) NOT NULL,
[strName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_tbl_UnitOfMeasurement] PRIMARY KEY CLUSTERED
(
[intID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
Remember to insert some demo records in these tables because these are relation table.

Step 5: Now Make A Maintenace Plan As Given Below

Step 6: Now Insert Execute Sql Server Job Task Into Maintenance Plan

Step 7: Now Right Click on That and Click on Edit option then check to your job
and save him it will give you connection error click ok and Right Click on maintenace plan then click on option execute and test if success then it means it is right and if failure then their you did something mistake

STep 8:If you want to Test your Job then Right Click on your Job and Test by Click on Start Job option and check out your email addres you will get new mails’
Be happy and Enjoy in programming World!!
Whole Query Of Job
copy and paste and create above job if facing problem in doing practicle
——————————————–
USE [msdb]
GO
/****** Object: Job [ABC] Script Date: 10/09/2010 11:00:29 ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [Database Maintenance] Script Date: 10/09/2010 11:00:29 ******/
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N’Database Maintenance’ AND category_class=1)
BEGIN
EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N’JOB’, @type=N’LOCAL’, @name=N’Database Maintenance’
IF (@@ERROR 0 OR @ReturnCode 0) GOTO QuitWithRollback

END

DECLARE @jobId BINARY(16)
EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N’ABC’,
@enabled=1,
@notify_level_eventlog=2,
@notify_level_email=0,
@notify_level_netsend=0,
@notify_level_page=0,
@delete_level=0,
@description=N’This Is Sample Mail job’,
@category_name=N’Database Maintenance’,
@owner_login_name=N’sa’, @job_id = @jobId OUTPUT
IF (@@ERROR 0 OR @ReturnCode 0) GOTO QuitWithRollback
/****** Object: Step [Send Mail Step 1] Script Date: 10/09/2010 11:00:29 ******/
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N’Send Mail Step 1′,
@step_id=1,
@cmdexec_success_code=0,
@on_success_action=1,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N’TSQL’,
@command=N’DECLARE @strTenderTitle VARCHAR(500)
DECLARE @strTenderNumber VARCHAR(100)
DECLARE @dtTenderClosingDate VARCHAR(50)
DECLARE @dtTenderOpeningDate VARCHAR(50)
DECLARE @intID INT
DECLARE @strEmail_Recipients VARCHAR(MAX)

SET @strTenderTitle = ” ”
SET @strTenderNumber = ” ”
SET @dtTenderClosingDate = ” ”
SET @dtTenderOpeningDate = ” ”
SET @intID = 0
SET @strEmail_Recipients = ” ”

CREATE TABLE #temp(intID INT, strTenderTitle VARCHAR(500), strTenderNumber VARCHAR(100), dtTenderClosingDate VARCHAR(50), dtTenderOpeningDate VARCHAR(50))
INSERT INTO #temp SELECT DISTINCT TOP (100) PERCENT intID, strTenderTitle, strTenderNumber, dtTenderClosingDate, dtTenderOpeningDate FROM dbo.tbl_TenderMaster WHERE (dtTenderClosingDate < GETDATE()) AND (isActivated 1)

WHILE (SELECT COUNT(strTenderTitle) FROM #temp) > 0
BEGIN
SELECT DISTINCT TOP(1) @intID = intID, @strTenderTitle = strTenderTitle, @strTenderNumber = strTenderNumber, @dtTenderClosingDate = dtTenderClosingDate, @dtTenderOpeningDate = dtTenderOpeningDate FROM #temp

SELECT TOP (100) PERCENT @strEmail_Recipients = @strEmail_Recipients + dbo.tbl_Vender.strEmail + ”;”
FROM dbo.tbl_Vender INNER JOIN
dbo.tbl_VenderProduct ON dbo.tbl_Vender.intId = dbo.tbl_VenderProduct.intVenderId INNER JOIN
dbo.tbl_TenderMaster ON dbo.tbl_VenderProduct.intProductId = dbo.tbl_TenderMaster.intRelatedProductId
WHERE (dbo.tbl_TenderMaster.intID = @intID)

PRINT @strEmail_Recipients

DECLARE @tableHTML NVARCHAR(MAX) ;
SET @tableHTML =
N”

” + N”” +N”” +
N”” +
N” ” +
N”” +
N”” +
N”
” +N”” +
N”” +
N”

” +
N”

” +
N”REMAINDER:- TENDER CLOSING

” +
N”

” +
N” ” +
N”

” + N”” +N”” +
N”” +
N”
” +N”” +
N”” +
N”
” +N”” +
N”” +
N”
” +N”” +
N”” +
N”
” +N”” +
N”” +
N”

” +
N”

” +
N”Dear Vendor/Customer,” +
N”

” +
N”

” +
N” ” +
N”
” +
N”

” +
N”As you know very well that, our tender ”+@strTenderTitle+” under reff. no. ”+@strTenderNumber+”” +
N” was opened on ”+@dtTenderOpeningDate+”. And now it`s going to be closed on ”+@dtTenderClosingDate+”.” +
N” You are respectfully requested to float your best quotation for this tender before” +
N”tender to be closed.

” +
N”

” +
N”Please ignore this mail, if you already had applied for this tender.

” +
N”

” +
N” ” +
N”
” +
N”you get this mail because your are registered with our portal. please click here” +
N”to login into your account.http://OrientDeveloper.com” +
N”
” +
N”feel free to contact us at etender@owmnahar.com” +
N”for any furthur enquiry” +
N”

” +
N”

” +
N”” +
N” ” +
N”” +
N”” +
N”
” +N”” +
N” ” +
N”” +
N”” +
N” ” +
N”” +
N”” +
N” ” +
N”” +
N”” +
N”

exec msdb.dbo.sp_send_dbmail
@recipients = @strEmail_Recipients,
@subject = ”Mail testing”,
@body = @tableHTML,
@body_format = ”HTML”;

–PRINT @tableHTML

DELETE TOP(1) FROM #temp
END
drop table #temp’,
@database_name=N’SampleDb’,
@flags=0
IF (@@ERROR 0 OR @ReturnCode 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
IF (@@ERROR 0 OR @ReturnCode 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)’
IF (@@ERROR 0 OR @ReturnCode 0) GOTO QuitWithRollback
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
EndSave:

How To Handle Response.Redirect causes System.Threading.ThreadAbortException


Hello Friends Soultion of This Exception Is Below Given
The correct pattern is to call the Redirect overload with endResponse=false and make a call to tell the IIS pipeline that it should advance directly to the EndRequest stage once you return control:

Response.Redirect(url, false);
Context.ApplicationInstance.CompleteRequest();

If you pass endResponse=false, then the exception is not thrown (but the runtime will continue processing the current request).

If endResponse=true (or if the other overload is used), the exception is thrown and the current request will immediately be terminated.

What Is SilverLight In Vs2010


Hello Friends Today You Will Get Knowelge About SilverLight It is boosting technology That has introduced in the market and growing day by day every body is getting interest in it.

Before Getting start of it You should be aware about What is SilverLight and How To Deploy it’s Site and it’s working on Browser and How Can Make Application In It.
In This Article You Will Learn About Simple Application And Use of Template Of Silverlight In Visual Studio 2010 e.g
These Template Are In .net Framework 4.0
SilverLight Application
Silverlight Class Library Application
Silverlight Navigation Application
Silverlight Business Application
WCF RIA Services Class Library
These Template Are In .net Framework 2.0,3.0,3.5
SilverLight Application
Silverlight Class Library Application
Silverlight Navigation Application
Note : If You Want To Do Practical Of SilverLight You Must INstal VS2010 IDE Environment On you Pc.
Because In It SilverLight Already Embeded And In VS2008 You Would Have To Install Additionally
What IS SIlverlight?
1) Microsoft Silverlight is a cross-browser, cross-platform implementation of the .NET Framework for building and delivering the next generation of media experiences and rich interactive applications (RIA) for the Web.
2) Silverlight unifies the capabilities of the server, the Web, and the desktop, of managed code and dynamic languages, of declarative and traditional programming, and the power of Windows Presentation Foundation (WPF).
3) It runs in all popular Web browsers, including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari, Google Chrome, and on Microsoft Windows and Apple Mac OS X.
4) It is supported by a small download that installs in seconds.
5) It streams video and audio. It scales video quality to everything from mobile devices to desktop browsers to 720p HDTV video modes.
6) It includes compelling graphics that users can manipulate—drag, turn, and zoom—directly in the browser.
7) It reads data and updates the display, but it doesn’t interrupt the user by refreshing the whole page.
8) The application can run in the Web browser or you can configure it so users can run it on their computer (out-of-browser).
Features Of SilverLIght
Silverlight combines multiple technologies into a single development platform that enables you to select the right tools and the right programming language for your needs. Silverlight offers the following features:
1) WPF(Window Presentation Foundation) and XAML(Prounce As zammel)
2) Extensions to JavaScript.
3) Cross-browser, cross-platform support.
4) Integration with existing applications
5) Access to the .NET Framework programming model.
6) Networking support.
7) LINQ

How To Run SilverLight Application On Client Browser?
To run a Silverlight application, users require a small plug-in in their browser. The plug-in is free. If users do not already have the plug-in, they are automatically prompted to install it. The download and installation take seconds and require no interaction from the user except permission to install.

Difference Between SilverLight Versions
UserControl Behavior
1) UserControl.Content is a protected property in Silverlight 3, but a public property in Silverlight 4. As an internal parser behavior, the Silverlight 3 XAML parser (and markup compiler) can set UserControl.Content for a UserControl with its XAML content, as long as a value for x:Class is specified.
2) Property names in Setter.Property and TemplateBinding are case-insensitive in Silverlight 3, but are processed case-sensitive in Silverlight 4.
3) In Silverlight 3, attached properties with only a static setter could be used from XAML. In Silverlight 4, they require a static getter and a static setter.
4) Silverlight 3 parses an enumeration with an initialization text value, it produces an integer value. Silverlight 4 will instead produce the enumeration value.
5) In some circumstances, you can set the same property multiple times in Silverlight 3 XAML, if it is a non-core property with exclusively non-native implementation. Silverlight 4 never allows this and will throw a XAML parse exception.
6) Silverlight 3 only permits x:Key usage in the scope of a ResourceDictionary. Silverlight 4 also supports x:Key within any element usage where the backing type implements IDictionary.
7) In Silverlight 3, nonexistent entities from the XAML language XAML namespace (x:) are ignored. Silverlight 4 throws parse exceptions in this case if Silverlight does not have that entity in its definition of the XAML language.
8) Silverlight 3 supports mixed content and property elements in XAML. Silverlight 4 XAML and [MS-XAML] does not.
9) .NET Framework 3.0 = .NET Framework 2.0 + WCF + WPF + WF + WCS
10) .NET Frame Work 4.0 =.Net Framework 3.5 +3.5
New Control In SilverLIght 4
RichTextBox Control
The RichTextBox control enables you to display, enter, and edit rich text. You can apply character or paragraph formatting to the text, display hyperlinks, and add inline images. For more information, see RichTextBox Overview.
Viewbox Control
The Viewbox control is a content decorator that takes one child element and stretches it or scales it to fit the size of the Viewbox. For more information, see Viewbox.
WebBrowser Control
The WebBrowser control provides a surface for displaying HTML content when the application runs outside the browser. For more information, see WebBrowser.
WebBrowserBrush Control
You can use the WebBrowserBrush control to display HTML content from a WebBrowser control. For example, you can use a WebBrowserBrush to paint the Fill of a shape such as a Rectangle or the geometry contents of a Path. For more information, see WebBrowserBrush.
What Is Out-of-Browser Support IN Silverlight 4
Window features including run-time resizing, always on top capability, and a Closing event that you can cancel.
Support for offline digital rights management (DRM).
HTML hosting with the WebBrowser control.
Popup alerts with the NotificationWindow class.
Support for elevated trust.
Improved support for debugging out-of-browser applications.
What is FallBack Value In SilverLight
Gets or sets the value to use when the binding is unable to return a value.