Well Hardit, we simply cant create new login id in SQL server.
We can only configure it.
Configure SQL Server 2005 Service Broker for the instance of SQL Server on the ServerSrc server
1. Connect to the instance on the ServerSrc server by using SQL Server Management Studio.
2. Run the following Transact-SQL statements in the query editor:
--Configure the transport security.
USE MASTER
go
--Create a master key in the master database.
CREATE MASTER KEY ENCRYPTION BY password = 'MasterKeyPassword'
Go
--Create a certificate for transport security.
CREATE CERTIFICATE ctfSourceServerMaster
FROM FILE = 'C:\Certificates\SourceServer.cer'
WITH PRIVATE KEY ( FILE = 'C:\Certificates\SourceServer.pvk' , DECRYPTION BY PASSWORD = 'PrivateKeyPassword' )
ACTIVE FOR BEGIN_DIALOG = ON
GO
--Create the login and the user to own a certificate.
CREATE LOGIN remcert WITH PASSWORD = 'LoginPassword'
GO
CREATE USER remcert FOR LOGIN remcert
GO
CREATE CERTIFICATE ctftTargetServerMaster
AUTHORIZATI ON remcert
FROM FILE = 'C:\Certificates\TargetServer.cer'
ACTIVE FOR BEGIN_DIALOG = ON
GO
--Create a new endpoint for SQL Server 2005 Service Broker, and set the AUTHENTICATION option to use the ctfSourceServerMaster certificate.
CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP
(
LISTENER_PORT = 4022
)
FOR SERVICE_BROKER (AUTHENTICATION = CERTIFICATE ctfSourceServerMaster)
GO
--Gra nt the required permissions to the remcert login.
GRANT CONNECT TO remcert
GRANT CONNECT ON ENDPOINT::BrokerEndpoint to remcert
GO
--Create a new database for testing.
CREATE DATABASE SourceDB
GO
USE SourceDB
GO
--Configure the dialog security.
--Create a master key in the SourceDB database.
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'MasterKeyPassword'
--Create a certificate for the SourceDB database.
CREATE CERTIFICATE ctfDlgSourceServer
FROM FILE = 'C:\certificates\DlgSourceServer.ce r'
WITH PRIVATE KEY
(FILE='C:\certificates\DlgSourceS erver.pvk',decryption by password='PrivateKeyPassword')
ACT IVE FOR BEGIN_DIALOG = ON
GO
--Create a user for the remcert login that owns a certificate for the dialog security.
CREATE USER remcert for LOGIN remcert
GO
CREATE CERTIFICATE ctfDlgTargetServer
AUTHORIZATION remcert
FROM FILE = 'C:\certificates\DlgTargetServer.ce r'
ACTIVE FOR BEGIN_DIALOG = ON
--Create a message type, a contract, a queue, and a service.
CREATE MESSAGE TYPE [mymsg] VALIDATION = NONE
CREATE CONTRACT [mycon] ([mymsg] SENT BY ANY)
CREATE QUEUE [myQueue]
CREATE SERVICE [SourceService] ON QUEUE [myQueue]([mycon])
GO
--Grant the send permission to the user.
GRANT SEND ON SERVICE::[SourceService] TO remcert
--Create a remote service binding for the target service.
CREATE REMOTE SERVICE BINDING [Certificate_Binding_on_server]
TO SERVICE 'TargetService'
WITH USER = remcert,
ANONYMOUS=Off
--Create a route for the target service.
CREATE ROUTE [myRoute]
WITH
SERVICE_NAME = 'TargetService',
address = 'TCP://ServerTag:4022'
For more details , Please visit the source site :
http://support.microsoft.com/k b/915852
Answered by
Alok Gupta
, an ibibo Guru,
at
11:01 AM on May 21, 2008