Showing posts with label message. Show all posts
Showing posts with label message. Show all posts

Sunday, 25 March 2012

CONNECT TO SERVER PROBLEM

I am getting this message when trying to connect to SQL SERVER 2005;
An error has occurred while establishing connection to the server.When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections(provider:shared memory provider , error 40-could not open a connection to SQL Server)(MicrosoftSQL SERVER, Error: 2)
Can anyone help to fix this problem please

Are you using SQL Express? If so, you need to enable remote connections. They are disabled by default.

Thanks,
Sam Lester (MSFT)

|||SQL SERVER 2005, STANDART
|||

On the server execute these statements:

sp_configure 'remote admin connections', 1

go

reconfigure

go

Then you should be able to connect from a client workstation.

Tuesday, 20 March 2012

Connect to a server from client

I'm receiving ths following error message when I try to connect to my server:
Cannot generate SSPI context. (.Net SqlClient Data Provider)
An idea?
Check this article:
http://blogs.msdn.com/sql_protocols/archive/2005/10/19/482782.aspx
Ayad Shammout
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:C22E4CA3-2289-47B0-B009-C7D63E590B78@.microsoft.com...
> I'm receiving ths following error message when I try to connect to my
> server:
> Cannot generate SSPI context. (.Net SqlClient Data Provider)
> An idea?

Monday, 19 March 2012

Connect SQL server 2005 with ODBC drive “SQL Native Client"

Hi,

When I'm using SQL server 2005, and ODBC drive “SQL Native Client” I get an error when executing the below given code. Error Message: “Transaction cannot start because more than one ODBC connection is in use.”

But this works well with SQL Server 2000 with ODBC drive "SQL Native Client" and in SQL server 2005 also when I used ODBC drive “SQL Server”.

I used aTrgConn.Execute(“Begin Transaction”) and it's working properly. But unfortunately I cannot use this method, because I want to run the same code with Oracle ODBC as well.

Is this a known issue in SQL Native client drive with SQL server 2005? Do you know a solution for this?

Please Help..............

Thanks in advance.

Code:

Dim aTrgConn As New ADODB.connection
Dim aCmdIns As New ADODB.Command
Dim aCmdUpd As New ADODB.Command

aTrgConn.Open sConnStr

Set aCmdIns.ActiveConnection = aTrgConn
Set aCmdUpd.ActiveConnection = aTrgConn

aTrgConn.BeginTrans

Why are you using two separate commands here? Couldn't you just use one command and reset the values to execute?|||

Hi John,

You are correct. but I'm afraid, it's very difficult to change the design at this stage. and it worked perfectly with SQL Server 2000.

Thank you very much for your response.

|||

Hi Again,

I think the problem comes when using the provider as MSDASQL.1 , with SQL server 2005 Native Client.

When I add "Provider=SQLNCLI;Integrated Security=SSPI;DataTypeCompatibility=80;MARS Connection=True;" to my connection string, it works correctly.

But again, I need the same coding to access oracle too. so SQLNCLI won't work with that.

It's really appriciated, If anyone could find a solution to this.

Thanks

|||

Hi,

I have the same problem with my application.

I began to use SQL Express 2005 with Native Client ODBC rather than MSDE and found the same error.

My application must works with several databases.

If anyone find a solution for this problem tell me too.

Thanks advanced,

Wendel

|||

Do you see the same problem with SQLNCLI OLEDB provider and not using MARS?

Thanks

Waseem

Connect SQL server 2005 with ODBC drive “SQL Native Client"

Hi,

When I'm using SQL server 2005, and ODBC drive “SQL Native Client” I get an error when executing the below given code. Error Message: “Transaction cannot start because more than one ODBC connection is in use.”

But this works well with SQL Server 2000 with ODBC drive "SQL Native Client" and in SQL server 2005 also when I used ODBC drive “SQL Server”.

I used aTrgConn.Execute(“Begin Transaction”) and it's working properly. But unfortunately I cannot use this method, because I want to run the same code with Oracle ODBC as well.

Is this a known issue in SQL Native client drive with SQL server 2005? Do you know a solution for this?

Please Help..............

Thanks in advance.

Code:

Dim aTrgConn As New ADODB.connection
Dim aCmdIns As New ADODB.Command
Dim aCmdUpd As New ADODB.Command

aTrgConn.Open sConnStr

Set aCmdIns.ActiveConnection = aTrgConn
Set aCmdUpd.ActiveConnection = aTrgConn

aTrgConn.BeginTrans

Why are you using two separate commands here? Couldn't you just use one command and reset the values to execute?|||

Hi John,

You are correct. but I'm afraid, it's very difficult to change the design at this stage. and it worked perfectly with SQL Server 2000.

Thank you very much for your response.

|||

Hi Again,

I think the problem comes when using the provider as MSDASQL.1 , with SQL server 2005 Native Client.

When I add "Provider=SQLNCLI;Integrated Security=SSPI;DataTypeCompatibility=80;MARS Connection=True;" to my connection string, it works correctly.

But again, I need the same coding to access oracle too. so SQLNCLI won't work with that.

It's really appriciated, If anyone could find a solution to this.

Thanks

|||

Hi,

I have the same problem with my application.

I began to use SQL Express 2005 with Native Client ODBC rather than MSDE and found the same error.

My application must works with several databases.

If anyone find a solution for this problem tell me too.

Thanks advanced,

Wendel

|||

Do you see the same problem with SQLNCLI OLEDB provider and not using MARS?

Thanks

Waseem

Connect SQL server 2005 with ODBC drive “SQL Native Client"

Hi,

When I'm using SQL server 2005, and ODBC drive “SQL Native Client” I get an error when executing the below given code. Error Message: “Transaction cannot start because more than one ODBC connection is in use.”

But this works well with SQL Server 2000 with ODBC drive "SQL Native Client" and in SQL server 2005 also when I used ODBC drive “SQL Server”.

I used aTrgConn.Execute(“Begin Transaction”) and it's working properly. But unfortunately I cannot use this method, because I want to run the same code with Oracle ODBC as well.

Is this a known issue in SQL Native client drive with SQL server 2005? Do you know a solution for this?

Please Help..............

Thanks in advance.

Code:

Dim aTrgConn As New ADODB.connection
Dim aCmdIns As New ADODB.Command
Dim aCmdUpd As New ADODB.Command

aTrgConn.Open sConnStr

Set aCmdIns.ActiveConnection = aTrgConn
Set aCmdUpd.ActiveConnection = aTrgConn

aTrgConn.BeginTrans

Why are you using two separate commands here? Couldn't you just use one command and reset the values to execute?|||

Hi John,

You are correct. but I'm afraid, it's very difficult to change the design at this stage. and it worked perfectly with SQL Server 2000.

Thank you very much for your response.

|||

Hi Again,

I think the problem comes when using the provider as MSDASQL.1 , with SQL server 2005 Native Client.

When I add "Provider=SQLNCLI;Integrated Security=SSPI;DataTypeCompatibility=80;MARS Connection=True;" to my connection string, it works correctly.

But again, I need the same coding to access oracle too. so SQLNCLI won't work with that.

It's really appriciated, If anyone could find a solution to this.

Thanks

|||

Hi,

I have the same problem with my application.

I began to use SQL Express 2005 with Native Client ODBC rather than MSDE and found the same error.

My application must works with several databases.

If anyone find a solution for this problem tell me too.

Thanks advanced,

Wendel

|||

Do you see the same problem with SQLNCLI OLEDB provider and not using MARS?

Thanks

Waseem

Sunday, 11 March 2012

Connect IIS to sql server 2005 db

I have developed a website that connected to sql2000 db

Now that I have upgraded to SQLserver2005, I always get the follwing message after launching the website:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/iisHelp/common/500-100.asp, line 11 Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP Dim strMethod, lngPos, datNow, strQueryString, strURL --^

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][Gestionnaire de pilotes ODBC] Source de donnes introuvable et nom de pilote non spcifi

/FMCQ_Web/Include/Modules/modADO.asp, line 18

I have tried different things (security access, DSN, etc...)but seems that nothing is working,

Can someone out there suggest a move to get this going..

The error is so obvious:

Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP Dim strMethod, lngPos, datNow, strQueryString, strURL

Change to two lines:

Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP

Dim strMethod, lngPos, datNow, strQueryString, strURL

Hope this helps!
Joe

Connect Delphi 2006 to MS SQL Express

I use Delphi 2006 to connect MS SQL Express 2005. When I save record, it shows the following error message:

Database Server Error : Cannot create new transaction because capacity was exceeded.

Does anyone know what happen and how to solve?

Thanks!

A quick MSN Search finds http://bdn.borland.com/article/0,1410,32020,00.html with the following solution:

When using dbExpress MSSQL and TClientDataSet.ApplyUpdates,
you may encounter either of the following errors while
applying updates, due to a SQLOLEDB.DLL limitation:

"Cannot create new transaction because capacity was exceeded."

"Cannot create new connection because in manual or
distributed transaction mode."

To resolve the errors, use one of the following workarounds:

- On the DataSetProvider Options property, make sure
poFetchBlobsOnDemand and poFetchDetailsOnDemand are False.

- Use a BeforeApplyUpdates event to either call CloseDataSets
or Close the connection:

procedure TForm1.DataSetProvider1BeforeApplyUpdates(Sender: TObject;
var OwnerData: OleVariant);
begin
SQLConnection1.CloseDataSets;
// SQLConnection1.Close;
end;


Regards,

Mike Wachal
SQL Express team

-
Check out my tips for getting your answer faster and how to ask a good question: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=307712&SiteID=1

Thursday, 8 March 2012

connec to sql express

at work, I'm trying to use Native client under ODBC to connect to another pc have the SQl Expess server, but never get connect. the message said the sql express may not allow remote connect.

I run a test, install sql express at home and install native client on the second pc and get connect easily.

So what do I miss here. Please help. thanks

You need to explicitly enable remote connections for SQL Express since they are off by default. You can enable them during install using the DISABLENETWORKPROTOCOLS flag:

(From template.ini)

;--
; The DISABLENETWORKPROTOCOLS switch is used to disable network protocol for SQL Server instance.
; Set DISABLENETWORKPROTOCOLS = 0; for Shared Memory= On, Named Pipe= On, TCP= On
; Set DISABLENETWORKPROTOCOLS = 1; for Shared Memory= On, Named Pipe= Off (Local Only), TCP= Off
; Set DISABLENETWORKPROTOCOLS = 2; for Shared Memory= On, Named Pipe= Off (Local Only), TCP= On

; Note: DISABLENETWORKPROTOCOLS if not specified has the following defaults.
; Default value for SQL Server Express/Evaluation/Developer: DISABLENETWORKPROTOCOLS =1
; Default value for Enterprise/Standard /Workgroup: DISABLENETWORKPROTOCOLS =2

or after install using TSQL or following this blog:

http://support.microsoft.com/kb/914277

Thanks,
Sam Lester (MSFT)

|||

Tried it, still not connect. Any other way? Thanks

Confusion over @@ROWCOUNT test

I have a pair of services.

One is an initiator of a conversation, another is a target. I have a pair of message types, one sent by the initiator one sent by the target.

I have a pair of queues corresponding to the above services. Both queues have activation stored procedures associate with them.

The intiiator sends its mesage to the queue that the target service is defined on.

The activation procedure successfully retrieves the message, does some work and then sends a reply message on the same conversation to the initiating service.

At this point behavior seems to become strange.

Some of the time the send from the target service produces the "zero length message" error and indeed at times the message body is empty - while at others (no code changes just another trial send) it is not.

All of the time the RECEIVE on the Initiator's queue executed by the Activated Procedure (in response to the target sending a reply) gives a @.@.ROWCOUNT = 0 (i.e. even when there are no errors generated)

However in this case, the message_body field contains the (target sent, reply) message

The Target RECEIVE and its SEND reply are both executed within the same transaction and the SEND is performed by a stored procedure call passing the conversation handle (inter alia) as a parameter.

The Initiator's queue (with RETENTION = ON) then shows 2 messages in it, one is the reply message (with a status of 0) and the other is the original message (sent by the initiator with status of 3)

All services and queues and Activation procedures are in the same database. Dialog encryption is off.

The intial SEND is done by a simple driver stored procedure in the same database

The security context of the Activation procedures for the 2 queues is - as far as I can tell - the same.

Objects were all created in the dbo security context.

The "work" involves updates to tables in the local database.

No doubt, I have done something stupid somewhere and am incapable of recognising it, but (apart from the work performed by the target procedure) what I have done appears to be no more than the above, using Service Broker SQL copied from examples, with my identifiers substituted for queue names, etc.

Any thoughts anyone?

rrkk wrote:

Some of the time the send from the target service produces the "zero length message" error and indeed at times the message body is empty - while at others (no code changes just another trial send) it is not.

I'm not familiar with the "zero length message" error. Can you post the actual SQL error message?

rrkk wrote:

The Initiator's queue (with RETENTION = ON) then shows 2 messages in it, one is the reply message (with a status of 0) and the other is the original message (sent by the initiator with status of 3)

Status = 0 indicates a message that was RECEIVEd from the queue (was already returned in a RECEIVE resultset). In your send script, are you trying to RECEIVE the reply as well? This RECEIVE will conflict with the activated procedure's RECEIVE.

HTH,
~ Remus

|||

Thanks for the reply.

The RECEIVE of the reply messsage takes place in a different stored procedure from the one that executes the SEND. It is however, of course, associated with the same service (as its Activation Procedure) that is used in the sending stored procedure's FROM SERVICE clause in the BEGIN DIALOG statement.

To my - uninitiated eye - it looks almost like a timing or threading issue. After all, all of this activity is taking place inside the same database: one stored proc sends a message (on one queue), another is activated to receive, it then sends a reply (on another queue) which causes another store procedure to be activated to consume the reply.

This of course, is a deliberately "simple" set up to facilitate learning of how Service Broker works. In a production environement there would be external components also.

The text of the message is:

The message body may not be NULL. A zero-length UNICODE or binary string is allowed

.... which from my reading is a designed behaviour in the case of a response (Target) message that is in fact empty.

My puzzle is that the appearance of this error seems intermittent. The only candidate cause for an empty messsage is a string concatenation operation on a variable that is populated from data RECEIVED. If this were to be NULL, etc, this would explain it.

However, the SEND/RECEIVE code does not change from trial to trial. Extra "PRINTs" are added, @.@.ROWCOUNT tests are replaced by "IF @.message_body IS NULL" (in the procedure that recieves the reply message) tests - but processing logic does not change at any of the endpoints.

|||

Just a shot in the dark, but are you RECEIVEing the message_body into a @.variable and then SENDing back a response of the same @.variable w/o actually checking the message_type_name received? My guess is that you are treating all message types the same way, incuding the EndDialog message, that is part of every dialog and has a NULL message body.

Posting the actual stored procs you have might help.

HTH,
~ Remus

|||

Remus,

thank you very much for your replies. It will probably turn out just to be "noise" born of ignorance, so I very mcuh appreciate your help.

When I show up at work on Monday I will do so

Cheers,

Roger

|||

Remus,

Here is the code that is running (sic!).

Please bear in mind that it is pretty much still in the experimental stage with no thought yet being given to optimisation or robustness, etc. - but simply to get a sound grasp of how things work.

Thanks

Roger

=====>>>


-- *********** Service Broker Objects
alter QUEUE dbo.SurveySetQueue WITH
STATUS = ON,
ACTIVATION (
STATUS = ON,
PROCEDURE_NAME = ShredSurveySet,
MAX_QUEUE_READERS = 1,
EXECUTE AS 'dbo'
)
ALTER QUEUE dbo.ParseRequestsQueue
WITH
STATUS = ON,
RETENTION = ON,
ACTIVATION (
STATUS = ON,
PROCEDURE_NAME = UpdateSetParseState,
MAX_QUEUE_READERS = 1,
EXECUTE AS 'dbo'
)

CREATE MESSAGE TYPE SurveySetMessage VALIDATION = WELL_FORMED_XML;
CREATE MESSAGE TYPE ParseOutcomeMessage VALIDATION = WELL_FORMED_XML;

CREATE CONTRACT SurveySetContract (
SurveySetMessage SENT BY INITIATOR,
ParseOutcomeMessage SENT BY TARGET
);

CREATE SERVICE SurveySetService ON QUEUE SurveySetQueue (SurveySetContract);
GO

CREATE SERVICE ParseRequestsService ON QUEUE ParseRequestsQueue (SurveySetContract);
GO

-- ***********

-- ******** STORED PROCS

-- ************* Initial sending procedure:

ALTER PROCEDURE SendParseRequestMessage(@.SetId int)
AS
BEGIN
DECLARE @.message XML ;

BEGIN TRY
BEGIN TRANSACTION ;

UPDATE CustomerSetMap SET State = 1 WHERE SetId = @.SetId -- AND State = 0;

SET @.message = N'<SetId>' + CAST(@.SetId AS nvarchar(10)) + N'</SetId>';

-- Declare a variable to hold the conversation
-- handle.
DECLARE @.conversationHandle UNIQUEIDENTIFIER ;

-- Begin the dialog.
BEGIN DIALOG CONVERSATION @.conversationHandle
FROM SERVICE ParseRequestsService
TO SERVICE 'SurveySetService'
ON CONTRACT SurveySetContract
WITH ENCRYPTION = OFF;

-- Send the message on the dialog.
SEND ON CONVERSATION @.conversationHandle
MESSAGE TYPE SurveySetMessage
(@.message) ;


COMMIT TRANSACTION ;

END TRY


BEGIN CATCH
ROLLBACK TRANSACTION
exec LogError
END CATCH

END

- Procedeure activates as the result of the initial SEND
ALTER PROCEDURE ShredSurveySet
AS
BEGIN
SET NOCOUNT ON;

DECLARE @.message_body XML,
@.message_type_name NVARCHAR(256),
@.dialog UNIQUEIDENTIFIER,
@.ErrorMessage nvarchar(max);


DECLARE @.SetId int,
@.SurveyXml xml,
@.SurveyId uniqueidentifier,
@.conversation_group_id uniqueidentifier,
@.CursorDefined bit;

-- One at a time for development purposes
BEGIN TRY
BEGIN TRANSACTION ;

SET @.CursorDefined = 0;
SET @.SurveyXml = null;

-- Receive the next available message
WAITFOR (
RECEIVE TOP(1) -- just handle one message at a time
@.message_type_name=message_type_name, --the type of message received
@.message_body=
CASE
WHEN validation = 'X' THEN CAST(message_body AS XML)
ELSE CAST(N'<none/>' AS XML)
END, -- the message contents
@.dialog = conversation_handle -- the identifier of the dialog this message was received on
FROM [dbo].SurveySetQueue
), TIMEOUT 2000 ; -- if the queue is empty for two seconds, give up and go away

IF (@.@.ROWCOUNT = 0) --@.SurveyXml is null --(
BEGIN
print 'no rows'
print cast(@.dialog as nvarchar(50));

-- For development purposes do not try any
-- poison message handling due to consecutive rollbacks
COMMIT TRANSACTION ;
RETURN ;
END ;

-- Check to see if the message is an end dialog message.
IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog')
BEGIN
PRINT 'End Dialog received for dialog # ' + cast(@.dialog as nvarchar(40)) ;
END CONVERSATION @.dialog ;
END ;

-- Error?
IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/Error')
BEGIN
SET @.ErrorMessage = CAST(@.message_body as nvarchar(max));
RAISERROR( @.ErrorMessage, 1, 1);
RETURN;
END

-- Extract the data element information using XQuery.

SET @.SetId = @.message_body.value('(/SetId)[1]', 'int');

--select @.SetId;

-- ********* This is the DB work section

DECLARE Survey_Cursor Cursor LOCAL FOR SELECT top 5 SurveyId FROM [WSS Surveys] WHERE SetId = @.SetId ORDER BY Ordinal;
SET @.CursorDefined = 1;

OPEN Survey_Cursor;

FETCH NEXT FROM Survey_Cursor INTO @.SurveyId;

-- Shred XML into a table set
WHILE @.@.FETCH_STATUS = 0
BEGIN
EXEC MakeXMLSurveyTempTables1 @.SurveyId;
FETCH NEXT FROM Survey_Cursor INTO @.SurveyId;
END

CLOSE Survey_Cursor;
DEALLOCATE Survey_Cursor;
SET @.CursorDefined = 0;
-- ******************

-- ******** The Reply
-- Send a message back to the originating service
-- indicating success
EXEC SendParseUpdateMessage @.dialog, @.SetId, 2;

COMMIT TRANSACTION ;

END TRY
BEGIN CATCH
IF (XACT_STATE()) = -1
ROLLBACK TRANSACTION;

-- Send a message back to the originating service
-- indicating error
EXEC SendParseUpdateMessage @.dialog, @.SetId, 9;

-- Deaalocate cursor if necessary
IF @.CursorDefined = 1
DEALLOCATE Survey_Cursor;

-- Write to error table
EXEC LogError;
END CATCH;
--END;
END

-- Procedure that sends the reply
ALTER PROCEDURE dbo.SendParseUpdateMessage(@.conversationHandle UNIQUEIDENTIFIER, @.SetId int, @.State smallint)
AS
BEGIN
DECLARE @.message XML ;

BEGIN TRY

SET @.message = N'<UpdateState><SetId>' + CAST(@.SetId AS nvarchar(10)) + N'</SetId><State>' +
CAST(@.State AS nvarchar(4)) + N'</State></UpdateState>';

-- Send the message on the dialog.
SEND ON CONVERSATION @.conversationHandle
MESSAGE TYPE ParseOutcomeMessage
(@.message) ;

-- print 'message sent' + cast(@.message as nvarchar(max));


END TRY
BEGIN CATCH

EXEC LogError
END CATCH

END

-- This is the Activation stored proc for processing the reply
ALTER PROCEDURE dbo.UpdateSetParseState
AS
BEGIN
SET NOCOUNT ON;

DECLARE @.message_body XML,
@.message_type_name NVARCHAR(256),
@.dialog UNIQUEIDENTIFIER,
@.ErrorMessage nvarchar(max);

DECLARE @.SetId int,
@.State smallint;

-- One at a time for development purposes
BEGIN TRY
BEGIN TRANSACTION ;


SET @.message_body = null;

-- Receive the next available message
WAITFOR (
RECEIVE TOP(1) -- just handle one message at a time
@.message_type_name=message_type_name, --the type of message received
@.message_body=message_body, -- the message contents
@.dialog = conversation_handle -- the identifier of the dialog this message was received on
FROM ParseRequestsQueue
), TIMEOUT 2000 ; -- if the queue is empty for two seconds, give up and go away

-- ***** So far always 0
print 'rowcount = ' + cast(@.@.ROWCOUNT as nvarchar(10));

-- *******************************************
-- *******************************************
--
-- THIS IS WHERE I AM PUZZLED
--
-- *******************************************
-- *******************************************

--IF (@.@.ROWCOUNT = 0)
IF @.message_body IS NULL
BEGIN

-- NO poison handling due to repeated rollbacks
COMMIT TRANSACTION;
Print ' no rows: parse update'
RETURN;

END ;

-- Check to see if the message is an end dialog message.

IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog')
BEGIN
PRINT 'End Dialog received for dialog # ' + cast(@.dialog as nvarchar(40)) ;
END CONVERSATION @.dialog;
RETURN
END

-- Error?
IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/Error')
BEGIN
SET @.ErrorMessage = CAST(@.message_body as nvarchar(max));
RAISERROR( @.ErrorMessage, 1, 1);
RETURN;
END

-- *** Proceed ...

-- *** This will run successfully despite @.@.ROWCOUNT = 0

-- Extract the event information using XQuery.
SET @.SetId = @.message_body.value('(/UpdateState/SetId)[1]', 'int');
SET @.State = @.message_body.value('(/UpdateState/State)[1]', 'smallint');

UPDATE CustomerSetMap SET State = @.State WHERE SetId = @.SetId AND (State = 1 or State = 9);

-- END CONVERSATION @.dialog;

COMMIT TRANSACTION;
END TRY

BEGIN CATCH
IF (XACT_STATE()) = -1
ROLLBACK TRANSACTION;

EXEC LogError
END CATCH

END

|||

Hello Roger,

If the ShredSurveySet throws an exception which leaves the transaction commitable, the XACT_STATE() will be 1. Your CATCH block will not commit this transaction and as such the procedure will exit with an unbalanced BEGIN TRY/COMMIT pair, resulting in a nastygram in the ERRORLOG:

2006-11-06 14:14:32.69 spid52s The activated proc [dbo].[ShredSurveySet] running on queue testNG.dbo.SurveySetQueue output the following: 'Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.'

Do you have any such messages in your ERROLOG? BTW, an example of a situation that throw an exception that leaves the pending transaction context commitable is trying to SEND a NULL message body...

As about the sender's procedure never getting a @.@.ROWCOUNT, it seems to me you're never activated because of a incomming message. There are cases when activation will start the procedure even though there are no messages to receive and it seems your hitting such case.

My recommendation would be to test the procedures first manually, w/o activation. Send a message, then run the target's procedure by calling manualy EXEC, verify the response was sent (SELLECT ... FROM ParseRequestsQueue) and then run the sender's procedure manually. Only after you're satisfied with this results turn on activation.

HTH,
~ Remus

|||

I hit exactly this issue because I expected the activation procedure only to be activated if there were messages to consume. What I found that was that activation occurs when the message is received, my sp processed the message on the queue and completed. Activation the fire up another SP almost as a catch all, I wasn't verifying that a message was actually received from the queue so my logic fired twice.

So the morale of the story is, always check the @.@.rowcount after receiving a message

Confusion over @@ROWCOUNT test

I have a pair of services.

One is an initiator of a conversation, another is a target. I have a pair of message types, one sent by the initiator one sent by the target.

I have a pair of queues corresponding to the above services. Both queues have activation stored procedures associate with them.

The intiiator sends its mesage to the queue that the target service is defined on.

The activation procedure successfully retrieves the message, does some work and then sends a reply message on the same conversation to the initiating service.

At this point behavior seems to become strange.

Some of the time the send from the target service produces the "zero length message" error and indeed at times the message body is empty - while at others (no code changes just another trial send) it is not.

All of the time the RECEIVE on the Initiator's queue executed by the Activated Procedure (in response to the target sending a reply) gives a @.@.ROWCOUNT = 0 (i.e. even when there are no errors generated)

However in this case, the message_body field contains the (target sent, reply) message

The Target RECEIVE and its SEND reply are both executed within the same transaction and the SEND is performed by a stored procedure call passing the conversation handle (inter alia) as a parameter.

The Initiator's queue (with RETENTION = ON) then shows 2 messages in it, one is the reply message (with a status of 0) and the other is the original message (sent by the initiator with status of 3)

All services and queues and Activation procedures are in the same database. Dialog encryption is off.

The intial SEND is done by a simple driver stored procedure in the same database

The security context of the Activation procedures for the 2 queues is - as far as I can tell - the same.

Objects were all created in the dbo security context.

The "work" involves updates to tables in the local database.

No doubt, I have done something stupid somewhere and am incapable of recognising it, but (apart from the work performed by the target procedure) what I have done appears to be no more than the above, using Service Broker SQL copied from examples, with my identifiers substituted for queue names, etc.

Any thoughts anyone?

rrkk wrote:

Some of the time the send from the target service produces the "zero length message" error and indeed at times the message body is empty - while at others (no code changes just another trial send) it is not.

I'm not familiar with the "zero length message" error. Can you post the actual SQL error message?

rrkk wrote:

The Initiator's queue (with RETENTION = ON) then shows 2 messages in it, one is the reply message (with a status of 0) and the other is the original message (sent by the initiator with status of 3)

Status = 0 indicates a message that was RECEIVEd from the queue (was already returned in a RECEIVE resultset). In your send script, are you trying to RECEIVE the reply as well? This RECEIVE will conflict with the activated procedure's RECEIVE.

HTH,
~ Remus

|||

Thanks for the reply.

The RECEIVE of the reply messsage takes place in a different stored procedure from the one that executes the SEND. It is however, of course, associated with the same service (as its Activation Procedure) that is used in the sending stored procedure's FROM SERVICE clause in the BEGIN DIALOG statement.

To my - uninitiated eye - it looks almost like a timing or threading issue. After all, all of this activity is taking place inside the same database: one stored proc sends a message (on one queue), another is activated to receive, it then sends a reply (on another queue) which causes another store procedure to be activated to consume the reply.

This of course, is a deliberately "simple" set up to facilitate learning of how Service Broker works. In a production environement there would be external components also.

The text of the message is:

The message body may not be NULL. A zero-length UNICODE or binary string is allowed

.... which from my reading is a designed behaviour in the case of a response (Target) message that is in fact empty.

My puzzle is that the appearance of this error seems intermittent. The only candidate cause for an empty messsage is a string concatenation operation on a variable that is populated from data RECEIVED. If this were to be NULL, etc, this would explain it.

However, the SEND/RECEIVE code does not change from trial to trial. Extra "PRINTs" are added, @.@.ROWCOUNT tests are replaced by "IF @.message_body IS NULL" (in the procedure that recieves the reply message) tests - but processing logic does not change at any of the endpoints.

|||

Just a shot in the dark, but are you RECEIVEing the message_body into a @.variable and then SENDing back a response of the same @.variable w/o actually checking the message_type_name received? My guess is that you are treating all message types the same way, incuding the EndDialog message, that is part of every dialog and has a NULL message body.

Posting the actual stored procs you have might help.

HTH,
~ Remus

|||

Remus,

thank you very much for your replies. It will probably turn out just to be "noise" born of ignorance, so I very mcuh appreciate your help.

When I show up at work on Monday I will do so

Cheers,

Roger

|||

Remus,

Here is the code that is running (sic!).

Please bear in mind that it is pretty much still in the experimental stage with no thought yet being given to optimisation or robustness, etc. - but simply to get a sound grasp of how things work.

Thanks

Roger

=====>>>


-- *********** Service Broker Objects
alter QUEUE dbo.SurveySetQueue WITH
STATUS = ON,
ACTIVATION (
STATUS = ON,
PROCEDURE_NAME = ShredSurveySet,
MAX_QUEUE_READERS = 1,
EXECUTE AS 'dbo'
)
ALTER QUEUE dbo.ParseRequestsQueue
WITH
STATUS = ON,
RETENTION = ON,
ACTIVATION (
STATUS = ON,
PROCEDURE_NAME = UpdateSetParseState,
MAX_QUEUE_READERS = 1,
EXECUTE AS 'dbo'
)

CREATE MESSAGE TYPE SurveySetMessage VALIDATION = WELL_FORMED_XML;
CREATE MESSAGE TYPE ParseOutcomeMessage VALIDATION = WELL_FORMED_XML;

CREATE CONTRACT SurveySetContract (
SurveySetMessage SENT BY INITIATOR,
ParseOutcomeMessage SENT BY TARGET
);

CREATE SERVICE SurveySetService ON QUEUE SurveySetQueue (SurveySetContract);
GO

CREATE SERVICE ParseRequestsService ON QUEUE ParseRequestsQueue (SurveySetContract);
GO

-- ***********

-- ******** STORED PROCS

-- ************* Initial sending procedure:

ALTER PROCEDURE SendParseRequestMessage(@.SetId int)
AS
BEGIN
DECLARE @.message XML ;

BEGIN TRY
BEGIN TRANSACTION ;

UPDATE CustomerSetMap SET State = 1 WHERE SetId = @.SetId -- AND State = 0;

SET @.message = N'<SetId>' + CAST(@.SetId AS nvarchar(10)) + N'</SetId>';

-- Declare a variable to hold the conversation
-- handle.
DECLARE @.conversationHandle UNIQUEIDENTIFIER ;

-- Begin the dialog.
BEGIN DIALOG CONVERSATION @.conversationHandle
FROM SERVICE ParseRequestsService
TO SERVICE 'SurveySetService'
ON CONTRACT SurveySetContract
WITH ENCRYPTION = OFF;

-- Send the message on the dialog.
SEND ON CONVERSATION @.conversationHandle
MESSAGE TYPE SurveySetMessage
(@.message) ;


COMMIT TRANSACTION ;

END TRY


BEGIN CATCH
ROLLBACK TRANSACTION
exec LogError
END CATCH

END

- Procedeure activates as the result of the initial SEND
ALTER PROCEDURE ShredSurveySet
AS
BEGIN
SET NOCOUNT ON;

DECLARE @.message_body XML,
@.message_type_name NVARCHAR(256),
@.dialog UNIQUEIDENTIFIER,
@.ErrorMessage nvarchar(max);


DECLARE @.SetId int,
@.SurveyXml xml,
@.SurveyId uniqueidentifier,
@.conversation_group_id uniqueidentifier,
@.CursorDefined bit;

-- One at a time for development purposes
BEGIN TRY
BEGIN TRANSACTION ;

SET @.CursorDefined = 0;
SET @.SurveyXml = null;

-- Receive the next available message
WAITFOR (
RECEIVE TOP(1) -- just handle one message at a time
@.message_type_name=message_type_name, --the type of message received
@.message_body=
CASE
WHEN validation = 'X' THEN CAST(message_body AS XML)
ELSE CAST(N'<none/>' AS XML)
END, -- the message contents
@.dialog = conversation_handle -- the identifier of the dialog this message was received on
FROM [dbo].SurveySetQueue
), TIMEOUT 2000 ; -- if the queue is empty for two seconds, give up and go away

IF (@.@.ROWCOUNT = 0) --@.SurveyXml is null --(
BEGIN
print 'no rows'
print cast(@.dialog as nvarchar(50));

-- For development purposes do not try any
-- poison message handling due to consecutive rollbacks
COMMIT TRANSACTION ;
RETURN ;
END ;

-- Check to see if the message is an end dialog message.
IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog')
BEGIN
PRINT 'End Dialog received for dialog # ' + cast(@.dialog as nvarchar(40)) ;
END CONVERSATION @.dialog ;
END ;

-- Error?
IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/Error')
BEGIN
SET @.ErrorMessage = CAST(@.message_body as nvarchar(max));
RAISERROR( @.ErrorMessage, 1, 1);
RETURN;
END

-- Extract the data element information using XQuery.

SET @.SetId = @.message_body.value('(/SetId)[1]', 'int');

--select @.SetId;

-- ********* This is the DB work section

DECLARE Survey_Cursor Cursor LOCAL FOR SELECT top 5 SurveyId FROM [WSS Surveys] WHERE SetId = @.SetId ORDER BY Ordinal;
SET @.CursorDefined = 1;

OPEN Survey_Cursor;

FETCH NEXT FROM Survey_Cursor INTO @.SurveyId;

-- Shred XML into a table set
WHILE @.@.FETCH_STATUS = 0
BEGIN
EXEC MakeXMLSurveyTempTables1 @.SurveyId;
FETCH NEXT FROM Survey_Cursor INTO @.SurveyId;
END

CLOSE Survey_Cursor;
DEALLOCATE Survey_Cursor;
SET @.CursorDefined = 0;
-- ******************

-- ******** The Reply
-- Send a message back to the originating service
-- indicating success
EXEC SendParseUpdateMessage @.dialog, @.SetId, 2;

COMMIT TRANSACTION ;

END TRY
BEGIN CATCH
IF (XACT_STATE()) = -1
ROLLBACK TRANSACTION;

-- Send a message back to the originating service
-- indicating error
EXEC SendParseUpdateMessage @.dialog, @.SetId, 9;

-- Deaalocate cursor if necessary
IF @.CursorDefined = 1
DEALLOCATE Survey_Cursor;

-- Write to error table
EXEC LogError;
END CATCH;
--END;
END

-- Procedure that sends the reply
ALTER PROCEDURE dbo.SendParseUpdateMessage(@.conversationHandle UNIQUEIDENTIFIER, @.SetId int, @.State smallint)
AS
BEGIN
DECLARE @.message XML ;

BEGIN TRY

SET @.message = N'<UpdateState><SetId>' + CAST(@.SetId AS nvarchar(10)) + N'</SetId><State>' +
CAST(@.State AS nvarchar(4)) + N'</State></UpdateState>';

-- Send the message on the dialog.
SEND ON CONVERSATION @.conversationHandle
MESSAGE TYPE ParseOutcomeMessage
(@.message) ;

-- print 'message sent' + cast(@.message as nvarchar(max));


END TRY
BEGIN CATCH

EXEC LogError
END CATCH

END

-- This is the Activation stored proc for processing the reply
ALTER PROCEDURE dbo.UpdateSetParseState
AS
BEGIN
SET NOCOUNT ON;

DECLARE @.message_body XML,
@.message_type_name NVARCHAR(256),
@.dialog UNIQUEIDENTIFIER,
@.ErrorMessage nvarchar(max);

DECLARE @.SetId int,
@.State smallint;

-- One at a time for development purposes
BEGIN TRY
BEGIN TRANSACTION ;


SET @.message_body = null;

-- Receive the next available message
WAITFOR (
RECEIVE TOP(1) -- just handle one message at a time
@.message_type_name=message_type_name, --the type of message received
@.message_body=message_body, -- the message contents
@.dialog = conversation_handle -- the identifier of the dialog this message was received on
FROM ParseRequestsQueue
), TIMEOUT 2000 ; -- if the queue is empty for two seconds, give up and go away

-- ***** So far always 0
print 'rowcount = ' + cast(@.@.ROWCOUNT as nvarchar(10));

-- *******************************************
-- *******************************************
--
-- THIS IS WHERE I AM PUZZLED
--
-- *******************************************
-- *******************************************

--IF (@.@.ROWCOUNT = 0)
IF @.message_body IS NULL
BEGIN

-- NO poison handling due to repeated rollbacks
COMMIT TRANSACTION;
Print ' no rows: parse update'
RETURN;

END ;

-- Check to see if the message is an end dialog message.

IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog')
BEGIN
PRINT 'End Dialog received for dialog # ' + cast(@.dialog as nvarchar(40)) ;
END CONVERSATION @.dialog;
RETURN
END

-- Error?
IF (@.message_type_name = 'http://schemas.microsoft.com/SQL/ServiceBroker/Error')
BEGIN
SET @.ErrorMessage = CAST(@.message_body as nvarchar(max));
RAISERROR( @.ErrorMessage, 1, 1);
RETURN;
END

-- *** Proceed ...

-- *** This will run successfully despite @.@.ROWCOUNT = 0

-- Extract the event information using XQuery.
SET @.SetId = @.message_body.value('(/UpdateState/SetId)[1]', 'int');
SET @.State = @.message_body.value('(/UpdateState/State)[1]', 'smallint');

UPDATE CustomerSetMap SET State = @.State WHERE SetId = @.SetId AND (State = 1 or State = 9);

-- END CONVERSATION @.dialog;

COMMIT TRANSACTION;
END TRY

BEGIN CATCH
IF (XACT_STATE()) = -1
ROLLBACK TRANSACTION;

EXEC LogError
END CATCH

END

|||

Hello Roger,

If the ShredSurveySet throws an exception which leaves the transaction commitable, the XACT_STATE() will be 1. Your CATCH block will not commit this transaction and as such the procedure will exit with an unbalanced BEGIN TRY/COMMIT pair, resulting in a nastygram in the ERRORLOG:

2006-11-06 14:14:32.69 spid52s The activated proc [dbo].[ShredSurveySet] running on queue testNG.dbo.SurveySetQueue output the following: 'Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.'

Do you have any such messages in your ERROLOG? BTW, an example of a situation that throw an exception that leaves the pending transaction context commitable is trying to SEND a NULL message body...

As about the sender's procedure never getting a @.@.ROWCOUNT, it seems to me you're never activated because of a incomming message. There are cases when activation will start the procedure even though there are no messages to receive and it seems your hitting such case.

My recommendation would be to test the procedures first manually, w/o activation. Send a message, then run the target's procedure by calling manualy EXEC, verify the response was sent (SELLECT ... FROM ParseRequestsQueue) and then run the sender's procedure manually. Only after you're satisfied with this results turn on activation.

HTH,
~ Remus

|||

I hit exactly this issue because I expected the activation procedure only to be activated if there were messages to consume. What I found that was that activation occurs when the message is received, my sp processed the message on the queue and completed. Activation the fire up another SP almost as a catch all, I wasn't verifying that a message was actually received from the queue so my logic fired twice.

So the morale of the story is, always check the @.@.rowcount after receiving a message

Saturday, 25 February 2012

Conflicts with Merge Replication

I am seeing the following conflict message in a merge replication
system.
Statler is the subscriber (also, remote distributor) and
EMGSQL1 is the publisher
The row was updated at Statler.Caryn but could not be updated
at emgsql1.caryn. Can not update Tlightbox because TlightboxFile
exists.
Column Conflight WinnerConflict Loser
lightbox_id19881988
member_id10531053
lb_nameCustomerCustwomer
create_dt5/13/2005 12:00:00 am5/13/2005 12:00:00 AM
last_mod_dt
expiration_dt8/11/2005 12:00:00 am8/11/2005 12:00:00 am
email_check{74434092-E95F-40B6-9211-99700DB
rowguidrowguid_valueidentical
the table definition for tlightbox is:
CREATE TABLE [dbo].[TLightBox] (
[lightbox_id] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[member_id] [int] NULL ,
[lb_name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[create_dt] [datetime] NULL ,
[last_mod_dt] [datetime] NULL ,
[expiration_dt] [datetime] NULL ,
[email_check] [uniqueidentifier] NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[TLightboxFile] (
[lightbox_id] [int] NOT NULL ,
[modeltalent_id] [int] NOT NULL ,
[rank] [int] NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
These tables are on both servers.
Any Ideas?
Thanks
Dave
what is the relationship between TLightBox and TLightBoxFile?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"David Gresham" <gresham@.panix.com> wrote in message
news:d62p39$lks$1@.reader1.panix.com...
> I am seeing the following conflict message in a merge replication
> system.
> Statler is the subscriber (also, remote distributor) and
> EMGSQL1 is the publisher
> The row was updated at Statler.Caryn but could not be updated
> at emgsql1.caryn. Can not update Tlightbox because TlightboxFile
> exists.
> Column Conflight Winner Conflict Loser
> lightbox_id 1988 1988
> member_id 1053 1053
> lb_name Customer Custwomer
> create_dt 5/13/2005 12:00:00 am 5/13/2005 12:00:00 AM
> last_mod_dt
> expiration_dt 8/11/2005 12:00:00 am 8/11/2005 12:00:00 am
> email_check {74434092-E95F-40B6-9211-99700DB
> rowguid rowguid_value identical
>
> the table definition for tlightbox is:
> CREATE TABLE [dbo].[TLightBox] (
> [lightbox_id] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
> [member_id] [int] NULL ,
> [lb_name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [create_dt] [datetime] NULL ,
> [last_mod_dt] [datetime] NULL ,
> [expiration_dt] [datetime] NULL ,
> [email_check] [uniqueidentifier] NULL ,
> [rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
> ) ON [PRIMARY]
> GO
>
> CREATE TABLE [dbo].[TLightboxFile] (
> [lightbox_id] [int] NOT NULL ,
> [modeltalent_id] [int] NOT NULL ,
> [rank] [int] NULL ,
> [rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
> ) ON [PRIMARY]
> GO
>
> These tables are on both servers.
>
> Any Ideas?
> Thanks
>
> Dave
>
|||In article <ek417yCWFHA.2960@.TK2MSFTNGP15.phx.gbl>,
Hilary Cotter <hilary.cotter@.gmail.com> wrote:
>what is the relationship between TLightBox and TLightBoxFile?
>
I just looked at the tables in question and there is no
defined releationship set between them. The only relationship
defined for TlightBox was for another table called TMember
with MemberID as the relationship column.

>"David Gresham" <gresham@.panix.com> wrote in message
>news:d62p39$lks$1@.reader1.panix.com...
>
|||Just seeing if I had given you all the info you needed for
this question. This database is a legacy database where
the original developers are no longer around. There
are no fk's that would join the two tables in question.
Sincerely,
Dave Gresham
In article <ek417yCWFHA.2960@.TK2MSFTNGP15.phx.gbl>,
Hilary Cotter <hilary.cotter@.gmail.com> wrote:
>what is the relationship between TLightBox and TLightBoxFile?
>--
>Hilary Cotter
>Looking for a SQL Server replication book?
>http://www.nwsu.com/0974973602.html
>Looking for a FAQ on Indexing Services/SQL FTS
>http://www.indexserverfaq.com
>"David Gresham" <gresham@.panix.com> wrote in message
>news:d62p39$lks$1@.reader1.panix.com...
>
|||Your problem does not make a whole lot of sense. the best approach is to try
to repro it.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"David Gresham" <gresham@.panix.com> wrote in message
news:d6algu$st6$1@.reader1.panix.com...
> Just seeing if I had given you all the info you needed for
> this question. This database is a legacy database where
> the original developers are no longer around. There
> are no fk's that would join the two tables in question.
> Sincerely,
>
> Dave Gresham
>
> In article <ek417yCWFHA.2960@.TK2MSFTNGP15.phx.gbl>,
> Hilary Cotter <hilary.cotter@.gmail.com> wrote:
>

Friday, 24 February 2012

Conflict Resolution

Is it possible to have a message or notification if/when conflicts occur?
Is this art of any standard resolver or does this require a custom resolver
to be created?
TIA
Tony S.
Tony,
you could use a custom resolver or regularly poll the conflict table.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul
Tony S.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23dijkUCxFHA.2212@.TK2MSFTNGP15.phx.gbl...
> Tony,
> you could use a custom resolver or regularly poll the conflict table.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Hi Paul,
Is there only one conflict table or one conflict table per db table ?
Is the conflict table stored in the SQLCE db or only at the SQL2000 DB ?
Thank you for your time
Panayotis
Paul Ibison wrote:
> Tony,
> you could use a custom resolver or regularly poll the conflict table.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Panos,
there'll be one per table in the format:
conflict_<PublicationName>_<ArticleName>_usertable name
These tables are stored at the publisher.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Conflict 'missing key', but the key is there !

Hello,
I use a merge replication and I can see many conflicts (in differents tables) having the same source error. The error message in Conflict viewer says:
The row was inserted at 'Publisher.DataBase' but could not be inserted at 'Subscriber.DataBase'. INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Table1_Table2'. The conflict occurred in database 'DataBase', table 'Table2', column 'ColKe
y'.
But I can see on Subscriber.DataBase, on Table2 that I have the row with the key that was reported as /missing' !!!
What this could means?
Does it means that SQL try to insert the new lines first in Table1 and after this insert in Table2? Is that possible if I have defined a relation between the 2 tables ?
Thanks in advance
Catalin,
firstly let me confirm:
are the two tables are articles in the same publication
have the PK and the FK been added at the publisher before synchrionization
after synchronization does the PK value make it to the subscriber (assuming
above is true)
Really the order should be OK, although there are known issues if you have
made a lot of changes
(http://support.microsoft.com/default.aspx?scid=kb;[LN];307356). The
recommended solution in the article is to increase
the -UploadGenerationsPerBatch parameter.
Regards,
Paul Ibison

Tuesday, 14 February 2012

Configuring Replication

When I try to configure using enterprise manager, at the last step, This
error message raised..
Error 18483: Could not connect to server 'GKBT' because 'distributor_admin'
is not defined as a remote login at the server
What s the problem?
Thank you
Thank you,
Registration name was '192.168.1.200' (Server IP), after your message, I ve
changed the name to server name 'GKBT', but this time error message is ;
Error 21112 - '-polling interval' is not a valid parameter for the log
readere agent
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:774001c4ce44$fd0de220$a601280a@.phx.gbl...
> If you are using an IP address to configure replication
> over non-trusted domains, you'll need to use the client
> network utility to configure an alias.
> Alternatively this could be a naming issue:
> This is usually a naming issue.
> Try:
> Use Master
> go
> Select @.@.Servername
> This should return your current server name but if it
> returns NULL then try:
> Use Master
> go
> Sp_DropServer 'ServerOldName'
> GO
> Use Master
> go
> Sp_Addserver 'ServerNewName', 'local'
> GO
> Stop and Start SQL Services
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Does replication work to any other server?
If not remove replication and reinstall it.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"BonGee" <Bongeeeee@.dotcom.com> wrote in message
news:OPHl6njzEHA.3416@.TK2MSFTNGP09.phx.gbl...
> When I try to configure using enterprise manager, at the last step, This
> error message raised..
> Error 18483: Could not connect to server 'GKBT' because
> 'distributor_admin'
> is not defined as a remote login at the server
> What s the problem?
> Thank you
>
|||PollingInterval is all one word, but don't change it on
the command line properties - leave those for parameters
that aren't included in the profile ie you can just put a
numerical value in a custom profile.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thank you but I installed MS 2000 2 hours before
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eirUXekzEHA.1296@.TK2MSFTNGP10.phx.gbl...
> Does replication work to any other server?
> If not remove replication and reinstall it.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> Now available for purchase at:
> http://www.nwsu.com/0974973602.html
> "BonGee" <Bongeeeee@.dotcom.com> wrote in message
> news:OPHl6njzEHA.3416@.TK2MSFTNGP09.phx.gbl...
>
|||By installing/removing replication, I mean going to the menu option in SQL
Server Enterprise Manager and selecting Tools, Replication, Disable
Replication to remove it, and then select Tools, Replication, Configure
Replicaiton to reinstall it.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"BonGee" <Bongeeeee@.dotcom.com> wrote in message
news:OKVrOikzEHA.1396@.tk2msftngp13.phx.gbl...
> Thank you but I installed MS 2000 2 hours before
>
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:eirUXekzEHA.1296@.TK2MSFTNGP10.phx.gbl...
>

Sunday, 12 February 2012

Configuring Environment for first time

Each time I start of SQL Server Management Studio, I get the following message "Microsoft SQL Server Management Studio configuring environment for first time".

I had a simiiliar message with Visual Studio 2005 and fixed it by setting the setting to look on local disk drive. I cannot find a similiar setting in SQL Server 2005.

Any suggestions on how to resolve?

mwharton - I have the same question. Did you find an answer anywhere?

Harold

Configuring Environment for first time

Each time I start of SQL Server Management Studio, I get the following message "Microsoft SQL Server Management Studio configuring environment for first time".

I had a simiiliar message with Visual Studio 2005 and fixed it by setting the setting to look on local disk drive. I cannot find a similiar setting in SQL Server 2005.

Any suggestions on how to resolve?

mwharton - I have the same question. Did you find an answer anywhere?

Harold

Configuring an SMTP server in IIS

This is a multi-part message in MIME format.
--=_NextPart_000_0006_01C5E69B.ABEE7CE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I am trying Configure an SMTP server in IIS for use with Windows = SharePoint Services in Windows 2003 Server
However, when I go to Control Panel -> Administration Tools -> IIS, = there is no default SMTP server to configure.
The only options when you expand IIS are
1. Application Pools
2. Web Site
3. Web Service Extensions
There is no Default Virtual SMTP Server option.
How do I add this option.
What I am trying to do is Relay all outgoing mail to a certain IP = Address but I cannot do this
if no Default Virtual SMTP Server option appears.
Any ideas
Thanks
Sanjeev
--=_NextPart_000_0006_01C5E69B.ABEE7CE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hi,

I am trying Configure an SMTP server in = IIS for use with Windows SharePoint Services in Windows 2003 Server
However, when I go to Control Panel = -> Administration Tools -> IIS, there is no default SMTP server to configure.

The only options when you expand IIS are
1. Application Pools
2. Web Site
3. Web Service Extensions

There is no Default Virtual SMTP Server = option.
How do I add this option.

What I am trying to do is Relay = all outgoing mail to a certain IP Address but I cannot do this
if no Default Virtual SMTP Server = option appears.

Any ideas

Thanks
Sanjeev



--=_NextPart_000_0006_01C5E69B.ABEE7CE0--SMTP is not installed by default, you need to install it. Add/Remove
Programs and then Window Components on the left. Application Server, details
then IIS , details
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Sanjeev" <sanjeev@.microsoft.com> wrote in message
news:OLrlqro5FHA.1028@.TK2MSFTNGP11.phx.gbl...
Hi,
I am trying Configure an SMTP server in IIS for use with Windows SharePoint
Services in Windows 2003 Server
However, when I go to Control Panel -> Administration Tools -> IIS, there is
no default SMTP server to configure.
The only options when you expand IIS are
1. Application Pools
2. Web Site
3. Web Service Extensions
There is no Default Virtual SMTP Server option.
How do I add this option.
What I am trying to do is Relay all outgoing mail to a certain IP Address
but I cannot do this
if no Default Virtual SMTP Server option appears.
Any ideas
Thanks
Sanjeev|||Hi Bruce,
I have checked these options and smtp service was already ticked.
I unticked and ticked it again and completed the wizard but still default
smtp virtual server still does not appear in
IIS manager in admistrative tools.
Thanks
Sanjeev
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:eEaN%23Xt5FHA.2816@.tk2msftngp13.phx.gbl...
> SMTP is not installed by default, you need to install it. Add/Remove
> Programs and then Window Components on the left. Application Server,
> details then IIS , details
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Sanjeev" <sanjeev@.microsoft.com> wrote in message
> news:OLrlqro5FHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I am trying Configure an SMTP server in IIS for use with Windows
> SharePoint Services in Windows 2003 Server
> However, when I go to Control Panel -> Administration Tools -> IIS, there
> is no default SMTP server to configure.
> The only options when you expand IIS are
> 1. Application Pools
> 2. Web Site
> 3. Web Service Extensions
> There is no Default Virtual SMTP Server option.
> How do I add this option.
> What I am trying to do is Relay all outgoing mail to a certain IP Address
> but I cannot do this
> if no Default Virtual SMTP Server option appears.
> Any ideas
> Thanks
> Sanjeev
>

Friday, 10 February 2012

Configure Report Server with SQL Server Express with Advanced Services.

I am having trouble with SQL Express Reporting services.

When going to http:/localhost/reports I get the following error message:

"The report server is not responding. Verify that the report server is running and can be accessed from this computer."

In configuring the Report Server Virtual Directory, it would not let me set the name as "Report Server", so I named it "Report Server2".

I have tried uninstalling .NET framework v2 and reinstalling, but this does not help.

Any ideas?

By default, Express Advanced installs Report Server to a name instance, so you should be trying to get to http://localhost/reports$sqlexress. A default installation should have configured the virtual directory for you.

You can open SQL Server Configuration Manager and it will show you if the reporting service is running and if it has a name.

Mike