Showing posts with label defined. Show all posts
Showing posts with label defined. Show all posts

Tuesday, March 27, 2012

Cant Get Decimal to Show Up!

Hey...I've been cracking head about this one all day, and I'm sure it's
an easy answer, but here goes:

I have a column entitled Sequ which is defined as a Decimal with
Precision 10 and Scale 5. In an ASP.NET page, I'm performing a
calculation which is inserted into the Sequ column. I'm doing a
response.write, which enables me to see that the numbers are in fact
being calculated correctly complete with a string of numbers after the
decimal, but when I pull the numbers out to use on the page or access
the table, Sequ lists all numbers as integers. I'm using a stored
procedure in which I'm declaring the @.calc parameter (the calculated
value which is being inserted) as a Decimal -- I don't know what I'm
doing wrong. Help appreciated...thanks.

ErikOn 2 Jan 2005 12:27:13 -0800, erikthenomad@.hotmail.com wrote:

(snip)
> I'm using a stored
>procedure in which I'm declaring the @.calc parameter (the calculated
>value which is being inserted) as a Decimal

Hi Erik,

Like this

DECLARE @.calc decimal (10,5)

or like this

DECLARE @.calc decimal

In the latter case, you've declared the variable with default scale (18)
and default precision (0).

In the former case, there must be something else wrong. It might help if
you post the complete code for the stored procedure.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo,

Thanks for the help -- I ended up trying "smallmoney" while awaiting a
response, which did the trick quite nicely (I don't need more than four
decimal places); are there any drawbacks to that? I think the issue
was that I had not specifically declared the precision of the decimal,
thinking it would be taken care of already since I had already declared
it in the table design.

Erik|||On 2 Jan 2005 13:47:52 -0800, erikthenomad@.hotmail.com wrote:

>Hugo,
>Thanks for the help -- I ended up trying "smallmoney" while awaiting a
>response, which did the trick quite nicely (I don't need more than four
>decimal places); are there any drawbacks to that?

Hi Erik,

The value will be implicitly ocnverted from decimal (10,5) to smallmoney.
You'll lose the fifth decimal, as smallmoney and money have a precision of
four decimal places. The maximum for smallmoney is over 200,000, so you
won't have problems with that. The conversion will have a very small
effect on performance. If the parameter is used in a WHERE clause and
compared to a decimal column, the parameter will be converted back.

The main drawback is that you'll fail to understand the logic when you
have to get back to the code, several months from now.

> I think the issue
>was that I had not specifically declared the precision of the decimal,
>thinking it would be taken care of already since I had already declared
>it in the table design.

If you declare a variable, SQL Server can't know if you'll use it to store
values from a column, let alone know for which column. So SQL Server will
just use the defaults if you don't specify precision.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)sql

Thursday, March 8, 2012

can't delete a full text catalog

Hello
I've defined a full text catalog that indexes several columns from two tables.
Now I want to erase it and it simply don't let me... using the console it
reports that my catalog has been lost and to use sp_fulltext_catalog to
repopulate or rebuild it...
I tryied so and the error was the same...
i need to erase that useless catalog because it don't work anymore and i
need to do another one with the same name...
how can i get it done?!?!
best regards
Jorge Ribeiro
Can you try to right click on your table in EM, and select Full Text Index
Table, and then select edit. Click through the dialogs until you get the new
catalog creation dialog. Create a new catalog.
This will clear some of this class of errors. If this won't work you will
probably have to use some of the full text procedures and possibly manually
remove some rows from the system tables. Post back here and I'll try to
help you further with this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Jorge Ribeiro" <JorgeRibeiro@.discussions.microsoft.com> wrote in message
news:F60177EB-6333-4755-A035-202EC62FB27F@.microsoft.com...
> Hello
> I've defined a full text catalog that indexes several columns from two
tables.
> Now I want to erase it and it simply don't let me... using the console it
> reports that my catalog has been lost and to use sp_fulltext_catalog to
> repopulate or rebuild it...
> I tryied so and the error was the same...
> i need to erase that useless catalog because it don't work anymore and i
> need to do another one with the same name...
> how can i get it done?!?!
> best regards
> Jorge Ribeiro
|||Hi
I've done what you sujested (create a new catalog) and the result was the
same... the catalog has been lost and so on...
it didn't create a new catalog and the old one still persists
what can I do now?!?!
thanx
Jorge Ribeiro
"Hilary Cotter" wrote:

> Can you try to right click on your table in EM, and select Full Text Index
> Table, and then select edit. Click through the dialogs until you get the new
> catalog creation dialog. Create a new catalog.
> This will clear some of this class of errors. If this won't work you will
> probably have to use some of the full text procedures and possibly manually
> remove some rows from the system tables. Post back here and I'll try to
> help you further with this.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "Jorge Ribeiro" <JorgeRibeiro@.discussions.microsoft.com> wrote in message
> news:F60177EB-6333-4755-A035-202EC62FB27F@.microsoft.com...
> tables.
>
>
|||drop the catalog using sp_fulltext_catalog 'catalogname', 'drop'
After you have completed doing this, delete the rows from
sysfulltextcatalogs
Then try to build your catalogs again.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"Jorge Ribeiro" <JorgeRibeiro@.discussions.microsoft.com> wrote in message
news:C159A27C-6C4F-4743-B532-1FF11E754DA4@.microsoft.com...[vbcol=seagreen]
> Hi
> I've done what you sujested (create a new catalog) and the result was the
> same... the catalog has been lost and so on...
> it didn't create a new catalog and the old one still persists
> what can I do now?!?!
> thanx
> Jorge Ribeiro
>
> "Hilary Cotter" wrote:
Index[vbcol=seagreen]
new[vbcol=seagreen]
will[vbcol=seagreen]
manually[vbcol=seagreen]
message[vbcol=seagreen]
it[vbcol=seagreen]
to[vbcol=seagreen]
i[vbcol=seagreen]
|||i've already done that
i've got an error message
Cannot drop full-text catalog 'cat_intranet_teste_paginas' because it
contains a full-text index.
can i still delete the catalog row from sysfulltextcatalogs?!
will it work?!?!
"Hilary Cotter" wrote:

> drop the catalog using sp_fulltext_catalog 'catalogname', 'drop'
> After you have completed doing this, delete the rows from
> sysfulltextcatalogs
> Then try to build your catalogs again.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> Now available for purchase at:
> http://www.nwsu.com/0974973602.html
>
> "Jorge Ribeiro" <JorgeRibeiro@.discussions.microsoft.com> wrote in message
> news:C159A27C-6C4F-4743-B532-1FF11E754DA4@.microsoft.com...
> Index
> new
> will
> manually
> message
> it
> to
> i
>
>
|||back up your database. Then delete the rows.
Then try to create another catalog, and go back and edit the tables to move
them to the new catalog.
"Jorge Ribeiro" <JorgeRibeiro@.discussions.microsoft.com> wrote in message
news:096B13D9-C590-4B33-A2BF-C076FED64EDC@.microsoft.com...[vbcol=seagreen]
> i've already done that
> i've got an error message
> Cannot drop full-text catalog 'cat_intranet_teste_paginas' because it
> contains a full-text index.
> can i still delete the catalog row from sysfulltextcatalogs?!
> will it work?!?!
> "Hilary Cotter" wrote:
message[vbcol=seagreen]
the[vbcol=seagreen]
the[vbcol=seagreen]
try to[vbcol=seagreen]
two[vbcol=seagreen]
console[vbcol=seagreen]
sp_fulltext_catalog[vbcol=seagreen]
and[vbcol=seagreen]