Showing posts with label below. Show all posts
Showing posts with label below. Show all posts

Monday, March 19, 2012

error 1203,severity 20, state 1

hi
im getting the below erro
error 1203,severity 20, state
i was running my interest calculation procedures..its a abanking site..and it updates around 1-2 million records.
profiler is showing this error as exception..but when i saw sysprocess ..that spid is runnable and i can see cpu and io values updated.
wot can be the source of error.
thanks
sanjayHi.
On BOOKS ONLINE:
Error 1203
Severity Level 20
Message Text
Process ID %d attempting to unlock unowned resource %.*ls.
Explanation
This error occurs when Microsoft=AE SQL ServerT is engaged in some activity other than normal post-processing cleanup and it finds that a particular page it is attempting to unlock is already unlocked. The underlying cause for this error may be related to structural problems within the affected database. SQL Server manages the acquisition and release of pages to maintain concurrency control in the multi-user environment. This mechanism is maintained through the use of various internal lock structures that identify the page and the type of lock present. Locks are acquired for processing of affected pages and released when the processing is completed.
Action
Execute DBCC CHECKDB against the database in which the object belongs. If DBCC CHECKDB reports no errors, attempt to reestablish the connection and execute the command
>--Original Message--
>hi,
> im getting the below error
> error 1203,severity 20, state 1
>i was running my interest calculation procedures..its a abanking site..and it updates around 1-2 million records..
>profiler is showing this error as exception..but when i saw sysprocess ..that spid is runnable and i can see cpu and io values updated..
>wot can be the source of error..
>thanks >sanjay
>.
>|||thnks for reply..
i tried but same error..

Sunday, February 26, 2012

Error "Object reference not set to an instance" on SQL 2005 Reporting Services

Reporting Services on my production server stopped working. If I try to open it from Management studio, I get the error below.

Already tried installing patch 07-040, re-registering asp.net, and a few other stuff. Can you guys help me?

TITLE: Connect to Server

Cannot connect to GRUMIUM.


ADDITIONAL INFORMATION:

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<html>
<head>
<title>
SQL Server Reporting Services
</title><meta name="Generator" content="Microsoft SQL Server Reporting Services 9.00.2047.00" />
<meta name="HTTP Status" content="500" />
<meta name="ProductLocaleID" content="9" />
<meta name="CountryLocaleID" content="1033" />
<meta name="StackTrace" content />
<style>
BODY {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE: 8pt; COLOR:black}
H1 {FONT-FAMILY:Verdana; FONT-WEIGHT:700; FONT-SIZE:15pt}
LI {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE:8pt; DISPLAY:inline}
.ProductInfo {FONT-FAMILY:Verdana; FONT-WEIGHT:bold; FONT-SIZE: 8pt; COLOR:gray}
A:link {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR[:#]3366CC; TEXT-DECORATION:none}
A:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR[:#]FF3300; TEXT-DECORATION:underline}
A:visited {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR[:#]3366CC; TEXT-DECORATION:none}
A:visited:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; color[:#]FF3300; TEXT-DECORATION:underline}

</style>
</head><body bgcolor="white">
<h1>
Reporting Services Error<hr width="100%" size="1" color="silver" />
</h1><ul>
<li>An internal error occurred on the report server. See the error log for more details. (rsInternalError) <a href="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsInternalError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.2047.00" target="_blank">Get Online Help</a></li><ul>
<li>Object reference not set to an instance of an object.</li>
</ul>
</ul><hr width="100%" size="1" color="silver" /><span class="ProductInfo">SQL Server Reporting Services</span>
</body>
</html>
--. (Microsoft.SqlServer.Management.UI.RSClient)


BUTTONS:

OK

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1761909&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=694364&SiteID=1

This could be a variety of things, but is most likely due to some configuration that got "touched" recently.

What has been monkeyed with in IIS or with the report server configuration recently? Undo those changes!

|||

There has been no recent change to my environment. I tried a lot of things already to try re resolve the issue.

- Installed patch 07-040

http://support.microsoft.com/kb/911300/en-us

- tried re-registering asp.net

- tried removing the xmlns from the web.config file from both reportserver and reportmanager folders

All without success. Don't know what else I can do.

Sunday, February 19, 2012

Error - subquery returning more than one value

Hie.

I have a trigger that monitors changes to my table fields but I get an error saying subquery returned more than one value.Below is the code for my trigger, hope you will figure out whats happening..

CREATE TRIGGER trgmyTableAuditFields ON myTable
WITH ENCRYPTION
FOR INSERT, UPDATE, DELETE
AS
BEGIN

DECLARE @.col VARCHAR(200)
DECLARE @.primarykeycol VARCHAR(200)
DECLARE @.sql VARCHAR(2000)
DECLARE @.action VARCHAR(200)
DECLARE @.AuditInsert BIT
DECLARE @.AuditUpdate BIT
DECLARE @.AuditDelete BIT

SELECT @.action =
CASE
WHEN (SELECT COUNT(*) FROM deleted) = 0 THEN 'INSERTION'
WHEN (SELECT COUNT(*) FROM inserted) = 0 THEN 'DELETION'
ELSE 'UPDATE'
END

DECLARE curAuditFields CURSOR FOR
SELECT c.[name], ac.[AuditInsert], ac.[AuditUpdate], ac.[AuditDelete]
FROM syscolumns c
INNER JOIN sysobjects o ON o.[id] = c.[id]
INNER JOIN aucAuditColumns ac ON ac.[Column] = c.[name] AND ac.[Table] = o.[name]
WHERE o.[name] = 'myTable'
AND c.[xtype] NOT IN (35, 99, 34)
OPEN curAuditFields

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete

SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #new FROM inserted
SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #old FROM deleted

WHILE @.@.FETCH_STATUS = 0 BEGIN

IF (@.action = 'INSERTION' AND @.AuditInsert = 1) OR
(@.action = 'UPDATE' AND @.AuditUpdate = 1) OR
(@.action = 'DELETION' AND @.AuditDelete = 1)
BEGIN

SET @.sql = 'IF (SELECT [' + @.col + '] FROM #new) <> (SELECT [' + @.col + '] FROM #old) OR (SELECT COUNT(*) FROM #old) = 0 OR (SELECT COUNT(*) FROM #new) = 0 BEGIN' + CHAR(10) +
'DECLARE @.old VARCHAR(50)' + CHAR(10) +
'DECLARE @.new VARCHAR(50)' + CHAR(10) +
' DECLARE @.RecordVal VARCHAR(50)' + CHAR(10) +

' SELECT @.new = CAST([' + @.col + '] AS VARCHAR(50)) FROM #new' + CHAR(10) +
' SELECT @.old = CAST([' + @.col + '] AS VARCHAR(50)) FROM #old' + CHAR(10) +
' SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #old' + CHAR(10) +
'IF @.RecordVal IS NULL BEGIN' + CHAR(10) +
'SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #new' + CHAR(10) +
'END' + CHAR(10) +

'INSERT INTO AuditTable([Username], ModificationDate, SourceTable, ModifiedField, OldValue, NewValue, [Action], [RecordID])' + CHAR(10) +
'VALUES (''' + SUSER_SNAME(SUSER_SID()) + ''',''' + CAST(GETDATE() AS VARCHAR(20)) + ''', ''myTable'', ''' + @.col + ''', @.old, @.new, ''' + @.action + ''', @.RecordVal)' + CHAR(10) +
'END'
EXEC (@.sql)
END

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete
END

DROP TABLE #new
DROP TABLE #old

CLOSE curAuditFields
DEALLOCATE curAuditFields
END

Quote:

Originally Posted by Aleck

Hie.

I have a trigger that monitors changes to my table fields but I get an error saying subquery returned more than one value.Below is the code for my trigger, hope you will figure out whats happening..

CREATE TRIGGER trgmyTableAuditFields ON myTable
WITH ENCRYPTION
FOR INSERT, UPDATE, DELETE
AS
BEGIN

DECLARE @.col VARCHAR(200)
DECLARE @.primarykeycol VARCHAR(200)
DECLARE @.sql VARCHAR(2000)
DECLARE @.action VARCHAR(200)
DECLARE @.AuditInsert BIT
DECLARE @.AuditUpdate BIT
DECLARE @.AuditDelete BIT

SELECT @.action =
CASE
WHEN (SELECT COUNT(*) FROM deleted) = 0 THEN 'INSERTION'
WHEN (SELECT COUNT(*) FROM inserted) = 0 THEN 'DELETION'
ELSE 'UPDATE'
END

DECLARE curAuditFields CURSOR FOR
SELECT c.[name], ac.[AuditInsert], ac.[AuditUpdate], ac.[AuditDelete]
FROM syscolumns c
INNER JOIN sysobjects o ON o.[id] = c.[id]
INNER JOIN aucAuditColumns ac ON ac.[Column] = c.[name] AND ac.[Table] = o.[name]
WHERE o.[name] = 'myTable'
AND c.[xtype] NOT IN (35, 99, 34)
OPEN curAuditFields

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete

SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #new FROM inserted
SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #old FROM deleted

WHILE @.@.FETCH_STATUS = 0 BEGIN

IF (@.action = 'INSERTION' AND @.AuditInsert = 1) OR
(@.action = 'UPDATE' AND @.AuditUpdate = 1) OR
(@.action = 'DELETION' AND @.AuditDelete = 1)
BEGIN

SET @.sql = 'IF (SELECT [' + @.col + '] FROM #new) <> (SELECT [' + @.col + '] FROM #old) OR (SELECT COUNT(*) FROM #old) = 0 OR (SELECT COUNT(*) FROM #new) = 0 BEGIN' + CHAR(10) +
'DECLARE @.old VARCHAR(50)' + CHAR(10) +
'DECLARE @.new VARCHAR(50)' + CHAR(10) +
' DECLARE @.RecordVal VARCHAR(50)' + CHAR(10) +

' SELECT @.new = CAST([' + @.col + '] AS VARCHAR(50)) FROM #new' + CHAR(10) +
' SELECT @.old = CAST([' + @.col + '] AS VARCHAR(50)) FROM #old' + CHAR(10) +
' SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #old' + CHAR(10) +
'IF @.RecordVal IS NULL BEGIN' + CHAR(10) +
'SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #new' + CHAR(10) +
'END' + CHAR(10) +

'INSERT INTO AuditTable([Username], ModificationDate, SourceTable, ModifiedField, OldValue, NewValue, [Action], [RecordID])' + CHAR(10) +
'VALUES (''' + SUSER_SNAME(SUSER_SID()) + ''',''' + CAST(GETDATE() AS VARCHAR(20)) + ''', ''myTable'', ''' + @.col + ''', @.old, @.new, ''' + @.action + ''', @.RecordVal)' + CHAR(10) +
'END'
EXEC (@.sql)
END

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete
END

DROP TABLE #new
DROP TABLE #old

CLOSE curAuditFields
DEALLOCATE curAuditFields
END


i did not continue reading your code...am not sure how efficient it is to put a CUSOR inside a trigger. maybe you would want to find another way of doing this

Error - Building Replication

Hi,I am building the Transactional Replication.It thro's Error Like below.
The process could not bulk copy out of table
'[dbo].[syncobj_0x3435344541393145]'.
I/O error while writing BCP data-file
Category : ODBC
Source : ODBC SQL Server Driver
But I have Checked the Space in Both OLTP and Replication Server it has
enough space.
Is prob in ODBC Driver? pls guide me to rectify this Prob.
Regards
Sivaraman Latchapathi
Do a select * from syncobj_0x3435344541393145 to see if there aren't
physical problems with this table. Also do a sp_helptext
syncobj_0x3435344541393145 to see if this view can't benefit from indexes on
the base tables.
Now check the event log to see if you can't see disk error problems.
These errors tend to be transitory.
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
"Shiv" <Shiv@.discussions.microsoft.com> wrote in message
news:5483C669-8B80-4A67-927A-EDDFDFCFC790@.microsoft.com...
> Hi,I am building the Transactional Replication.It thro's Error Like below.
> The process could not bulk copy out of table
> '[dbo].[syncobj_0x3435344541393145]'.
> I/O error while writing BCP data-file
> Category : ODBC
> Source : ODBC SQL Server Driver
> But I have Checked the Space in Both OLTP and Replication Server it has
> enough space.
> Is prob in ODBC Driver? pls guide me to rectify this Prob.
> Regards
> Sivaraman Latchapathi
>
|||Hi, As u said syncobj_0x3435344541393145 is View ... i can able to see the
record
in that view also i can able to query physical table which is related to
that view.
"Hilary Cotter" wrote:

> Do a select * from syncobj_0x3435344541393145 to see if there aren't
> physical problems with this table. Also do a sp_helptext
> syncobj_0x3435344541393145 to see if this view can't benefit from indexes on
> the base tables.
> Now check the event log to see if you can't see disk error problems.
> These errors tend to be transitory.
> --
> 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
> "Shiv" <Shiv@.discussions.microsoft.com> wrote in message
> news:5483C669-8B80-4A67-927A-EDDFDFCFC790@.microsoft.com...
>
>
|||ok, now try to bcp out of this view into the file system to see if you can
do this successfully.
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
"Shiv" <Shiv@.discussions.microsoft.com> wrote in message
news:FF248563-F4E8-4AD5-89FE-DD42EF330917@.microsoft.com...[vbcol=seagreen]
> Hi, As u said syncobj_0x3435344541393145 is View ... i can able to see the
> record
> in that view also i can able to query physical table which is related to
> that view.
> "Hilary Cotter" wrote: