Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Friday, March 23, 2012

how to throw Custom Error instead of Default SQL Server Error

Hi guys!
i've very basic knowledge of DB as i'm a software developer i dont know
much about the DB other then writing Queries.
now, the problem is, i'm in a situation, where i need to throw a custom
error whenever some specific error occure while deleting the record
from the table.
the Scenrio is, like this:
i've table that has refencial intigrity constraint. it disallow to
delete the parent row if it is refered in the child table twice. this
is prefectly alright. all i want to do is, whenever such situation
occurs i want to throw my custom error instead of the sql server's
default error msg.
any idea,suggestion are most welcome.
Database : Sql Server 2000
thanks,
LuckyIf you are using the insert statement within a stored procedure, you
can use the @.@.ERROR variable and RAISERROR with your custom message.
Regards
Manisha Gandhi
lucky wrote:
> Hi guys!
> i've very basic knowledge of DB as i'm a software developer i dont know
> much about the DB other then writing Queries.
> now, the problem is, i'm in a situation, where i need to throw a custom
> error whenever some specific error occure while deleting the record
> from the table.
> the Scenrio is, like this:
> i've table that has refencial intigrity constraint. it disallow to
> delete the parent row if it is refered in the child table twice. this
> is prefectly alright. all i want to do is, whenever such situation
> occurs i want to throw my custom error instead of the sql server's
> default error msg.
> any idea,suggestion are most welcome.
> Database : Sql Server 2000
> thanks,
> Lucky|||thanks for your replay,
but the situation is, after i implemented, what u suggested, now it
throws 2 errors. one is my custom error and another is default SQL
Server error.
how can i stop sql server to throw it's own an error?
Lucky|||You cannot prevent a raised error from being returned to the client in SQL
2000. SQL 2005 provides a try/catch construct that can meet your
requirement.
Hope this helps.
Dan Guzman
SQL Server MVP
"lucky" <tushar.n.patel@.gmail.com> wrote in message
news:1164629710.750116.166010@.f16g2000cwb.googlegroups.com...
> thanks for your replay,
> but the situation is, after i implemented, what u suggested, now it
> throws 2 errors. one is my custom error and another is default SQL
> Server error.
> how can i stop sql server to throw it's own an error?
> Lucky
>

how to throw Custom Error instead of Default SQL Server Error

Hi guys!
i've very basic knowledge of DB as i'm a software developer i dont know
much about the DB other then writing Queries.
now, the problem is, i'm in a situation, where i need to throw a custom
error whenever some specific error occure while deleting the record
from the table.
the Scenrio is, like this:
i've table that has refencial intigrity constraint. it disallow to
delete the parent row if it is refered in the child table twice. this
is prefectly alright. all i want to do is, whenever such situation
occurs i want to throw my custom error instead of the sql server's
default error msg.
any idea,suggestion are most welcome.
Database : Sql Server 2000
thanks,
Lucky
If you are using the insert statement within a stored procedure, you
can use the @.@.ERROR variable and RAISERROR with your custom message.
Regards
Manisha Gandhi
lucky wrote:
> Hi guys!
> i've very basic knowledge of DB as i'm a software developer i dont know
> much about the DB other then writing Queries.
> now, the problem is, i'm in a situation, where i need to throw a custom
> error whenever some specific error occure while deleting the record
> from the table.
> the Scenrio is, like this:
> i've table that has refencial intigrity constraint. it disallow to
> delete the parent row if it is refered in the child table twice. this
> is prefectly alright. all i want to do is, whenever such situation
> occurs i want to throw my custom error instead of the sql server's
> default error msg.
> any idea,suggestion are most welcome.
> Database : Sql Server 2000
> thanks,
> Lucky
|||thanks for your replay,
but the situation is, after i implemented, what u suggested, now it
throws 2 errors. one is my custom error and another is default SQL
Server error.
how can i stop sql server to throw it's own an error?
Lucky
|||You cannot prevent a raised error from being returned to the client in SQL
2000. SQL 2005 provides a try/catch construct that can meet your
requirement.
Hope this helps.
Dan Guzman
SQL Server MVP
"lucky" <tushar.n.patel@.gmail.com> wrote in message
news:1164629710.750116.166010@.f16g2000cwb.googlegr oups.com...
> thanks for your replay,
> but the situation is, after i implemented, what u suggested, now it
> throws 2 errors. one is my custom error and another is default SQL
> Server error.
> how can i stop sql server to throw it's own an error?
> Lucky
>
sql

how to throw Custom Error instead of Default SQL Server Error

Hi guys!
i've very basic knowledge of DB as i'm a software developer i dont know
much about the DB other then writing Queries.
now, the problem is, i'm in a situation, where i need to throw a custom
error whenever some specific error occure while deleting the record
from the table.
the Scenrio is, like this:
i've table that has refencial intigrity constraint. it disallow to
delete the parent row if it is refered in the child table twice. this
is prefectly alright. all i want to do is, whenever such situation
occurs i want to throw my custom error instead of the sql server's
default error msg.
any idea,suggestion are most welcome.
Database : Sql Server 2000
thanks,
LuckyIf you are using the insert statement within a stored procedure, you
can use the @.@.ERROR variable and RAISERROR with your custom message.
Regards
Manisha Gandhi
lucky wrote:
> Hi guys!
> i've very basic knowledge of DB as i'm a software developer i dont know
> much about the DB other then writing Queries.
> now, the problem is, i'm in a situation, where i need to throw a custom
> error whenever some specific error occure while deleting the record
> from the table.
> the Scenrio is, like this:
> i've table that has refencial intigrity constraint. it disallow to
> delete the parent row if it is refered in the child table twice. this
> is prefectly alright. all i want to do is, whenever such situation
> occurs i want to throw my custom error instead of the sql server's
> default error msg.
> any idea,suggestion are most welcome.
> Database : Sql Server 2000
> thanks,
> Lucky|||thanks for your replay,
but the situation is, after i implemented, what u suggested, now it
throws 2 errors. one is my custom error and another is default SQL
Server error.
how can i stop sql server to throw it's own an error?
Lucky|||You cannot prevent a raised error from being returned to the client in SQL
2000. SQL 2005 provides a try/catch construct that can meet your
requirement.
Hope this helps.
Dan Guzman
SQL Server MVP
"lucky" <tushar.n.patel@.gmail.com> wrote in message
news:1164629710.750116.166010@.f16g2000cwb.googlegroups.com...
> thanks for your replay,
> but the situation is, after i implemented, what u suggested, now it
> throws 2 errors. one is my custom error and another is default SQL
> Server error.
> how can i stop sql server to throw it's own an error?
> Lucky
>

How to tell whether SQL Server is listening on port 1433 and port

If I run netstat -a on a machine with a default instance of SQL Server 2000 and the port has not been changed, should I see port 1433 and port 1434? Does it matter which SQL Server service pack has been applied?
Hi,
The port should be 1433.
You can the see the port SQl Serevr Listening by-
1. Open Server network utility
2. In the enabled protocols -- Select TCP /IP and click properties to get
the PORT number.
Note:
For Default Instance SQL Server listen on port 1433, which is static.
Thanks
Hari
MCDBA
"peter" <peter@.discussions.microsoft.com> wrote in message
news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
> If I run netstat -a on a machine with a default instance of SQL Server
2000 and the port has not been changed, should I see port 1433 and port
1434? Does it matter which SQL Server service pack has been applied?
>
|||Port 1433 is used by default only for the default (unnamed) instance
of the server. Named instances communicate over random prt numbers
unless you set them for port 1433 using the Server Network Utility.
Look under Program files and run the Svrnetcn.exe file that is in the
SQL Server Tools\Binn folder
See the article:
http://support.microsoft.com/default.aspx?kbid=814130
On Sun, 20 Jun 2004 08:02:18 +0530, "Hari Prasad"
<hari_prasad_k@.hotmail.com> wrote:

>Hi,
>The port should be 1433.
>You can the see the port SQl Serevr Listening by-
>1. Open Server network utility
>2. In the enabled protocols -- Select TCP /IP and click properties to get
>the PORT number.
>--
>Note:
>For Default Instance SQL Server listen on port 1433, which is static.
>Thanks
>Hari
>MCDBA
>
>
>"peter" <peter@.discussions.microsoft.com> wrote in message
>news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
>2000 and the port has not been changed, should I see port 1433 and port
>1434? Does it matter which SQL Server service pack has been applied?
>

How to tell whether SQL Server is listening on port 1433 and port

If I run netstat -a on a machine with a default instance of SQL Server 2000 and the port has not been changed, should I see port 1433 and port 1434? Does it matter which SQL Server service pack has been applied?Hi,
The port should be 1433.
You can the see the port SQl Serevr Listening by-
1. Open Server network utility
2. In the enabled protocols -- Select TCP /IP and click properties to get
the PORT number.
--
Note:
For Default Instance SQL Server listen on port 1433, which is static.
Thanks
Hari
MCDBA
"peter" <peter@.discussions.microsoft.com> wrote in message
news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
> If I run netstat -a on a machine with a default instance of SQL Server
2000 and the port has not been changed, should I see port 1433 and port
1434? Does it matter which SQL Server service pack has been applied?
>|||Hi Hari,
I can see port 1433 in the Server Network Utility. But I don't see port 1433 when I run netstat -a to check what port is active. I'm using Windows XP SP2 RC2 and have disabled Windows Firewall.
Thank you for your help,
Peter
"Hari Prasad" wrote:
> Hi,
> The port should be 1433.
> You can the see the port SQl Serevr Listening by-
> 1. Open Server network utility
> 2. In the enabled protocols -- Select TCP /IP and click properties to get
> the PORT number.
> --
> Note:
> For Default Instance SQL Server listen on port 1433, which is static.
> Thanks
> Hari
> MCDBA
>
>
> "peter" <peter@.discussions.microsoft.com> wrote in message
> news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
> > If I run netstat -a on a machine with a default instance of SQL Server
> 2000 and the port has not been changed, should I see port 1433 and port
> 1434? Does it matter which SQL Server service pack has been applied?
> >
> >
>
>|||Hi,
Login to SQL server using a query analyzer window and issue the below
command from command prompt
nbtstat -n
In the local address you iwl be able to see the server ip addree:1433
Otherwise :- , From command prompt Telnet and see whether the port 1433 is
accessible.
TELNET ipaddress 1433
If the port is accessible, automatically the connection will be accessible
else u will get an error.
Thanks
Hari
MCDBA
"peter" <peter@.discussions.microsoft.com> wrote in message
news:142340D1-70EB-4F27-BF82-E2C8ED172081@.microsoft.com...
> Hi Hari,
> I can see port 1433 in the Server Network Utility. But I don't see port
1433 when I run netstat -a to check what port is active. I'm using Windows
XP SP2 RC2 and have disabled Windows Firewall.
> Thank you for your help,
> Peter
> "Hari Prasad" wrote:
> > Hi,
> >
> > The port should be 1433.
> >
> > You can the see the port SQl Serevr Listening by-
> >
> > 1. Open Server network utility
> > 2. In the enabled protocols -- Select TCP /IP and click properties to
get
> > the PORT number.
> >
> > --
> >
> > Note:
> > For Default Instance SQL Server listen on port 1433, which is static.
> >
> > Thanks
> > Hari
> > MCDBA
> >
> >
> >
> >
> > "peter" <peter@.discussions.microsoft.com> wrote in message
> > news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
> > > If I run netstat -a on a machine with a default instance of SQL Server
> > 2000 and the port has not been changed, should I see port 1433 and port
> > 1434? Does it matter which SQL Server service pack has been applied?
> > >
> > >
> >
> >
> >|||Port 1433 is used by default only for the default (unnamed) instance
of the server. Named instances communicate over random prt numbers
unless you set them for port 1433 using the Server Network Utility.
Look under Program files and run the Svrnetcn.exe file that is in the
SQL Server Tools\Binn folder
See the article:
http://support.microsoft.com/default.aspx?kbid=814130
On Sun, 20 Jun 2004 08:02:18 +0530, "Hari Prasad"
<hari_prasad_k@.hotmail.com> wrote:
>Hi,
>The port should be 1433.
>You can the see the port SQl Serevr Listening by-
>1. Open Server network utility
>2. In the enabled protocols -- Select TCP /IP and click properties to get
>the PORT number.
>--
>Note:
>For Default Instance SQL Server listen on port 1433, which is static.
>Thanks
>Hari
>MCDBA
>
>
>"peter" <peter@.discussions.microsoft.com> wrote in message
>news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
>> If I run netstat -a on a machine with a default instance of SQL Server
>2000 and the port has not been changed, should I see port 1433 and port
>1434? Does it matter which SQL Server service pack has been applied?
>>
>

How to tell whether SQL Server is listening on port 1433 and port

If I run netstat -a on a machine with a default instance of SQL Server 2000
and the port has not been changed, should I see port 1433 and port 1434? Do
es it matter which SQL Server service pack has been applied?Hi,
The port should be 1433.
You can the see the port SQl Serevr Listening by-
1. Open Server network utility
2. In the enabled protocols -- Select TCP /IP and click properties to get
the PORT number.
Note:
For Default Instance SQL Server listen on port 1433, which is static.
Thanks
Hari
MCDBA
"peter" <peter@.discussions.microsoft.com> wrote in message
news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
> If I run netstat -a on a machine with a default instance of SQL Server
2000 and the port has not been changed, should I see port 1433 and port
1434? Does it matter which SQL Server service pack has been applied?
>|||Port 1433 is used by default only for the default (unnamed) instance
of the server. Named instances communicate over random prt numbers
unless you set them for port 1433 using the Server Network Utility.
Look under Program files and run the Svrnetcn.exe file that is in the
SQL Server Tools\Binn folder
See the article:
http://support.microsoft.com/default.aspx?kbid=814130
On Sun, 20 Jun 2004 08:02:18 +0530, "Hari Prasad"
<hari_prasad_k@.hotmail.com> wrote:

>Hi,
>The port should be 1433.
>You can the see the port SQl Serevr Listening by-
>1. Open Server network utility
>2. In the enabled protocols -- Select TCP /IP and click properties to get
>the PORT number.
>--
>Note:
>For Default Instance SQL Server listen on port 1433, which is static.
>Thanks
>Hari
>MCDBA
>
>
>"peter" <peter@.discussions.microsoft.com> wrote in message
>news:17C8C6CA-4929-41B8-BA6E-2FEF6AAB91BD@.microsoft.com...
>2000 and the port has not been changed, should I see port 1433 and port
>1434? Does it matter which SQL Server service pack has been applied?
>

Wednesday, March 21, 2012

How to tell SQL Server to use the default constraint name when adding one?

Hi guys,

I have this problem. I want to add a new primary key to a table but i want the name of the contstraint to be generated by the system. I have this TSQL code.

ALTER TABLE TableTest
ADD CONSTRAINT PRIMARY KEY (C1)


Reading the BOL, it says that if you don't supply a name for the constraint it generates one. But I get this error "Incorrect syntax near the keyword 'PRIMARY'".

If I add a name to the constraint, it works fine.
I'm using SQL Server 2000

Thanks
DarkneonAt least you have read and tried. Enclosed is a script that creates a table we use to trace deadlocks. The first created the primary key as it creates the table. The second alters the table after creation to add the primary key. Note that the constraint is named PK_tbl_trace_deadlock:



CREATE TABLE [dbo].[tblm_trace_deadlock] (
[row_id] [int] IDENTITY (1, 1) NOT NULL ,
[import_id] [int] NOT NULL ,
[BinaryData] [image] NULL ,
[DatabaseID] [int] NULL ,
[NTUserName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[NTDomainName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[HostName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ClientProcessID] [int] NULL ,
[ApplicationName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[LoginName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SPID] [int] NULL ,
[Duration] [bigint] NULL ,
[StartTime] [datetime] NULL ,
[EndTime] [datetime] NULL ,
[EventSubClass] [int] NULL ,
[ObjectID] [int] NULL ,
[IndexID] [int] NULL ,
[IntegerData] [int] NULL ,
[ServerName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EventClass] [int] NULL ,
[Mode] [int] NULL ,
[DBUserName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
CONSTRAINT [PK_tbl_trace_deadlock] PRIMARY KEY CLUSTERED
(
[row_id]
) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblm_trace_deadlock]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblm_trace_deadlock]
GO

CREATE TABLE [dbo].[tblm_trace_deadlock] (
[row_id] [int] IDENTITY (1, 1) NOT NULL ,
[import_id] [int] NOT NULL ,
[BinaryData] [image] NULL ,
[DatabaseID] [int] NULL ,
[NTUserName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[NTDomainName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[HostName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ClientProcessID] [int] NULL ,
[ApplicationName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[LoginName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SPID] [int] NULL ,
[Duration] [bigint] NULL ,
[StartTime] [datetime] NULL ,
[EndTime] [datetime] NULL ,
[EventSubClass] [int] NULL ,
[ObjectID] [int] NULL ,
[IndexID] [int] NULL ,
[IntegerData] [int] NULL ,
[ServerName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EventClass] [int] NULL ,
[Mode] [int] NULL ,
[DBUserName] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[tblm_trace_deadlock] WITH NOCHECK ADD
CONSTRAINT [PK_tbl_trace_deadlock] PRIMARY KEY CLUSTERED
(
[row_id]
) ON [PRIMARY]
GO|||Hey tomh53,

Thanks for your input, but it's not quite what I am looking for. The script you submited creates a primary key with the name you supplied to it. I want to use the name that is automatically generated by the system. For example, in Entreprise Managed, when you set a primary key it generates a name for you. I want it to do the same thing, except the primary key is set programatically.

Here's what the BOL says:

"
constraint_name

Is the new constraint. Constraint names must follow the rules for identifiers, except that the name cannot begin with a number sign (#). If constraint_name is not supplied, a system-generated name is assigned to the constraint."

But like I said, it generates an error instead of a name for me.

Darkneon|||Why would you want to allow abiguity to exist when you have an opportunity to make something meaningful out of the constraint naming process. Allow me to quote from Inside SQL Server 200 by Kalen Delaney regarding system generated constraint names:


The advantage of explicitly naming your constraint rather than using the system-generated name is greater clarity. The constraint name is used in the error message for any constraint violation, so creating a name such as CUSTOMER_PK probably makes more sense to users than a name such as PK__customer__cust_i__0677FF3C. You should choose your own constraint names if such error messages are visible to your users.

The first two characters (PK) show the constraint typePK for PRIMARY KEY, UQ for UNIQUE, FK for FOREIGN KEY, and DF for DEFAULT. Next are two underscore characters, which are used as a separator. (You might be tempted to use one underscore to conserve characters and to avoid having to truncate as much. However, it's common to use a single underscore in a table name or a column name, both of which appear in the constraint name. Using two underscore characters distinguishes the kind of a name it is and where the separation occurs.)
Next comes the table name (customer), which is limited to 116 characters for a PRIMARY KEY constraint and slightly fewer characters for all other constraint names. For all constraints other than PRIMARY KEY, there are then two more underscore characters for separation followed by the next sequence of characters, which is the column name. The column name is truncated to five characters if necessary. If the column name has fewer than five characters in it, the length of the table name portion can be slightly longer.

And finally, the hexadecimal representation of the object ID for the constraint (68E79C55) comes after another separator. (This value is used as the id column of the sysobjects system table and the constid column of the sysconstraints system table.) Object names are limited to 128 characters in SQL Server 2000, so the total length of all portions of the constraint name must also be less than or equal to 128.|||But if you insist in shooting yourself in the foot, here it is:



CREATE TABLE [dbo].[bozo] (
row_id int IDENTITY (1, 1) NOT NULL ,
clownname varchar(20) NOT NULL ,
PRIMARY KEY CLUSTERED (row_id)
)
GO|||You should choose your own constraint names if such error messages are visible to your users.

This was the primary reason we did not mind using system generated names.
But it's ok now, I've talked with me collegue and we decided that we are going to give a name to the constraints.

By the way, the code snippet you provided is not good when you have a already existing table which is missing a primary key. Anyways, if someone knows the answers to my question, I am still interested. Otherwise, I close the discussion to my original question here.

Darkneon|||Look at the last two statements of the large block of code. The first one creates the table without a PK. The second one alters the table to add a PK. To take the small snippet, create the table, and then add the PK is:



CREATE TABLE [dbo].[bozo] (
row_id int IDENTITY (1, 1) NOT NULL ,
clownname varchar(20) NOT NULL
)
GO

alter table bozo
add
PRIMARY KEY CLUSTERED (row_id)
GO|||Thanks,

I tested it and it worked, with the name generated and everything. It is always good to know how to do stuff :D

Darkneon

Friday, February 24, 2012

How to store euro currency symbol?

I have a problem to store Euro symbol "â?¬" in the MS SQL 2000 database: it is
stored as "?".
The database default collation used is 'SQL_latin1_General_CP1_CI_AS (code
page 1252)". This doesn't support euro symbol. I found the only standard
character set that contains euro is "Latin-9 (ISO-8859-15)", Latin1 doesn't.
There's also an article describes the international feature of MS SQL server
200
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/intlfeaturesinsqlserver2000.asp>
However I didn't find which specific collation or code page support Euro
symbol from this article, all it says is any column of 'money' or
'smallmoney' type can include a currency symbol such as euro "â?¬"
Does any body know which collation of MS SQL 2000 support euro symbol?
Does the column type has to be "money" to store it?
How do I store it?
ThxHi Tina,
I do not have any problems in storing the Euro symbol in my database with
the SQL_latin1_General_CP1_CI_AS collation.
How do you insert the euro symbol into your record?
--
HTH
Karl Gram
"Tina" <Tina@.discussions.microsoft.com> wrote in message
news:3E881A78-5D70-4319-9FEB-B0C91795370D@.microsoft.com...
>I have a problem to store Euro symbol "?" in the MS SQL 2000 database: it
>is
> stored as "?".
> The database default collation used is 'SQL_latin1_General_CP1_CI_AS (code
> page 1252)". This doesn't support euro symbol. I found the only standard
> character set that contains euro is "Latin-9 (ISO-8859-15)", Latin1
> doesn't.
> There's also an article describes the international feature of MS SQL
> server
> 2000
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/intlfeaturesinsqlserver2000.asp>
> However I didn't find which specific collation or code page support Euro
> symbol from this article, all it says is any column of 'money' or
> 'smallmoney' type can include a currency symbol such as euro "?"
> Does any body know which collation of MS SQL 2000 support euro symbol?
> Does the column type has to be "money" to store it?
> How do I store it?
> Thx
>

How to store euro currency symbol?

I have a problem to store Euro symbol "€" in the MS SQL 2000 database: it is
stored as "?".
The database default collation used is 'SQL_latin1_General_CP1_CI_AS (code
page 1252)". This doesn't support euro symbol. I found the only standard
character set that contains euro is "Latin-9 (ISO-8859-15)", Latin1 doesn't.
There's also an article describes the international feature of MS SQL server
2000
<http://msdn.microsoft.com/library/de...server2000.asp>
However I didn't find which specific collation or code page support Euro
symbol from this article, all it says is any column of 'money' or
'smallmoney' type can include a currency symbol such as euro "€"
Does any body know which collation of MS SQL 2000 support euro symbol?
Does the column type has to be "money" to store it?
How do I store it?
Thx
Hi Tina,
I do not have any problems in storing the Euro symbol in my database with
the SQL_latin1_General_CP1_CI_AS collation.
How do you insert the euro symbol into your record?
HTH
Karl Gram
"Tina" <Tina@.discussions.microsoft.com> wrote in message
news:3E881A78-5D70-4319-9FEB-B0C91795370D@.microsoft.com...
>I have a problem to store Euro symbol "?" in the MS SQL 2000 database: it
>is
> stored as "?".
> The database default collation used is 'SQL_latin1_General_CP1_CI_AS (code
> page 1252)". This doesn't support euro symbol. I found the only standard
> character set that contains euro is "Latin-9 (ISO-8859-15)", Latin1
> doesn't.
> There's also an article describes the international feature of MS SQL
> server
> 2000
> <http://msdn.microsoft.com/library/de...server2000.asp>
> However I didn't find which specific collation or code page support Euro
> symbol from this article, all it says is any column of 'money' or
> 'smallmoney' type can include a currency symbol such as euro "?"
> Does any body know which collation of MS SQL 2000 support euro symbol?
> Does the column type has to be "money" to store it?
> How do I store it?
> Thx
>

How to store euro currency symbol?

I have a problem to store Euro symbol "€" in the MS SQL 2000 database: it
is
stored as "?".
The database default collation used is 'SQL_latin1_General_CP1_CI_AS (code
page 1252)". This doesn't support euro symbol. I found the only standard
character set that contains euro is "Latin-9 (ISO-8859-15)", Latin1 doesn't.
There's also an article describes the international feature of MS SQL server
2000
<lfeaturesinsqlserver2000.asp" target="_blank">http://msdn.microsoft.com/library/d...lserver2000.asp>
However I didn't find which specific collation or code page support Euro
symbol from this article, all it says is any column of 'money' or
'smallmoney' type can include a currency symbol such as euro "€"
Does any body know which collation of MS SQL 2000 support euro symbol?
Does the column type has to be "money" to store it?
How do I store it?
ThxHi Tina,
I do not have any problems in storing the Euro symbol in my database with
the SQL_latin1_General_CP1_CI_AS collation.
How do you insert the euro symbol into your record?
HTH
Karl Gram
"Tina" <Tina@.discussions.microsoft.com> wrote in message
news:3E881A78-5D70-4319-9FEB-B0C91795370D@.microsoft.com...
>I have a problem to store Euro symbol "?" in the MS SQL 2000 database: it
>is
> stored as "?".
> The database default collation used is 'SQL_latin1_General_CP1_CI_AS (code
> page 1252)". This doesn't support euro symbol. I found the only standard
> character set that contains euro is "Latin-9 (ISO-8859-15)", Latin1
> doesn't.
> There's also an article describes the international feature of MS SQL
> server
> 2000
> <ntlfeaturesinsqlserver2000.asp" target="_blank">http://msdn.microsoft.com/library/d...lserver2000.asp>
> However I didn't find which specific collation or code page support Euro
> symbol from this article, all it says is any column of 'money' or
> 'smallmoney' type can include a currency symbol such as euro "?"
> Does any body know which collation of MS SQL 2000 support euro symbol?
> Does the column type has to be "money" to store it?
> How do I store it?
> Thx
>

Sunday, February 19, 2012

How to stop report parameter taking default value

I have a SSRS2000 report with three parameters:
1) Company - values from a query including NULL for ALL companies - no
default value
2) From date - has default value
3) To date - has default value
My problem is that the report runs automatically when launched. Even though
there is no default value specified for the Company parameter it takes the
NULL value.
Is there any way to change this to force the Company prompt to display a
<select a value> and allow selection of one of the options?
--
Magendo_man
Freelance SQL Reporting Services developer
Stirling, ScotlandHello magendo_man,
Instead of letting it take the value or NULL... change to: (CompanyID =@.Company OR @.CompanyID = "ALL"). Then in your query that supplies the
company names add a UNION SELECT "ALL". Don't specify a default for that
parameter.
Hope that helps!
Cheers,
Kathy
"magendo_man" wrote:
> I have a SSRS2000 report with three parameters:
> 1) Company - values from a query including NULL for ALL companies - no
> default value
> 2) From date - has default value
> 3) To date - has default value
> My problem is that the report runs automatically when launched. Even though
> there is no default value specified for the Company parameter it takes the
> NULL value.
> Is there any way to change this to force the Company prompt to display a
> <select a value> and allow selection of one of the options?
>
> --
> Magendo_man
> Freelance SQL Reporting Services developer
> Stirling, Scotland

How to stop Default Params from running rpt

I have default parameters set up in my report to make it easier for the users
to have an idea on what types on inputs the report expects. How do I now get
the report to stop automatically running as soon as someone brings it up?
thanks in advance!"Carl Henthorn" wrote:
> I have default parameters set up in my report to make it easier for the users
> to have an idea on what types on inputs the report expects. How do I now get
> the report to stop automatically running as soon as someone brings it up?
> thanks in advance!
Maybe there is a better solution, but this may be a useful workaround :
create one extra parameter.. in the non queried list of values add 1 value
(start), do not give it a default value. The query only starts if that
parameter is set to start. You don't have to use it anywhere in your report..

How to stop automatic excution of a report?

Hi,

I have a report containing one multi-value parameter with default values given. When open I report in Report Manager, report executes automatically. I need to stop this automatic execution of report. I need to give user an option to check if default values are ok for him or not. Is there any way other than removing default value from parameter to do this?

Thanks in anticipation.

Saeed

Sorry, there is no way to achieve this behavior in Report Manager. You need to remove the default value, otherwise the report will render.|||

It is unfortunate that this was not considered as a requirement during development. However, you can work around this by adding an additional report parameter. Add a Start Report parameter as a string with 1 non-queried availabIe value like 'Yes'. The report will not render until the user selects the only available option for that parameter. Its not the best solution but is a viable workaround to the default rendering problem.

|||Hi
Rather than use default parameters in a report why dont you make the report show a list of valid values e.g. from a query and the user will sellect appropriate value.
e.g.

A report uses a paramater param1; create a dataset with a sql query that generates valid values and make your report parameter populate from this dataset. You can set the default value to null so that the report prompts for the parameters from the valid list.

How to stop automatic excution of a report?

Hi,

I have a report containing one multi-value parameter with default values given. When open I report in Report Manager, report executes automatically. I need to stop this automatic execution of report. I need to give user an option to check if default values are ok for him or not. Is there any way other than removing default value from parameter to do this?

Thanks in anticipation.

Saeed

Sorry, there is no way to achieve this behavior in Report Manager. You need to remove the default value, otherwise the report will render.|||

It is unfortunate that this was not considered as a requirement during development. However, you can work around this by adding an additional report parameter. Add a Start Report parameter as a string with 1 non-queried availabIe value like 'Yes'. The report will not render until the user selects the only available option for that parameter. Its not the best solution but is a viable workaround to the default rendering problem.

|||Hi
Rather than use default parameters in a report why dont you make the report show a list of valid values e.g. from a query and the user will sellect appropriate value.
e.g.

A report uses a paramater param1; create a dataset with a sql query that generates valid values and make your report parameter populate from this dataset. You can set the default value to null so that the report prompts for the parameters from the valid list.