Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Wednesday, March 28, 2012

Please help - unusual warning when creating a column

Hi everyone,
This is weird. I create a new column programatically using the "ALTER
TABLE" command (you know the one) inside SQL Query Analyzer. The
column is indeed created but the following warning is thrown:
WARNING: The table 'OrderRecords' has been created but its maximum row
size (15,420) exceeds the maximum number of bytes per row (8060).
INSERT or UPDATE of a row in this table will fail if the resulting row
length exceeds 8060 bytes
I then checked a likely column. I ran a wee query to find the maximum
row and it returned a row of maximum length of 2,647 characters.
Now I'm totally confused. Does anyone know why such a warning is being
thrown? Any suggestions/comments/ideas/queries to run - much
appreciated.
Puzzled,
Al.
The whole size of the rows exceeds 8060 bytes, thats the most possible
bytes SQl Server can handle per row, so this is just a warning (not an
error), that it might could be if you exceed the magic border, data
will be truncated.
If you are aware of that and you=B4ll be happy with it or you have
another way to handle this, this is fine, but you should keep that in
mind. For the best you should redesign your table by putting some
values in another table or thinking of changing the actual types of the
columns, if that is possible.
HTH, Jens Suessmeyer.
|||This means that the sum of all you columns can in theory be 15,420
bytes
If someone inserts data and it exceeds 8060 bytes, then the statement
will fail
look at all the field sizes in this table and make sure they don't
exceed 8060 bytes
http://sqlservercode.blogspot.com/
|||> This is weird. I create a new column programatically using the "ALTER
> TABLE" command (you know the one) inside SQL Query Analyzer. The
> column is indeed created but the following warning is thrown:
> WARNING: The table 'OrderRecords' has been created but its maximum row
> size (15,420) exceeds the maximum number of bytes per row (8060).
> INSERT or UPDATE of a row in this table will fail if the resulting row
> length exceeds 8060 bytes
It is a WARNING about the maximum possible rowsize based on the columns
defined for the table. Just guessing, but it is likely that you have a
couple (or a bunch) of large varchar columns in the table that could, if
completely filled with data, exceed the maximum possible rowsize supported
by sql server.
|||Thanks everyone - that's fine. I can live with that. Thanks for all
your feedback.
Al.
The happy one.

Please help - unusual warning when creating a column

Hi everyone,
This is weird. I create a new column programatically using the "ALTER
TABLE" command (you know the one) inside SQL Query Analyzer. The
column is indeed created but the following warning is thrown:
WARNING: The table 'OrderRecords' has been created but its maximum row
size (15,420) exceeds the maximum number of bytes per row (8060).
INSERT or UPDATE of a row in this table will fail if the resulting row
length exceeds 8060 bytes
I then checked a likely column. I ran a wee query to find the maximum
row and it returned a row of maximum length of 2,647 characters.
Now I'm totally confused. Does anyone know why such a warning is being
thrown? Any suggestions/comments/ideas/queries to run - much
appreciated.
Puzzled,
Al.The whole size of the rows exceeds 8060 bytes, thats the most possible
bytes SQl Server can handle per row, so this is just a warning (not an
error), that it might could be if you exceed the magic border, data
will be truncated.
If you are aware of that and you=B4ll be happy with it or you have
another way to handle this, this is fine, but you should keep that in
mind. For the best you should redesign your table by putting some
values in another table or thinking of changing the actual types of the
columns, if that is possible.
HTH, Jens Suessmeyer.|||This means that the sum of all you columns can in theory be 15,420
bytes
If someone inserts data and it exceeds 8060 bytes, then the statement
will fail
look at all the field sizes in this table and make sure they don't
exceed 8060 bytes
http://sqlservercode.blogspot.com/|||> This is weird. I create a new column programatically using the "ALTER
> TABLE" command (you know the one) inside SQL Query Analyzer. The
> column is indeed created but the following warning is thrown:
> WARNING: The table 'OrderRecords' has been created but its maximum row
> size (15,420) exceeds the maximum number of bytes per row (8060).
> INSERT or UPDATE of a row in this table will fail if the resulting row
> length exceeds 8060 bytes
It is a WARNING about the maximum possible rowsize based on the columns
defined for the table. Just guessing, but it is likely that you have a
couple (or a bunch) of large varchar columns in the table that could, if
completely filled with data, exceed the maximum possible rowsize supported
by sql server.|||Thanks everyone - that's fine. I can live with that. Thanks for all
your feedback.
Al.
The happy one.

Monday, March 26, 2012

Please help - unusual warning when creating a column

Hi everyone,
This is weird. I create a new column programatically using the "ALTER
TABLE" command (you know the one) inside SQL Query Analyzer. The
column is indeed created but the following warning is thrown:
WARNING: The table 'OrderRecords' has been created but its maximum row
size (15,420) exceeds the maximum number of bytes per row (8060).
INSERT or UPDATE of a row in this table will fail if the resulting row
length exceeds 8060 bytes
I then checked a likely column. I ran a wee query to find the maximum
row and it returned a row of maximum length of 2,647 characters.
Now I'm totally confused. Does anyone know why such a warning is being
thrown? Any suggestions/comments/ideas/queries to run - much
appreciated.
Puzzled,
Al.The whole size of the rows exceeds 8060 bytes, thats the most possible
bytes SQl Server can handle per row, so this is just a warning (not an
error), that it might could be if you exceed the magic border, data
will be truncated.
If you are aware of that and you=B4ll be happy with it or you have
another way to handle this, this is fine, but you should keep that in
mind. For the best you should redesign your table by putting some
values in another table or thinking of changing the actual types of the
columns, if that is possible.
HTH, Jens Suessmeyer.|||This means that the sum of all you columns can in theory be 15,420
bytes
If someone inserts data and it exceeds 8060 bytes, then the statement
will fail
look at all the field sizes in this table and make sure they don't
exceed 8060 bytes
http://sqlservercode.blogspot.com/|||> This is weird. I create a new column programatically using the "ALTER
> TABLE" command (you know the one) inside SQL Query Analyzer. The
> column is indeed created but the following warning is thrown:
> WARNING: The table 'OrderRecords' has been created but its maximum row
> size (15,420) exceeds the maximum number of bytes per row (8060).
> INSERT or UPDATE of a row in this table will fail if the resulting row
> length exceeds 8060 bytes
It is a WARNING about the maximum possible rowsize based on the columns
defined for the table. Just guessing, but it is likely that you have a
couple (or a bunch) of large varchar columns in the table that could, if
completely filled with data, exceed the maximum possible rowsize supported
by sql server.|||Thanks everyone - that's fine. I can live with that. Thanks for all
your feedback.
Al.
The happy one.

Wednesday, March 21, 2012

playing audio file inside the database!!

whats the preferred data type for audio file? and where does the sql server stores it?

Take a look at Using Large-Value Data Types topic in Books Online. You are probably looking for varbinary(max) to store the [audio file] data. The data istelf is stored in the user database.

Also look at TEXTIMAGE_ON option of CREATE TABLE. With it you can specify a particular filegroup where that data is stored.

HTH,
Boris.

playing audio file inside the database!!

whats the preferred data type for audio file? and where does the sql server stores it?

Take a look at Using Large-Value Data Types topic in Books Online. You are probably looking for varbinary(max) to store the [audio file] data. The data istelf is stored in the user database.

Also look at TEXTIMAGE_ON option of CREATE TABLE. With it you can specify a particular filegroup where that data is stored.

HTH,
Boris.

playing around views

hi
I just want to be sure there is no way to do it inside the DB:
I have a view which return 1000 numbers and amounts like this:
Number Amount
000 234
001 3456
... ...
999 464
I have only two very long columns. is it possible to re-arrange this into a
view to get something like this:
number amount number amount number amount
000 345 001 9861 002 865
003 4564 004 45 005 9865
thks.On Tue, 25 Jan 2005 09:05:03 -0800, Kenny M. wrote:

>I have a view which return 1000 numbers and amounts like this:
>Number Amount
>000 234
>001 3456
>... ...
>999 464
>I have only two very long columns. is it possible to re-arrange this into
a
>view to get something like this:
>number amount number amount number amount
> 000 345 001 9861 002 865
> 003 4564 004 45 005 9865
Hi Kenny,
This is a presentation task, typically done at the client. However, if you
really want to burden the server with it, try:
SELECT a.number, a.amount, b.number, b.amount, c.number, c.amount
FROM MyTable AS a
LEFT OUTER JOIN MyTable AS b
ON b.Number = a.Number + 1
LEFT OUTER JOIN MyTable AS c
ON c.Number = a.Number + 1
WHERE a.Number % 3 = 0
ORDER BY a.Number
(untested)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Why to stress your server trying to do this?. Use your client app / reportin
g
tool or programming language.
use northwind
go
select
identity(int, 0, 1) as number,
0 as amount
into
t
from
sysobjects as a cross join sysobjects as b
delete t where number > 999
update t set amount = power(2, number % 8)
select
*
from
(
select
number, amount
from
t
where
number % 3 = 0
) as a
left join
(
select
number, amount
from
t
where
number % 3 = 1
) as b
on a.number = b.number - 1
left join
(
select
number, amount
from
t
where
number % 3 = 2
) as c
on b.number = c.number - 1
drop table t
go
AMB
"Kenny M." wrote:

> hi
> I just want to be sure there is no way to do it inside the DB:
> I have a view which return 1000 numbers and amounts like this:
> Number Amount
> 000 234
> 001 3456
> ... ...
> 999 464
> I have only two very long columns. is it possible to re-arrange this into
a
> view to get something like this:
> number amount number amount number amount
> 000 345 001 9861 002 865
> 003 4564 004 45 005 9865
> thks.
>
>