Showing posts with label execute. Show all posts
Showing posts with label execute. Show all posts

Tuesday, March 27, 2012

error 1813 with xp_cmdshell

Hi all,
I am trying to launch a xp_cmdshell from a stored procedure to execute a BCP
.
This error occured when my sp is called :
System.Web.HttpUnhandledException: Exception of type
System.Web.HttpUnhandledException was thrown. -->
System.Data.SqlClient.SqlException: A severe error occurred on the current
command.
The results, if any, should be discarded. xp_cmdshell failed to execute,
error 1813 occured while executing CreateProcessAsUserW.
I use SQLServer 2000 SP4 and a system account to launch the xp_cmdshell. The
SQL server agent log on with this same account.
Any idea?
I will appreciate any help.
Regards.
LGHi,
xp_cmdshell executes with the security contect of the SQL Agent Proxy
account when executed by non symin users. This requires you to allow
non-symin users to execute xp_cmdshell (uncheck the 'Only users with
symin privileges...' checkbox under SQL Server Agent properties --> Job
System) and specify a Windows account for the SQL Agent proxy with the
permissions needed to run you application).
See the below URL:-
http://support.microsoft.com/defaul...b;en-us;Q264155
Thanks
Hari
SQL Server MVP
"Laurent G" <LaurentG@.discussions.microsoft.com> wrote in message
news:13FBAEA9-A146-49E0-A42C-1B939CC3DA06@.microsoft.com...
> Hi all,
> I am trying to launch a xp_cmdshell from a stored procedure to execute a
> BCP.
> This error occured when my sp is called :
> System.Web.HttpUnhandledException: Exception of type
> System.Web.HttpUnhandledException was thrown. -->
> System.Data.SqlClient.SqlException: A severe error occurred on the current
> command.
> The results, if any, should be discarded. xp_cmdshell failed to execute,
> error 1813 occured while executing CreateProcessAsUserW.
> I use SQLServer 2000 SP4 and a system account to launch the xp_cmdshell.
> The
> SQL server agent log on with this same account.
> Any idea?
> I will appreciate any help.
> Regards.
> LG|||Thanks a lot Hari, it works now.
"Hari Pra" wrote:

> Hi,
> xp_cmdshell executes with the security contect of the SQL Agent Proxy
> account when executed by non symin users. This requires you to allow
> non-symin users to execute xp_cmdshell (uncheck the 'Only users with
> symin privileges...' checkbox under SQL Server Agent properties --> Job
> System) and specify a Windows account for the SQL Agent proxy with the
> permissions needed to run you application).
> See the below URL:-
> http://support.microsoft.com/defaul...b;en-us;Q264155
>
> Thanks
> Hari
> SQL Server MVP
> "Laurent G" <LaurentG@.discussions.microsoft.com> wrote in message
> news:13FBAEA9-A146-49E0-A42C-1B939CC3DA06@.microsoft.com...
>
>

Monday, March 26, 2012

Error 17805 Invalid buffer received from Client when executing stored Procedure

Hello,
I am receiving this error when I try to execute a Stored Procedure in
SQL Server 2000 using SYBASE dblib.
I have been able to connect to connect to SQL Server from Unix, but
when I try to execute a Stored Procedure via dblib, I get the error:
"Error 17805 Invalid buffer received from Client"
My Stored Procedure does not receive parameters, so I don't know what
is happening.
If I execute a simple SQL Statement, it works fine
I have a SQL Server 2000 running SP 4.
anyone can help?
Thank you in advanced
Jose Manuel
Jose Manuel wrote:
> Hello,
> I am receiving this error when I try to execute a Stored Procedure in
> SQL Server 2000 using SYBASE dblib.
> I have been able to connect to connect to SQL Server from Unix, but
> when I try to execute a Stored Procedure via dblib, I get the error:
> "Error 17805 Invalid buffer received from Client"
> My Stored Procedure does not receive parameters, so I don't know what
> is happening.
> If I execute a simple SQL Statement, it works fine
> I have a SQL Server 2000 running SP 4.
> anyone can help?
> Thank you in advanced
> Jose Manuel
Just curious: Why are you executing SQL on SQL Server 2000 usin the
Sybase dbLib instead of a SQL Server client library?
David Gugick
Imceda Software
www.imceda.com
|||Jose Manuel,
I am having exactlly the same problem as you had.
Could you please tell me how did you solve it?
Thanks
creo que voy varios pasos atras de ti. ojal me puedas ayudar. tengo el
mismo problema.
te ha contactado alguien ?
lo pudiste resolver?
gracias.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

Wednesday, March 7, 2012

Error :Execute Trigger From Remote Server To another Server By Linked Server

i did "Linked server" between To Servers , and it's Working.

For Example :

Server 1 =S1.

Server = S2.

i create table in S1 : name = TblS1

i create same table in S2 : name TblS2

and i create trigger(name tr_cpD) From S1 in TblS1 For send data To TblS2 in S2

/****************** trigger Code ***************

CREATE TRIGGER dbo.tr_cpD

ON dbo.TblS1

AFTER INSERT

AS

BEGIN

SET NOCOUNT ON;

insert into [S2].[dbname].[dbo].[TblS2] Select ID,Name from inserted

END

**************************************************

result is :

Msg 7399, Level 16, State 1, Procedure tr_cpD, Line 14

The OLE DB provider "SQLNCLI" for linked server "S2" reported an error. The provider did not give any information about the error.

Msg 7312, Level 16, State 1, Procedure tr_cpD, Line 14

Invalid use of schema or catalog for OLE DB provider "SQLNCLI" for linked server "S2". A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog or schema.

how i can execute this trigger

Just to clarify: does the insert statement work outside of the trigger from the same S1 server?|||

Yes.

it's Work from Stored Procduers without TRAN (Transaction) .

if i use Transaction From Stored Procduers is not work.

Give me same result above.

|||Is MSDTC enabled on both servers? I think insert from the trigger into a linked server is done inside the distributed transaction.
But I would expect some transaction specific error if it was not so.|||

Microsoft proived some solution, how to overcome this problem. Try it.

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

I tried in the LAN its working fine. But, still in the WAN is not working.

Error :Execute Trigger From Remote Server To another Server By Linked Server

i did "Linked server" between To Servers , and it's Working.

For Example :

Server 1 =S1.

Server = S2.

i create table in S1 : name = TblS1

i create same table in S2 : name TblS2

and i create trigger(name tr_cpD) From S1 in TblS1 For send data To TblS2 in S2

/****************** trigger Code ***************

CREATE TRIGGER dbo.tr_cpD

ON dbo.TblS1

AFTER INSERT

AS

BEGIN

SET NOCOUNT ON;

insert into [S2].[dbname].[dbo].[TblS2] Select ID,Name from inserted

END

**************************************************

result is :

Msg 7399, Level 16, State 1, Procedure tr_cpD, Line 14

The OLE DB provider "SQLNCLI" for linked server "S2" reported an error. The provider did not give any information about the error.

Msg 7312, Level 16, State 1, Procedure tr_cpD, Line 14

Invalid use of schema or catalog for OLE DB provider "SQLNCLI" for linked server "S2". A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog or schema.

how i can execute this trigger

Just to clarify: does the insert statement work outside of the trigger from the same S1 server?|||

Yes.

it's Work from Stored Procduers without TRAN (Transaction) .

if i use Transaction From Stored Procduers is not work.

Give me same result above.

|||Is MSDTC enabled on both servers? I think insert from the trigger into a linked server is done inside the distributed transaction.
But I would expect some transaction specific error if it was not so.|||

Microsoft proived some solution, how to overcome this problem. Try it.

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

I tried in the LAN its working fine. But, still in the WAN is not working.

Sunday, February 26, 2012

ERROR : Host-file columns may be skipped only when copying into the Server

Hi All,

I need to make a query from the SQL Server 2K and save this data as an XML file. What i am trying to do is to execute a bcp utility as follows:

EXEC master..xp_cmdshell 'bcp "SELECT CustID,CustName,CustSurname,CustEmail FROM myOwenDB..T_Customers FOR XML RAW" queryout "c:\customers.xml" -fc:\bcp.fmt -Sservername -Usa -Ppwd -C RAW -r -t'

with bcp.fmt file formatted as

8.0
4
1 SQLCHAR 0 9 "\t" 1 CustID Turkish_CI_AS
2 SQLCHAR 0 100 "\t" 2 CustName Turkish_CI_AS
3 SQLCHAR 0 100 "\t" 3 CustSurname Turkish_CI_AS
4 SQLCHAR 0 100 "\t" 4 CustEmail Turkish_CI_AS

The error is as follows:

Error = [Microsoft][ODBC SQL Server Driver]Host-file columns may be skipped only when copying into the Server

Does anyone have an idea about the problem? Also other techniques to generate XML file are also welcomed:)

Thanks in advance,

Bahtiyar KARANLIKYour select statment only returns one column and you are using a format file that says bcp will be receiving four columns from the select statment.|||Hi,
How can my SQL statement can return only one column? When i execute the statement via Query Analyzer it displays the correct information?

Am i missing a point??

Bahtiyar KARANLIK|||If you execute
SELECT CustID,CustName,CustSurname,CustEmail FROM myOwenDB..T_Customers
In QA you will get four columns, CustID, CustName,CustSurname and CustEmail.

If you execute
SELECT CustID,CustName,CustSurname,CustEmail FROM myOwenDB..T_Customers FOR XML RAW
In QA you will have a resultset with one column. Within the one column you will have an XML string that contains the four above mentioned columns, but they will be contained in one column!

If you execute
select au_id,au_lname,phone,contract from pubs.dbo.authors

you should get something like:

au_id au_lname phone contract
---- ------------ ---- ---
172-32-1176 White 408 496-7223 1

If you execute
select au_id,au_lname,phone,contract from pubsdbo.authors for xml raw

you should get something like:

XML_F52E2B61-18A1-11d1-B105-00805F49916B
------------------------
<row au_id="172-32-1176" au_lname="White" phone="408 496-7223" contract="1"/>

The first has four colums in the result set the second has only one.

Error (1552) ODBC, Insert Execute Error

Hi, I have a program called dbms/copy that I use to conver clarion database tables. The program first creates the table, if already exists I delete and recreate. This part works fine. When it tries to insert the records I get the following error message:

Error (1552)

ODBC, Insert Execute Error -> Buffer Contained 100 Records but only 0 Records were written

I created a System DSN ODBC link to the SQL Server. I tried using the "sa" user, as well as creating a user and checking off all available permissions. It seems to be a permissions problem to me, although it appears I have permission to do everything. It is definately able to connect since it has no problem creating/deleting/recreating the table in the SQL Server database.

I tried doing the same import with an ODBC connection to a Microsoft Access database and it works without any problems.

Any idea what's giving me this error?I turned on ODBC tracing and the following errors showed up in the SQL.log file:

dbmswin7 f58-b90 ENTER SQLSetStmtAttr
SQLHSTMT 00E51F98
SQLINTEGER 6 <SQL_ATTR_CURSOR_TYPE>
SQLPOINTER 0x00000001
SQLINTEGER 0

dbmswin7 f58-b90 EXIT SQLSetStmtAttr with return code -1 (SQL_ERROR)
SQLHSTMT 00E51F98
SQLINTEGER 6 <SQL_ATTR_CURSOR_TYPE>
SQLPOINTER 0x00000001
SQLINTEGER 0

DIAG [24000] [Microsoft][ODBC Driver Manager] Invalid cursor state (0)

dbmswin7 f58-b90 ENTER SQLSetStmtAttr
SQLHSTMT 00E51F98
SQLINTEGER 7 <SQL_ATTR_CONCURRENCY>
SQLPOINTER 0x00000003
SQLINTEGER 0

dbmswin7 f58-b90 EXIT SQLSetStmtAttr with return code -1 (SQL_ERROR)
SQLHSTMT 00E51F98
SQLINTEGER 7 <SQL_ATTR_CONCURRENCY>
SQLPOINTER 0x00000003
SQLINTEGER 0

DIAG [24000] [Microsoft][ODBC Driver Manager] Invalid cursor state (0)

dbmswin7 f58-b90 ENTER SQLSetStmtAttr
SQLHSTMT 00E51F98
SQLINTEGER 5 <SQL_ATTR_ROW_BIND_TYPE>
SQLPOINTER 0x00000000
SQLINTEGER 0

dbmswin7 f58-b90 EXIT SQLSetStmtAttr with return code 0 (SQL_SUCCESS)
SQLHSTMT 00E51F98
SQLINTEGER 5 <SQL_ATTR_ROW_BIND_TYPE>
SQLPOINTER 0x00000000
SQLINTEGER 0

dbmswin7 f58-b90 ENTER SQLSetStmtAttr
SQLHSTMT 00E51F98
SQLINTEGER 27 <SQL_ATTR_ROW_ARRAY_SIZE>
SQLPOINTER 0x00000064
SQLINTEGER 0

dbmswin7 f58-b90 EXIT SQLSetStmtAttr with return code 0 (SQL_SUCCESS)
SQLHSTMT 00E51F98
SQLINTEGER 27 <SQL_ATTR_ROW_ARRAY_SIZE>
SQLPOINTER 0x00000064 (BADMEM)
SQLINTEGER 0

dbmswin7 f58-b90 ENTER SQLBulkOperations
SQLHSTMT 00E51F98
SQLSMALLINT 4

dbmswin7 f58-b90 EXIT SQLBulkOperations with return code -1 (SQL_ERROR)
SQLHSTMT 00E51F98
SQLSMALLINT 4

DIAG [S1092] [Microsoft][ODBC SQL Server Driver]Invalid attribute/option identifier (0)

dbmswin7 f58-b90 ENTER SQLRowCount
HSTMT 00E51F98
SQLLEN * 0x0012F7F4

dbmswin7 f58-b90 EXIT SQLRowCount with return code 0 (SQL_SUCCESS)
HSTMT 00E51F98
SQLLEN * 0x0012F7F4 (0)

dbmswin7 f58-b90 ENTER SQLDisconnect
HDBC 00E515E8

dbmswin7 f58-b90 EXIT SQLDisconnect with return code 0 (SQL_SUCCESS)
HDBC 00E515E8

Originally posted by UltraSmooth
Hi, I have a program called dbms/copy that I use to conver clarion database tables. The program first creates the table, if already exists I delete and recreate. This part works fine. When it tries to insert the records I get the following error message:

Error (1552)

ODBC, Insert Execute Error -> Buffer Contained 100 Records but only 0 Records were written

I created a System DSN ODBC link to the SQL Server. I tried using the "sa" user, as well as creating a user and checking off all available permissions. It seems to be a permissions problem to me, although it appears I have permission to do everything. It is definately able to connect since it has no problem creating/deleting/recreating the table in the SQL Server database.

I tried doing the same import with an ODBC connection to a Microsoft Access database and it works without any problems.

Any idea what's giving me this error?

Friday, February 24, 2012

Error "Cannot resolve the collation conflict between"

I'm getting the following errors when trying to execute the following script on the server, its part of the standard asp.net membership and roles, anybody have any ideas how I get get round this?

Msg 468, Level 16, State 9, Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 50
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Msg 468, Level 16, State 9, Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 58
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Msg 468, Level 16, State 9, Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 84
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Msg 468, Level 16, State 9, Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 92
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.

/****** Object: StoredProcedure [dbo].[aspnet_UsersInRoles_RemoveUsersFromRoles] Script Date: 05/20/2007 11:23:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_UsersInRoles_RemoveUsersFromRoles]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @.statement = N'
CREATE PROCEDURE [dbo].[aspnet_UsersInRoles_RemoveUsersFromRoles]
@.ApplicationName nvarchar(256),
@.UserNames nvarchar(4000),
@.RoleNames nvarchar(4000)
AS
BEGIN
DECLARE @.AppId uniqueidentifier
SELECT @.AppId = NULL
SELECT @.AppId = ApplicationId FROM aspnet_Applications WHERE LOWER(@.ApplicationName) = LoweredApplicationName
IF (@.AppId IS NULL)
RETURN(2)

DECLARE @.TranStarted bit
SET @.TranStarted = 0

IF( @.@.TRANCOUNT = 0 )
BEGIN
BEGIN TRANSACTION
SET @.TranStarted = 1
END

DECLARE @.tbNames table(Name nvarchar(256) NOT NULL PRIMARY KEY)
DECLARE @.tbRoles table(RoleId uniqueidentifier NOT NULL PRIMARY KEY)
DECLARE @.tbUsers table(UserId uniqueidentifier NOT NULL PRIMARY KEY)
DECLARE @.Num int
DECLARE @.Pos int
DECLARE @.NextPos int
DECLARE @.Name nvarchar(256)
DECLARE @.CountAll int
DECLARE @.CountU int
DECLARE @.CountR int

SET @.Num = 0
SET @.Pos = 1
WHILE(@.Pos <= LEN(@.RoleNames))
BEGIN
SELECT @.NextPos = CHARINDEX(N'','', @.RoleNames, @.Pos)
IF (@.NextPos = 0 OR @.NextPos IS NULL)
SELECT @.NextPos = LEN(@.RoleNames) + 1
SELECT @.Name = RTRIM(LTRIM(SUBSTRING(@.RoleNames, @.Pos, @.NextPos - @.Pos)))
SELECT @.Pos = @.NextPos+1

INSERT INTO @.tbNames VALUES (@.Name)
SET @.Num = @.Num + 1
END

INSERT INTO @.tbRoles
SELECT RoleId
FROM dbo.aspnet_Roles ar, @.tbNames t
WHERE LOWER(t.Name) = ar.LoweredRoleName AND ar.ApplicationId = @.AppId
SELECT @.CountR = @.@.ROWCOUNT

IF (@.CountR <> @.Num)
BEGIN
SELECT TOP 1 N'''', Name
FROM @.tbNames
WHERE LOWER(Name) NOT IN (SELECT ar.LoweredRoleName FROM dbo.aspnet_Roles ar, @.tbRoles r WHERE r.RoleId = ar.RoleId)
IF( @.TranStarted = 1 )
ROLLBACK TRANSACTION
RETURN(2)
END

DELETE FROM @.tbNames WHERE 1=1
SET @.Num = 0
SET @.Pos = 1

WHILE(@.Pos <= LEN(@.UserNames))
BEGIN
SELECT @.NextPos = CHARINDEX(N'','', @.UserNames, @.Pos)
IF (@.NextPos = 0 OR @.NextPos IS NULL)
SELECT @.NextPos = LEN(@.UserNames) + 1
SELECT @.Name = RTRIM(LTRIM(SUBSTRING(@.UserNames, @.Pos, @.NextPos - @.Pos)))
SELECT @.Pos = @.NextPos+1

INSERT INTO @.tbNames VALUES (@.Name)
SET @.Num = @.Num + 1
END

INSERT INTO @.tbUsers
SELECT UserId
FROM dbo.aspnet_Users ar, @.tbNames t
WHERE LOWER(t.Name) = ar.LoweredUserName AND ar.ApplicationId = @.AppId

SELECT @.CountU = @.@.ROWCOUNT
IF (@.CountU <> @.Num)
BEGIN
SELECT TOP 1 Name, N''''
FROM @.tbNames
WHERE LOWER(Name) NOT IN (SELECT au.LoweredUserName FROM dbo.aspnet_Users au, @.tbUsers u WHERE u.UserId = au.UserId)

IF( @.TranStarted = 1 )
ROLLBACK TRANSACTION
RETURN(1)
END

SELECT @.CountAll = COUNT(*)
FROM dbo.aspnet_UsersInRoles ur, @.tbUsers u, @.tbRoles r
WHERE ur.UserId = u.UserId AND ur.RoleId = r.RoleId

IF (@.CountAll <> @.CountU * @.CountR)
BEGIN
SELECT TOP 1 UserName, RoleName
FROM @.tbUsers tu, @.tbRoles tr, dbo.aspnet_Users u, dbo.aspnet_Roles r
WHERE u.UserId = tu.UserId AND r.RoleId = tr.RoleId AND
tu.UserId NOT IN (SELECT ur.UserId FROM dbo.aspnet_UsersInRoles ur WHERE ur.RoleId = tr.RoleId) AND
tr.RoleId NOT IN (SELECT ur.RoleId FROM dbo.aspnet_UsersInRoles ur WHERE ur.UserId = tu.UserId)
IF( @.TranStarted = 1 )
ROLLBACK TRANSACTION
RETURN(3)
END

DELETE FROM dbo.aspnet_UsersInRoles
WHERE UserId IN (SELECT UserId FROM @.tbUsers)
AND RoleId IN (SELECT RoleId FROM @.tbRoles)
IF( @.TranStarted = 1 )
COMMIT TRANSACTION
RETURN(0)
END
'
END
GO

ThanksThis is because the collations are not consistent across the database tables and the tables that have been created.

Try adding the COLLATE to your insert queries.

something like
INSERT INTO @.tbUsers
SELECT UserId COLLATE SQL_Latin1_General_CP1_CI_AS
FROM dbo.aspnet_Users ar, @.tbNames t
WHERE LOWER(t.Name) = ar.LoweredUserName AND ar.ApplicationId = @.AppId
or
INSERT INTO @.tbUsers
SELECT UserId COLLATE Latin1_General_CI_AS
FROM dbo.aspnet_Users ar, @.tbNames t
WHERE LOWER(t.Name) = ar.LoweredUserName AND ar.ApplicationId = @.AppId

coz i really dont know which one is conflicting.....i mean which collation|||Yes your right the db and the table fields have different collation values but I don't understand how to change this as this was installed by .net, Can I change this and will it have any impact, Its funny because I've scripted the db from my dev machine and its working fine and now that I'm trying to create it on my host .. Wierd

Error - Trancount Reset!

Hi,
I am using the T-SQL commands "BEGIN TRANSACTION", "COMMIT TRANSACTION"
and "ROLLBACK TRANSACTION" via the Statement.Execute method instead of
setting the autoCommit feature of JDBC.
We often have objects that contain transactional updates that may be called
by another object that has already initiated a transaction or that may be
used alone, thus we need a form of transaction nesting which the autoCommit
feature does not provide.
However, we have noticed that the @.@.TRANCOUNT will reset to 0 once a
statement object is created on the same connection - for example, we would
expect:
FIRST OBJECT
BEGIN TRANSACTION
... SOME WORK (TRANCOUNT = 1)
SECOND OBJECT
BEGIN TRANSACTION (TRANCOUNT = 2)
.. SOME WORK
COMMIT TRANSACTION (TRANCOUNT = 1)
FIRST OBJECT
COMMIT TRANSACTION (TRANCOUNT = 0)
However, we have noticed that as soon as a Statement object is created in
the inner transaction, the TRANCOUNT is immediately set to 0. Then, when the
COMMIT TRANSACTION statement is issued, an error is raised because there is
no matching BEGIN TRANSACTION.
Has anyone ever encountered this error? Is it a bug?
Thanks,
Mike
MikeF wrote:

> Hi,
> I am using the T-SQL commands "BEGIN TRANSACTION", "COMMIT TRANSACTION"
> and "ROLLBACK TRANSACTION" via the Statement.Execute method instead of
> setting the autoCommit feature of JDBC.
Very dangerous.

> We often have objects that contain transactional updates that may be called
> by another object that has already initiated a transaction or that may be
> used alone, thus we need a form of transaction nesting which the autoCommit
> feature does not provide.
That doesn't explain why the autoCommit() path won't work. You set autoCommit(false)
and call what you want. anything below needn't know whether it's in a tx or not.
Then commit or roll back.

> However, we have noticed that the @.@.TRANCOUNT will reset to 0 once a
> statement object is created on the same connection - for example, we would
> expect:
> FIRST OBJECT
> BEGIN TRANSACTION
> ... SOME WORK (TRANCOUNT = 1)
> SECOND OBJECT
> BEGIN TRANSACTION (TRANCOUNT = 2)
> .. SOME WORK
> COMMIT TRANSACTION (TRANCOUNT = 1)
> FIRST OBJECT
> COMMIT TRANSACTION (TRANCOUNT = 0)
> However, we have noticed that as soon as a Statement object is created in
> the inner transaction, the TRANCOUNT is immediately set to 0. Then, when the
> COMMIT TRANSACTION statement is issued, an error is raised because there is
> no matching BEGIN TRANSACTION.
> Has anyone ever encountered this error? Is it a bug?
You need to add a connection property selectMethod=cursor. Otherwise
the driver will make *new connections* under the covers to implement
concurrent statements, and each statement will be independent of
the connection/statement on which you think you started a transaction.
This would have been prevented/revealed immediately if you had stuck to
JDBC control calls for defining your transactions.
Joe Weinstein at BEA
> Thanks,
> Mike

Friday, February 17, 2012

Error

I tryed to execute the maintenace plan, but it failed... the second time I
tryed to execute it it gave me this error message:
Execute Maintenance Plan
An exception occured while executing a Transact-SQL statement or batch
(Microsoft.SqlServer.ConnectInfo)
SqlServerAgent Error: Request to run job backup_db (from <domain>\Jeff)
refused because the job is already running from a request by User
<domain>\Jeff (Microsft Sql Server, Error 22022)
I'm not sure how the first error message was (I tryed to execute the
maintenance plan twice)...
strange if I should get an error that the job is already running...
well, maybe it was caused by my user account, which not a member of the
local administrator on that server, but I'm a member of the administrators
in the domain
any suggestions?Hi
Did you try to execute the job or the maintenance plan? If you look at the
view history of the plan it may have something in for the last run, if it is
still running then it would be incomplete information.
John
"Jeff" wrote:

> I tryed to execute the maintenace plan, but it failed... the second time I
> tryed to execute it it gave me this error message:
> Execute Maintenance Plan
> An exception occured while executing a Transact-SQL statement or batch
> (Microsoft.SqlServer.ConnectInfo)
> SqlServerAgent Error: Request to run job backup_db (from <domain>\Jeff)
> refused because the job is already running from a request by User
> <domain>\Jeff (Microsft Sql Server, Error 22022)
> I'm not sure how the first error message was (I tryed to execute the
> maintenance plan twice)...
> strange if I should get an error that the job is already running...
> well, maybe it was caused by my user account, which not a member of the
> local administrator on that server, but I'm a member of the administrators
> in the domain
> any suggestions?
>
>|||It fails because as the error message refers it's already running. You
should check the history for any detailed error messages about the running
job if there is any.
Ekrem nsoy
"Jeff" <donot@.spam.me> wrote in message
news:enncutLQIHA.5184@.TK2MSFTNGP05.phx.gbl...
>I tryed to execute the maintenace plan, but it failed... the second time I
>tryed to execute it it gave me this error message:
> Execute Maintenance Plan
> An exception occured while executing a Transact-SQL statement or batch
> (Microsoft.SqlServer.ConnectInfo)
> SqlServerAgent Error: Request to run job backup_db (from <domain>\Jeff)
> refused because the job is already running from a request by User
> <domain>\Jeff (Microsft Sql Server, Error 22022)
> I'm not sure how the first error message was (I tryed to execute the
> maintenance plan twice)...
> strange if I should get an error that the job is already running...
> well, maybe it was caused by my user account, which not a member of the
> local administrator on that server, but I'm a member of the administrators
> in the domain
> any suggestions?
>

Error

I have full text catalog on my table.
SELECT TOP 10 * FROM MyTable My(NOLOCK)
WHERE CONTAINS My.*, '"a.b.c.d*"')
query execute error;
"Msg 9937, Level 16, State 5, Line 1
Too many full-text columns or the full-text query is too complex to be
executed."
otherwise another query which doesn't have --"--
SELECT TOP 10 * FROM MyTable My(NOLOCK)
WHERE CONTAINS My.*, 'a.b.c.d*')
returns data normally.
what is the differences between them?
Is anyone can help me?
The wildcard is applied to each term in your query, so its a* and b* and c*
and d*. That is why you are getting the error. I can't see a good solution
to this.
RelevantNoise.com - dedicated to mining blogs for business intelligence.
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
"Deniz Emeci" <Deniz Emeci@.discussions.microsoft.com> wrote in message
news:176E6C5D-D092-42B7-A7AD-F501304CA6D7@.microsoft.com...
>I have full text catalog on my table.
> SELECT TOP 10 * FROM MyTable My(NOLOCK)
> WHERE CONTAINS My.*, '"a.b.c.d*"')
> query execute error;
> "Msg 9937, Level 16, State 5, Line 1
> Too many full-text columns or the full-text query is too complex to be
> executed."
>
> otherwise another query which doesn't have --"--
> SELECT TOP 10 * FROM MyTable My(NOLOCK)
> WHERE CONTAINS My.*, 'a.b.c.d*')
> returns data normally.
> what is the differences between them?
> Is anyone can help me?
|||a.b.c.d is one term like u.s.a.(united states of america)
so i dont want to divide my term.
"Hilary Cotter" wrote:

> The wildcard is applied to each term in your query, so its a* and b* and c*
> and d*. That is why you are getting the error. I can't see a good solution
> to this.
> --
> RelevantNoise.com - dedicated to mining blogs for business intelligence.
> 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
> "Deniz Emeci" <Deniz Emeci@.discussions.microsoft.com> wrote in message
> news:176E6C5D-D092-42B7-A7AD-F501304CA6D7@.microsoft.com...
>
>