Is there any way to get more information about this error? - sql

I am using the following post to try and get the results of a query printed out to a file: Save a SQL query result to an XML file without SSIS or xp_cmdshell
But when I run it I get an error saying:
Msg 50000, Level 16, State 1, Procedure WriteToFile, Line 42
Error whilst Creating file "C:\TEMP\SQL_XML\test.xml",
I was wondering if there is any way to get more information about why exactly it errrored? I dont know much about debugging SQL queries. Im using SQL Server 2008 with SQL Server Management Studio. unfortunately

If you convert HRESULT -2146828218 to HEX you get 800A0046 and if you google for 0x800A0046 you'll find
CTL_E_PERMISSIONDENIED
Most plausible is that the identity running the COM Scripting.FileSystem object doesn't have permissions to write in C:\TEMP\SQL_XML. So verify that the Sql Service user has permission to create files in C:\TEMP\SQL_XML.
A second option might be that the file already exists.
A third option might be that the file is already in use.

Related

What causes error "Procedure unknown"

So at my company we use a billing system which connects to a Firebird database that we have no back-end access to. I am quite new at this company so my familiarity with the Firebird database is not too great. We keep getting this error :
ERROR: Database Engine Error
Sender Class: TGLPreviewBtn
Exception Class: EIBODBError.
IBO ErrorERRCODE=335544569 SQLCODE=-204
Error Message:
ISC ERROR CODE:335544569
ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -204
Procedure unknown
GET_SUB_CONTACTLIST
At line 3, column 60
This has been a recurring thing since I've been hired (I've been here for about 45 days), and we've reported this error to the company which hosts the billing system that we use to access the database. The company keeps saying that it's a network issue on our end, however I cannot see any indication of a connection drop on our end.
I have to reiterate that we have no back-end access to this database so I have no way of going to see what GET_SUB_CONTACTLIST even refers to.
Any help will be appreciated, I am just out of college and this is my first job in a position like this so I will use this as a great learning experience.
This cannot be a network error on your end. The error literally means that Firebird was asked to execute a stored procedure called GET_SUB_CONTACTLIST, and that stored procedure does not exist at that time.
So either someone (or something) is creating and dropping stored procedures on the fly, or part of the application is calling a stored procedure that simply does not exist.
As an aside: error 335544569 (aka isc_dsql_error) covers a broad range of error conditions with 'dynamic' SQL (in other words: most SQL related errors...), unfortunately a lot of client libraries do not communicate the more specific error code 335544581 (or isc_dsql_procedure_err).

Firebird select statement gives SQLSTATE = 42S02

I've made a very simple database and am trying
select * from klant;
I've verified the table exists, and last week was able to see data in it. Today however I keep getting
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-KLANT
-At line 1, column 15
The same select query in flameRobin gives the following error:
Error: *** IBPP::SQLException ***
Context: Database::Statistics
Message: isc_database_info failed
SQL Message : -902
can't format message 13:98 -- message file C:\WINDOWS\SYSTEM32\firebird.msg not found
Engine Code : 335544727
Engine Message :
Error writing data to the connection.
I have copied the firebird.msg to the system32 folder so it should be able to find it there.
Any pointers toward the solution would be greatly appreciated. Similar question all seem to point toward issues with transactions, I can't see that being the problem here.
Edit:
I'm using the included ISQL tool from firebird and start the session by connecting to the database that includes my table. Same for flamerobin, first connect to database, I can see the table that i want to select from but it gives this error.
Edit2:
Finally reinstalled Firebird making sure I gave it admin right, which I think it had before, but wasn't sure about. This seems to have fixed it.

Database backup taking issue

I am using Sql Server 2005.
I wanted to take back up of my database through simple sql command.
For this I referred THIS document.
Made command as follows:
backup database webbasednewsoft to disk 'e:\wb.bak'
but its giving me error as:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'e:\wb.bak'.
I dont understand what is syntax error in this?
I have made everything according to doccument.
I thought the issue was for escape sequence, hence i also tried,
backup database webbasednewsoft to disk 'e:\\wb.bak'
But the error was same.
Please guid me for this.
You need an = sign.
backup database webbasednewsoft to disk='e:\wb.bak'
See here for the MSDN for the BACKUP command
And if you look at your reference it too mentions using an = sign! but hey we're all guilty of eager reading I know I do it... :-)

Customize error messages in adp project - SQL 2005

Hi I have a adp/SQL project running with my db.
Everything is ok but is there a way to customize error messages.
Example: read user cannot update one field so he receives the standard SQL error msg. Is there a way to make it more user friendly?
If you're using stored procedures, you can raise a custom error message, or you can have an output procedure that is returned with the error message.
If you're using direct sql syntax, then you can check the ADO error object and convert it to some sort of user defined error message.
Hope that helps

sp_notify_operator: The specified #operator_name does not exist (but it does!)

OK, so I think I'm going mad here! Here's where I am.
SQL Server 2008: I've set up Database Mail, and I've sent myself a test email. Simple, works fine.
I've created an operator, called 'Tom'. I've given it an email address (but nothing else).
However, when I run this command:
EXECUTE msdb.dbo.sp_notify_operator #name=N'Tom',#subject=N'Test Database Message',#body=N'Testy Test Test'
...I get this:
Msg 14262, Level 16, State 1, Procedure sp_verify_operator_identifiers, Line 51
The specified #operator_name ('Tom') does not exist.
Is that error message masking something else which I should be looking at? There's definately an operator shown in SSMS, but if there's a sproc which lists operators I'll happily run that to see if it's actually there.
I'm just kinda stuck as to where to go next. SQL Server seems convinced I don't exist!
Ignore this! There's a possibility that I was trying to execute sp_notify_operator whilst connected to the wrong server...the one without any operators....
Apologies!