Showing posts with label inserted. Show all posts
Showing posts with label inserted. Show all posts

Wednesday, March 7, 2012

problem with xml parsing in enqueue

We are trying to setup simple queue where we are trying to insert(enqueue) record ,it's inserted successfully .

But while retrive records from queues it shows the following err

XML parsing: line 0, character 0, unrecognized input signature

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: XML parsing: line 0, character 0, unrecognized input signature

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

when we use ths following query we r getting records properly

(select * from sys.transmission_queue )

For solving this we have used following commands

USE master ;

GO

ALTER DATABASE database name SET ENABLE_BROKER ;

alter ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 4037 )
FOR SERVICE_BROKER ( AUTHENTICATION = WINDOWS ) ;
GO
--
SELECT is_broker_enabled FROM sys.databases WHERE name = 'dbname'

use dbname
select * from sys.transmission_queue order by enqueue_time desc

create master key encryption by password = 'pass@.word1';

alter AUTHORIZATION ON DATABASE::[dbname] TO [sa];

but unable to solve it.

In a sample example we can dequeue the element which can be removed but we can't enqueue the element, we can send you sample if you need.

Regards,

Ali

The error you show is a client side error (ADO.Net error), not a server error. It seems that you're trying to read a column that is not XML type through an SqlXml datatype. In adition it seems that you're using a Web Service (HTTP endpoint?) to access the server. Is this true?

BTW, messages should be dequeue using RECEIVE from the target service's queue, not select from sys.transmission_queue

|||

Thanx for giving right solution.

Ofcourse its problem with column size.

i resolved it.

Thanx..

Ali

problem with xml parsing in enqueue

We are trying to setup simple queue where we are trying to insert(enqueue) record ,it's inserted successfully .

But while retrive records from queues it shows the following err

XML parsing: line 0, character 0, unrecognized input signature

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: XML parsing: line 0, character 0, unrecognized input signature

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

when we use ths following query we r getting records properly

(select * from sys.transmission_queue )

For solving this we have used following commands

USE master ;

GO

ALTER DATABASE database name SET ENABLE_BROKER ;

alter ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 4037 )
FOR SERVICE_BROKER ( AUTHENTICATION = WINDOWS ) ;
GO
--
SELECT is_broker_enabled FROM sys.databases WHERE name = 'dbname'

use dbname
select * from sys.transmission_queue order by enqueue_time desc

create master key encryption by password = 'pass@.word1';

alter AUTHORIZATION ON DATABASE::[dbname] TO [sa];

but unable to solve it.

In a sample example we can dequeue the element which can be removed but we can't enqueue the element, we can send you sample if you need.

Regards,

Ali

The error you show is a client side error (ADO.Net error), not a server error. It seems that you're trying to read a column that is not XML type through an SqlXml datatype. In adition it seems that you're using a Web Service (HTTP endpoint?) to access the server. Is this true?

BTW, messages should be dequeue using RECEIVE from the target service's queue, not select from sys.transmission_queue

|||

Thanx for giving right solution.

Ofcourse its problem with column size.

i resolved it.

Thanx..

Ali

problem with xml parsing in enqueue

We are trying to setup simple queue where we are trying to insert(enqueue) record ,it's inserted successfully .

But while retrive records from queues it shows the following err

XML parsing: line 0, character 0, unrecognized input signature

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: XML parsing: line 0, character 0, unrecognized input signature

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

when we use ths following query we r getting records properly

(select * from sys.transmission_queue )

For solving this we have used following commands

USE master ;

GO

ALTER DATABASE database name SET ENABLE_BROKER ;

alter ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 4037 )
FOR SERVICE_BROKER ( AUTHENTICATION = WINDOWS ) ;
GO
--
SELECT is_broker_enabled FROM sys.databases WHERE name = 'dbname'

use dbname
select * from sys.transmission_queue order by enqueue_time desc

create master key encryption by password = 'pass@.word1';

alter AUTHORIZATION ON DATABASE::[dbname] TO [sa];

but unable to solve it.

In a sample example we can dequeue the element which can be removed but we can't enqueue the element, we can send you sample if you need.

Regards,

Ali

The error you show is a client side error (ADO.Net error), not a server error. It seems that you're trying to read a column that is not XML type through an SqlXml datatype. In adition it seems that you're using a Web Service (HTTP endpoint?) to access the server. Is this true?

BTW, messages should be dequeue using RECEIVE from the target service's queue, not select from sys.transmission_queue

|||

Thanx for giving right solution.

Ofcourse its problem with column size.

i resolved it.

Thanx..

Ali

Saturday, February 25, 2012

Problem with using 'OutPut Clause' in SQL SEERVER 2005

Hi everyBody,

I Tried to use "OutPut" clause in insert statment as fallows:

insert into test

OUTPUT Inserted.Name,Inserted.LastName

values ('John','kransky')

The Error:

Line 2: Incorrect syntax near 'OUTPUT'.

but I face with this error,I checked MSDN and the other sources, it seems everything is ok. But when I run it ,I face with that error message.I would be appriciate if someone help me on it.

OUTPUT values MUST be 'captured' in some fashion. Typically, the OUTPUT values are captured in a @.Temp table.

For Example, this might work for you:

Code Snippet

DECLARE @.NewRows table

( [Name] varchar(20),

LastName varchar(20)

);

INSERT INTO Test

OUTPUT Inserted.Name, Inserted.LastName

INTO @.NewRows

VALUES ( 'John', 'kransky' );

Then you can use the data in the @.NewRows table however you wish.

Problem with using ''OutPut Clause'' in SQL SEERVER 2005

Hi everyBody,

I Tried to use "OutPut" clause in insert statment as fallows:

insert into test

OUTPUT Inserted.Name,Inserted.LastName

values ('John','kransky')

The Error:

Line 2: Incorrect syntax near 'OUTPUT'.

but I face with this error,I checked MSDN and the other sources, it seems everything is ok. But when I run it ,I face with that error message.I would be appriciate if someone help me on it.

OUTPUT values MUST be 'captured' in some fashion. Typically, the OUTPUT values are captured in a @.Temp table.

For Example, this might work for you:

Code Snippet

DECLARE @.NewRows table

( [Name] varchar(20),

LastName varchar(20)

);

INSERT INTO Test

OUTPUT Inserted.Name, Inserted.LastName

INTO @.NewRows

VALUES ( 'John', 'kransky' );

Then you can use the data in the @.NewRows table however you wish.