Showing posts with label creating. Show all posts
Showing posts with label creating. 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.

Please Help

Hi,
I am creating a site on ASP and SQL, which would essentially be hosted in a
third party server like Interland or Net4India. It is dynamic in nature,
i.e. has its own database. But I have got a module in where I would need to
connect to an remote SQL server, which is located somewhere else. I know the
IP address. I would need to copy a table from that sql server to my server,
and synchronize it regularly, just in case something is updated.
Now my problem is,
(1) How do I connect to that remote sql server using ASP.
(2) Please suggest what method should i adopt to copy and synchronize the
data between the two servers.
Thank you very much,
Regards,
Bhaskardeep
Hi,
It seems you need to connect to a remote database over Internet, Am I
correct?
1. Assuming your SQL Server has a valid Internet address and sits outside
the firewall (very risky), this is easy. Just specify the server name and
address using Client Network Utility.
Server Alias: Server1
Address: 192.x.x.x or DNS
Port 1433
Note: This is using TCP/IP . I recommend looking into something like NAT for
more security.
Code will be some thing like;
Dim RMConn as ADODB.Connection
Private Sub Class_Initialize()
Set RMConn = New ADODB.Connection
With RMConn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=User;Data
Source=xxx.xxx.xxx.xxx;Initial Catalog=Database"
.Open
End With
End Sub
Have a look into the below site to setup the connection string;
http://www.connectionstrings.com/
2. Please suggest what method should i adopt to copy and synchronize the
data between the two servers
Method:1
Refer sp_addlinkedserver, sp_addlinkedserverlogin system procdures in
books online to syncronize the data.
Method:2
Incase if you need to populate 1 or 2 tables then preferably go for
1. Truncate the data
2. BCP OUT data from Remote server and BCP IN to Local server.
Thanks
Hari
MCDBA
"Bhaskardeep Khaund" <bhaskar_999@.hotmail.com> wrote in message
news:#jtMYuzHEHA.3356@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I am creating a site on ASP and SQL, which would essentially be hosted in
a
> third party server like Interland or Net4India. It is dynamic in nature,
> i.e. has its own database. But I have got a module in where I would need
to
> connect to an remote SQL server, which is located somewhere else. I know
the
> IP address. I would need to copy a table from that sql server to my
server,
> and synchronize it regularly, just in case something is updated.
> Now my problem is,
> (1) How do I connect to that remote sql server using ASP.
> (2) Please suggest what method should i adopt to copy and synchronize the
> data between the two servers.
> Thank you very much,
> Regards,
> Bhaskardeep
>

Please Help

I am creating a query and am getting:
"Data Type Mismatch in criteria expression" error messages!!

It's driving me crazy. It only happens when I enter certain codes. For example, if I enter "2AP" the query works. If i enter "2AK", I receive the error!

Here is the SQL although I used Design View in Access to create the query:

SELECT TradeHist.[Portfolio Code], Sum([Trade Shares]*[Trade FX Rate]*[Order Decision Price]) AS MV, Sum([Trade Shares]*[Trade FX Rate]*[Order Decision Price]*[OrderHor])/[MV] AS OHMV, Sum(IIf([OrderHor]>=0.5,1,0)*[Trade Shares]*[Trade FX Rate]*[Order Decision Price])/[MV] AS PercOverFifty
FROM OrderHorizonQuery INNER JOIN TradeHist ON OrderHorizonQuery.[Order ID Master] = TradeHist.[Order ID Master]
GROUP BY TradeHist.[Portfolio Code]
HAVING (((TradeHist.[Portfolio Code])="2AK" Or (TradeHist.[Portfolio Code])="42O" Or (TradeHist.[Portfolio Code])="4UZ"));

Any help would be appreciated!put your conditions into the WHERE clause
select TradeHist.[Portfolio Code]
, Sum([Trade Shares]*[Trade FX Rate]*[Order Decision Price]) AS MV
, Sum([Trade Shares]*[Trade FX Rate]*[Order Decision Price]*[OrderHor])/[MV] AS OHMV
, Sum(IIf([OrderHor]>=0.5 ,1 ,0)*[Trade Shares]*[Trade FX Rate]*[Order Decision Price])/[MV] AS PercOverFifty
from OrderHorizonQuery
inner
join TradeHist
on OrderHorizonQuery.[Order ID Master]
= TradeHist.[Order ID Master]
where TradeHist.[Portfolio Code] in ('2AK','42O','4UZ')
group
by TradeHist.[Portfolio Code]|||Thanks for the effort but It is still yeilding the same error. any other ideas?|||double-check the datatypes of all columns involved|||How will I identify mistakes after looking at the data types of each column involved in the query? Thanks again for your continued support!

:confused:|||(((TradeHist.[Portfolio Code]='2AK') Or (TradeHist.[Portfolio Code]='42O') Or (TradeHist.[Portfolio Code])='4UZ'));

Try this|||How will I identify mistakes after looking at the data types of each column involved in the query? Thanks again for your continued support!

:confused:Based on your posted code, [OrderHor] should be a numeric type, and [Portfolio Code] should be a text type. I'd guess that one of them is of the wrong type.

-PatP|||Thanks all. Ill be at work in a bit. Ill let you know what I find!!!|||It worked!! Thanks|||mind telling us what worked? ;)|||yeah, I'm curious too. I can't seem to engage omniscient mode at the moment, so I'd like a wee bit more feedback.

-PatP|||heh

i always say something like "my crystal ball runs on Windows ME and is down at the moment"

Friday, March 23, 2012

Please Help

Hi,
I am creating a site on ASP and SQL, which would essentially be hosted in a
third party server like Interland or Net4India. It is dynamic in nature,
i.e. has its own database. But I have got a module in where I would need to
connect to an remote SQL server, which is located somewhere else. I know the
IP address. I would need to copy a table from that sql server to my server,
and synchronize it regularly, just in case something is updated.
Now my problem is,
(1) How do I connect to that remote sql server using ASP.
(2) Please suggest what method should i adopt to copy and synchronize the
data between the two servers.
Thank you very much,
Regards,
BhaskardeepHi,
It seems you need to connect to a remote database over Internet, Am I
correct?
1. Assuming your SQL Server has a valid Internet address and sits outside
the firewall (very risky), this is easy. Just specify the server name and
address using Client Network Utility.
Server Alias: Server1
Address: 192.x.x.x or DNS
Port 1433
Note: This is using TCP/IP . I recommend looking into something like NAT for
more security.
Code will be some thing like;
Dim RMConn as ADODB.Connection
Private Sub Class_Initialize()
Set RMConn = New ADODB.Connection
With RMConn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=User;Data
Source=xxx.xxx.xxx.xxx;Initial Catalog=Database"
.Open
End With
End Sub
Have a look into the below site to setup the connection string;
http://www.connectionstrings.com/
2. Please suggest what method should i adopt to copy and synchronize the
data between the two servers
Method:1
Refer sp_addlinkedserver, sp_addlinkedserverlogin system procdures in
books online to syncronize the data.
Method:2
Incase if you need to populate 1 or 2 tables then preferably go for
1. Truncate the data
2. BCP OUT data from Remote server and BCP IN to Local server.
Thanks
Hari
MCDBA
"Bhaskardeep Khaund" <bhaskar_999@.hotmail.com> wrote in message
news:#jtMYuzHEHA.3356@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I am creating a site on ASP and SQL, which would essentially be hosted in
a
> third party server like Interland or Net4India. It is dynamic in nature,
> i.e. has its own database. But I have got a module in where I would need
to
> connect to an remote SQL server, which is located somewhere else. I know
the
> IP address. I would need to copy a table from that sql server to my
server,
> and synchronize it regularly, just in case something is updated.
> Now my problem is,
> (1) How do I connect to that remote sql server using ASP.
> (2) Please suggest what method should i adopt to copy and synchronize the
> data between the two servers.
> Thank you very much,
> Regards,
> Bhaskardeep
>sql

Please Help

Hi,
I am creating a site on ASP and SQL, which would essentially be hosted in a
third party server like Interland or Net4India. It is dynamic in nature,
i.e. has its own database. But I have got a module in where I would need to
connect to an remote SQL server, which is located somewhere else. I know the
IP address. I would need to copy a table from that sql server to my server,
and synchronize it regularly, just in case something is updated.
Now my problem is,
(1) How do I connect to that remote sql server using ASP.
(2) Please suggest what method should i adopt to copy and synchronize the
data between the two servers.
Thank you very much,
Regards,
BhaskardeepHi,
It seems you need to connect to a remote database over Internet, Am I
correct?
1. Assuming your SQL Server has a valid Internet address and sits outside
the firewall (very risky), this is easy. Just specify the server name and
address using Client Network Utility.
Server Alias: Server1
Address: 192.x.x.x or DNS
Port 1433
Note: This is using TCP/IP . I recommend looking into something like NAT for
more security.
Code will be some thing like;
Dim RMConn as ADODB.Connection
Private Sub Class_Initialize()
Set RMConn = New ADODB.Connection
With RMConn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=User;Data
Source=xxx.xxx.xxx.xxx;Initial Catalog=Database"
.Open
End With
End Sub
Have a look into the below site to setup the connection string;
http://www.connectionstrings.com/
2. Please suggest what method should i adopt to copy and synchronize the
data between the two servers
Method:1
Refer sp_addlinkedserver, sp_addlinkedserverlogin system procdures in
books online to syncronize the data.
Method:2
Incase if you need to populate 1 or 2 tables then preferably go for
1. Truncate the data
2. BCP OUT data from Remote server and BCP IN to Local server.
Thanks
Hari
MCDBA
"Bhaskardeep Khaund" <bhaskar_999@.hotmail.com> wrote in message
news:#jtMYuzHEHA.3356@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I am creating a site on ASP and SQL, which would essentially be hosted in
a
> third party server like Interland or Net4India. It is dynamic in nature,
> i.e. has its own database. But I have got a module in where I would need
to
> connect to an remote SQL server, which is located somewhere else. I know
the
> IP address. I would need to copy a table from that sql server to my
server,
> and synchronize it regularly, just in case something is updated.
> Now my problem is,
> (1) How do I connect to that remote sql server using ASP.
> (2) Please suggest what method should i adopt to copy and synchronize the
> data between the two servers.
> Thank you very much,
> Regards,
> Bhaskardeep
>

Please explain this.., why is PasswordRecovery creating another sqlservr process....

Why is the PasswordRecovery control creating another sqlservr process after I successfully enter the user name, and for a reason I have not found yet it keeps the database in a read only modem then when I answer my security question correctly it gives me the error:

Failed to update database "C:\INETPUB\WWWROOT\VER1.0.0.1\APP_DATA\ASPNETDB.MDF" because the database is read-only.

I read other post regarding the read only message and I don't if there doing the same thing, but why does this happen and what is the solution to this other not using the control?

cancel that!... found solution from another post...

Monday, March 12, 2012

Place count in variable

Would like to know if this is even possible to do - using SQL Server 2000.
I am creating a procedure that truncates a table then inserts one row of dat
a.
In the third field I need to insert the count of another table.
I thought that this would work:
@.DetCount int = SELECT Count(*) FROM TableName
My question is can I assign a count(*) to a variable in a stored procedure?
I would then use the variable in the values clause of the insert statment.Hi Robert,
Yes - you can do that. You just need to wrap your Select Statement in
brackets.
e.g
Declare @.Count Int
Set @.Count = (Select count(*) From TableA)
Insert Into TableB (Col1)
Values (@.Count)
Select * From TableB
HTH
Barry|||Works perfect! Thanks a million.
"Barry" wrote:

> Hi Robert,
> Yes - you can do that. You just need to wrap your Select Statement in
> brackets.
> e.g
> Declare @.Count Int
> Set @.Count = (Select count(*) From TableA)
> Insert Into TableB (Col1)
> Values (@.Count)
>
> Select * From TableB
>
> HTH
> Barry
>|||The other option is to use the SELECT statement to assign values to a
variable:
SELECT @.Count = COUNT(*) FROM TableA
This is useful when setting the values of multiple variables at once,
e.g.:
SELECT @.Count = COUNT(*),
@.Avg = AVG(someColumn)
FROM TableA
HTH,
Stu

Friday, March 9, 2012

PL/sql

I have problem in creating index on particular column with pL/SQL procedure . I dont know what command to and how to use?
how to run that PL/sql procedure. And howto check that wether index is created or not?
Please guide meHere's the example:

/* create a procedure */
CREATE OR REPLACE PROCEDURE brisime
AS
ci VARCHAR2 (255);
BEGIN
ci := 'create index i1 on tob_pool_ocit (pool_id, omm_id)';

EXECUTE IMMEDIATE ci;
END;

/* execute the procedure */
BEGIN
brisime ();
END;

/* checking whether it is created */
SELECT *
FROM user_indexes
WHERE index_name = 'I1';