The timeout period elapsed prior to completion of the operation or server is not responding
@@TRANCOUNT helped identify uncommitted transactions and the issue was resolved.
WHILE @@TRANCOUNT > 0
BEGIN
COMMIT;
END;
Monday, October 22, 2012
Wednesday, October 17, 2012
Return code warning and truncation error in SQL Server
Msg 8152, Level 16, State 14, Procedure my_procedure, Line 56
String or binary data would be truncated.
The statement has been terminated.
The 'my_procedure' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.
Trying to figure out the reason for this error, i am able to modify the data and it procedure executes successfully. The issue is the column the procedure is updating is of length 30 characters and the data being updated is 17 characters (including a white space 'errorhere string'). As soon as i remove the white space and the 'string' it works like a charm.
Tried removing the white space but did not help either, still get the same error.
To resolve the NULL value being returned, just added return (0) and it was gone. I was under the impression that by default if no return is specified a 0 (numeral) is returned by the procedure.
Google is my friend....
Generating view definition in SQL Server
Make sure you have the privileges/access to the these commands.
1. sp_helptext [my_view_name]
2. Right click on the view in object explorer and generate a script
3. Run the query on information_schema.views table to see view definition
Hope this helps, i am also learning and Google is my friend :)
1. sp_helptext [my_view_name]
2. Right click on the view in object explorer and generate a script
3. Run the query on information_schema.views table to see view definition
Hope this helps, i am also learning and Google is my friend :)
Subscribe to:
Posts (Atom)