Showing posts with label column. Show all posts
Showing posts with label column. Show all posts

Thursday, 8 March 2012

Connect 2 databases on 2 servers ??

Hi,

If you have 2 databases with the exact same table columns, and in the first database in a table column the indentidy seed starts at 1 and finishes at 32,000 can you attatch a second database so that the indentity starts at 32,001and carries on.


What happens if you create a site and run out of disk space and need to attach another database which is located on another server?

I am really confused about this.Hope someone can give some links to some articles about this as I can't find any information about it.

How can this be done?

Thanks

robinwilliams:

If you have 2 databases with the exact same table columns, and in the first database in a table column the indentidy seed starts at 1 and finishes at 32,000 can you attatch a second database so that the indentity starts at 32,001and carries on.

Yes, you can!
Just use DTS (in SQL Server 2000) or SSIS (in SQL Server 2005) and while trasfering the data select the "Append Data" option, but make sure the data type of the identity column in the source table is able to deal with new records (have enough size) [e.g. make it INT].

robinwilliams:

What happens if you create a site and run out of disk space and need to attach another database which is located on another server?

What do you mean by another server? Is it physically another server (e.g. using another disk)? If yes, the database files (.mdf, .ndf, .ldf) will be in that server using its disks which are diffrent than the ones have no enough space.
Once you are runing out of space, you will receive error indicating that (e.g. in Enterpise Manager or Management Studio), So always have more space than you need by 2-4GB at least.

Good luck.

Wednesday, 7 March 2012

Confusing arithmetic overflow error

I have a numeric column whoose precision is 7 and scale is 3.
My first question is how come the length is reported as 5 in Enterprise
Managaer?
Secondly, whilst trying to update values in these columns I get
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely, any
of these values should fit nicely into my defined data type? Why is this
occuring?
Cheers,
elzikoThe length is reported as 5 because that's the number of bytes that the
datatype occupies.
Precision 7, scale 3 = XXXX.YYY
4 digits to the left of the decimal point, 3 to the right.
-16942.18 has 5 to the left, 2 to the right. That's why it's failing.
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:OC9W741jEHA.592@.TK2MSFTNGP11.phx.gbl...
> I have a numeric column whoose precision is 7 and scale is 3.
> My first question is how come the length is reported as 5 in Enterprise
> Managaer?
> Secondly, whilst trying to update values in these columns I get
> Server: Msg 8115, Level 16, State 8, Line 1
> Arithmetic overflow error converting numeric to data type numeric.
> The statement has been terminated.
> ...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely,
any
> of these values should fit nicely into my defined data type? Why is this
> occuring?
> --
> Cheers,
> elziko
>|||Oh it appears I counted four to the left... stupid me! Sorry & thanks!|||If you read in BOL (decimal and numeric) there is a table that specifies how
many bytes to store numeric data based on the precision.
As for your overflow this is occurring, because you ask for 3 digits to the
right of the decimal point to be stored (scale), but the total length of the
the number to only be 7 digits long (precision). Therefore the numbers you
are trying to use really have 8 digit precision (i.e -16942.18, is
really -16942.180).
----
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:OC9W741jEHA.592@.TK2MSFTNGP11.phx.gbl...
> I have a numeric column whoose precision is 7 and scale is 3.
> My first question is how come the length is reported as 5 in Enterprise
> Managaer?
> Secondly, whilst trying to update values in these columns I get
> Server: Msg 8115, Level 16, State 8, Line 1
> Arithmetic overflow error converting numeric to data type numeric.
> The statement has been terminated.
> ...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely,
any
> of these values should fit nicely into my defined data type? Why is this
> occuring?
> --
> Cheers,
> elziko
>

Confusing arithmetic overflow error

I have a numeric column whoose precision is 7 and scale is 3.
My first question is how come the length is reported as 5 in Enterprise
Managaer?
Secondly, whilst trying to update values in these columns I get
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely, any
of these values should fit nicely into my defined data type? Why is this
occuring?
Cheers,
elziko
The length is reported as 5 because that's the number of bytes that the
datatype occupies.
Precision 7, scale 3 = XXXX.YYY
4 digits to the left of the decimal point, 3 to the right.
-16942.18 has 5 to the left, 2 to the right. That's why it's failing.
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:OC9W741jEHA.592@.TK2MSFTNGP11.phx.gbl...
> I have a numeric column whoose precision is 7 and scale is 3.
> My first question is how come the length is reported as 5 in Enterprise
> Managaer?
> Secondly, whilst trying to update values in these columns I get
> Server: Msg 8115, Level 16, State 8, Line 1
> Arithmetic overflow error converting numeric to data type numeric.
> The statement has been terminated.
> ...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely,
any
> of these values should fit nicely into my defined data type? Why is this
> occuring?
> --
> Cheers,
> elziko
>
|||Oh it appears I counted four to the left... stupid me! Sorry & thanks!
|||If you read in BOL (decimal and numeric) there is a table that specifies how
many bytes to store numeric data based on the precision.
As for your overflow this is occurring, because you ask for 3 digits to the
right of the decimal point to be stored (scale), but the total length of the
the number to only be 7 digits long (precision). Therefore the numbers you
are trying to use really have 8 digit precision (i.e -16942.18, is
really -16942.180).
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:OC9W741jEHA.592@.TK2MSFTNGP11.phx.gbl...
> I have a numeric column whoose precision is 7 and scale is 3.
> My first question is how come the length is reported as 5 in Enterprise
> Managaer?
> Secondly, whilst trying to update values in these columns I get
> Server: Msg 8115, Level 16, State 8, Line 1
> Arithmetic overflow error converting numeric to data type numeric.
> The statement has been terminated.
> ...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely,
any
> of these values should fit nicely into my defined data type? Why is this
> occuring?
> --
> Cheers,
> elziko
>

Confusing arithmetic overflow error

I have a numeric column whoose precision is 7 and scale is 3.
My first question is how come the length is reported as 5 in Enterprise
Managaer?
Secondly, whilst trying to update values in these columns I get
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely, any
of these values should fit nicely into my defined data type? Why is this
occuring?
--
Cheers,
elzikoThe length is reported as 5 because that's the number of bytes that the
datatype occupies.
Precision 7, scale 3 = XXXX.YYY
4 digits to the left of the decimal point, 3 to the right.
-16942.18 has 5 to the left, 2 to the right. That's why it's failing.
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:OC9W741jEHA.592@.TK2MSFTNGP11.phx.gbl...
> I have a numeric column whoose precision is 7 and scale is 3.
> My first question is how come the length is reported as 5 in Enterprise
> Managaer?
> Secondly, whilst trying to update values in these columns I get
> Server: Msg 8115, Level 16, State 8, Line 1
> Arithmetic overflow error converting numeric to data type numeric.
> The statement has been terminated.
> ...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely,
any
> of these values should fit nicely into my defined data type? Why is this
> occuring?
> --
> Cheers,
> elziko
>|||Oh it appears I counted four to the left... stupid me! Sorry & thanks!|||If you read in BOL (decimal and numeric) there is a table that specifies how
many bytes to store numeric data based on the precision.
As for your overflow this is occurring, because you ask for 3 digits to the
right of the decimal point to be stored (scale), but the total length of the
the number to only be 7 digits long (precision). Therefore the numbers you
are trying to use really have 8 digit precision (i.e -16942.18, is
really -16942.180).
--
----
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:OC9W741jEHA.592@.TK2MSFTNGP11.phx.gbl...
> I have a numeric column whoose precision is 7 and scale is 3.
> My first question is how come the length is reported as 5 in Enterprise
> Managaer?
> Secondly, whilst trying to update values in these columns I get
> Server: Msg 8115, Level 16, State 8, Line 1
> Arithmetic overflow error converting numeric to data type numeric.
> The statement has been terminated.
> ...for values such as -16942.18, -16939.59, 16935.46, 16939.59. Surely,
any
> of these values should fit nicely into my defined data type? Why is this
> occuring?
> --
> Cheers,
> elziko
>

Friday, 24 February 2012

conflict resolution

I have a merge replication setup.
I am using column level tracking
Subscribers are CLIENTS, so they are at the same level
Initially values in table t1 as
C1 -> 1
C2 -> 2
C3 -> 3
C4 -> 4
Sub1 updates,
C1->11
C2->22
Sub2 updates,
C2->222 (CONFLICT)
C3->33
1.sub1 synchronizes
2.sub2 synchronizes
3.sub1 synchronizes
My final values are,
C1->11
C2->22
C3->3
C4->4
I am expecting
C1->11
C2->22
C3->33
C4->4
Can anyone put some light?
What does the conflict viewer reveal?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Ravi Lobo" <RaviLobo@.discussions.microsoft.com> wrote in message
news:33A93D07-D0DB-416D-8E7A-21D0FB06EEEB@.microsoft.com...
>I have a merge replication setup.
> I am using column level tracking
> Subscribers are CLIENTS, so they are at the same level
> Initially values in table t1 as
> C1 -> 1
> C2 -> 2
> C3 -> 3
> C4 -> 4
> Sub1 updates,
> C1->11
> C2->22
> Sub2 updates,
> C2->222 (CONFLICT)
> C3->33
> 1. sub1 synchronizes
> 2. sub2 synchronizes
> 3. sub1 synchronizes
> My final values are,
> C1->11
> C2->22
> C3->3
> C4->4
> I am expecting
> C1->11
> C2->22
> C3->33
> C4->4
> Can anyone put some light?
>