Showing posts with label messages. Show all posts
Showing posts with label messages. Show all posts

Sunday, March 11, 2012

Double quotes in error messages!

I have a problem when trying to display an error message from sql server 2005 on a web page with an alert (javascript command).

The Sql server 2005 returns a message like:

Insert statement conflicted with foreign key constraint "bla bla". The conflict occured indatabase "databasename", table "tablename", column 'columnname'.

In sql server 2000 the error message is the same except all names (constraint, database, table) is in single quotation marks; just like the columnname in the above example.

Is it a configurable issue on the sql server. I would prefer not to solve this issue on a number of different web pages!

Thanks in advance.

Futte

hi,

you should set this:

SET QUOTED_IDENTIFIER { ON | OFF }

When on, then identifiers can be delimited by double quotation marks.

Regards,

Janos

|||

I all ready tried that without any luck.......

I want to avoid the double quotation marks.

Thanks though

Futte

|||

If you wish to 'embed' single quotes in your message, you need to double them up -use two single quotes in each place of one single quote.)

Try this:

SELECT 'This is my ''message'' with quotes.'

|||

I think my question might be a little misunderstood.

My question is not about query syntax in sql regarding single or double quotation marks or two single quotation marks.

It's about the error message sql server is returning. I suddenly experienced that after upgrading sql server from 2000 to 2005 the response from sql 2005 contained double quotation marks around all object names except for one; namely the column name:

2000:

Insert statement conflicted with foreign key constraint 'constraint name'. The conflict occurred in database 'database name', table 'table name', column 'column name'.

2005:

Insert statement conflicted with foreign key constraint "constraint name". The conflict occurred in database "database name", table "table name", column 'column name'.

This is a problem when displaying the error message on a web page with javascript (alert). So if it's a configurable issue on the sql server where is it set? Otherwise I have to handle this error message somewhere else replacing the double quotes with single quotes.

Kind Regards

Futte

|||

Thanks for the clarification. I better understand the situation.

As far as I am aware, there is no user configurable setting to alter the presentation of the error message.

Friday, March 9, 2012

Dos

I have a server that automatically updates itself every night. I have .bat files setup to detect any error messages in the log files that may be encountered during the process, and the job would abort. Furthermore, I need to have an alert e-mailed to me. The plan I came up with to do that is to somehow have another bat file chek my error log file. If the file is empty, the bat file would execute. Otherwise, it would simply fail. I need to have such bat file created, so I could schedule it using SQL Server 7 job scheduler. Now I don't know the dos command to check if the file is empty. Please, any suggestions would be greatly appreciated.Can't think of a dos command to help you but it sounds like a perfect candidate for DTS. You can use xp_sendmail and vbscript ... plus many others.

Sunday, February 26, 2012

Dont get component choices during installation. Installation finishes without db en iis re

Hallo,
I've tried several times installing RS on a particular machine. The
installation finishes without error messages and without installing the RS
components.
During RS installation on a member server (Win2003, SQL2000 Std SP3a, RS
2000 Std) i dont get the usual Server Components choices and so on. The
usual warning about Visual Studio apperas. But then as i click "Next" in the
warning box the installation just continues on. The box "To continue please
click next" appears but i dont get a chance to click next as the
installation just goes on "automatically". The installation rolls on and on
but after it says it finished successfully the IIS mappings and the RS DBs
arent there.
In this newsgroup I found someone (Johan - post: RS Installation fail
without message) with the same issue, although MS (Brad Syputa) took a look
at it, it did not seem resolved.
Does anybody know what to do about this?
Mike van DuijnDon't know for sure if this is your problem but we had the same issue
when we were trying to install RS on a couple development laptops.
Turned out, we *thought* we were running SQL Server developer on those
laptops. We were actually running SQL Server Personal. If there's any
disagreement between the versions, it won't show you the server
components.
Confirm your SQL Version and the version of your RS CD. My guess is
that you are trying to install Reporting Services Developer on SQL
Server Standard or something like that.
Hope this helps,
Tim
mike wrote:
> Hallo,
> I've tried several times installing RS on a particular machine. The
> installation finishes without error messages and without installing the RS
> components.
> During RS installation on a member server (Win2003, SQL2000 Std SP3a, RS
> 2000 Std) i dont get the usual Server Components choices and so on. The
> usual warning about Visual Studio apperas. But then as i click "Next" in the
> warning box the installation just continues on. The box "To continue please
> click next" appears but i dont get a chance to click next as the
> installation just goes on "automatically". The installation rolls on and on
> but after it says it finished successfully the IIS mappings and the RS DBs
> arent there.
> In this newsgroup I found someone (Johan - post: RS Installation fail
> without message) with the same issue, although MS (Brad Syputa) took a look
> at it, it did not seem resolved.
> Does anybody know what to do about this?
> Mike van Duijn