Showing posts with label statement. Show all posts
Showing posts with label statement. Show all posts

Sunday, March 25, 2012

Database size on IIS 5

Good Morning,
I have a web service developed using vb.net. The web
service returns xml from selected data (SQL SELECT
statement using XML AUTO) from SQL Server. The web service
runs properly on smaller databases on both IIS 5 (Windows
2000 Server) and IIS 6 (Windows 2003 Server), but returns
an error when run against larger databases on IIS 5. The
error has been 'out System.OutOfMemoryException'.
I am trying to figure out the difference between IIS 5 and
IIS 6 which is causing this, and a solution.I guess the database is too big for IIS5, so it can not run.
After all, when IIS5 design, no one can image a big database like we use
today.
I think If I am you, I will catch this exception and give the customer some
information to update the IIS.
Last: This is a problem of IIS, you may ask there:)

Thursday, March 22, 2012

Database size

Hi!
Is it possible to ask a database (using a SQL statement) how big it is?
Regards
/AndersHi
Yes, It is
sp_helpdb 'databasename'
"Anders Wåhlin" <anders.wahlin@.erv.ericsson.se> wrote in message
news:bnoeat$k7k$1@.newstree.wise.edt.ericsson.se...
> Hi!
> Is it possible to ask a database (using a SQL statement) how big it is?
> Regards
> /Anders
>|||sp_spaceused will display size of current database,
optionally you can also pass an argument to this procedure
<tablename> to know size of a particular table.
>--Original Message--
>Hi!
>Is it possible to ask a database (using a SQL statement)
how big it is?
>Regards
>/Anders
>
>.
>

Monday, March 19, 2012

Database Schemas and "This statement has attempted to access data whose access is restricte

Hello.

In reference to my post yesterday which got removed when i edited this one: After trying a few things i realized that the reason i was getting the error "Invalid use of side-effecting or time-dependent operator in 'SET ON/OFF' within a function." was because a CLR function was executing a stored procedure, which for whatever reason i completely disregarded the fact that functions cannot call stored procedures. After removing that i am faced with the second issue of my assembly being restricted.
I now get the error "This statement has attempted to access data whose access is restricted by the assembly" I am not certain what is causing this, but i think it has something to do with the database security i am using. I created a schema whose owner is dbo. All my database objects are in this schema. The assembly's owner is also dbo. However accessing my database objects in my custom schema will give me the error talking about access restricted by the assembly. Does anyone have any idea why my assembly cannot access data that is owned by the assembly's owner?

Thanks!It looks like you are missing either
DataAccess=DataAccessKind.Read
or SystemDataAccess=SystemDataAccessKind.Read
in your SQLFunction attribute.

Could you please provide your code.

Thanks,
-Vineet.
|||

I am including the attribute but stll get the error, plus did try the SystemDataAccess attribute. This is the code:

[SqlFunction(DataAccess = DataAccessKind.Read)]

public static SqlString GetDisplayName(SqlGuid id)

{

if (id.IsNull) return SqlString.Null;

string itemTypeFullName = String.Empty;

using (SqlConnection connection = new SqlConnection("context connection=true"))

{

string sql = @."SELECT [itemtype-full-name] FROM [ItemType] WHERE [id] = '"+id.ToString()+"'";

using (SqlCommand command = new SqlCommand(sql, connection))

{

try

{

connection.Open();

itemTypeFullName = (string)command.ExecuteScalar();

|||I got the same error "This statement has attempted to access data whose access is restricted by the assembly".

I specified DataAccessKind.Read and SystemDataAccessKind.Read and that helped

[Microsoft.SqlServer.Server.SqlFunction(DataAccess=DataAccessKind.Read, SystemDataAccess=SystemDataAccessKind.Read)]

Database Schemas and "This statement has attempted to access data whose access is restricte

Hello.

In reference to my post yesterday which got removed when i edited this one: After trying a few things i realized that the reason i was getting the error "Invalid use of side-effecting or time-dependent operator in 'SET ON/OFF' within a function." was because a CLR function was executing a stored procedure, which for whatever reason i completely disregarded the fact that functions cannot call stored procedures. After removing that i am faced with the second issue of my assembly being restricted.
I now get the error "This statement has attempted to access data whose access is restricted by the assembly" I am not certain what is causing this, but i think it has something to do with the database security i am using. I created a schema whose owner is dbo. All my database objects are in this schema. The assembly's owner is also dbo. However accessing my database objects in my custom schema will give me the error talking about access restricted by the assembly. Does anyone have any idea why my assembly cannot access data that is owned by the assembly's owner?

Thanks!It looks like you are missing either
DataAccess=DataAccessKind.Read
or SystemDataAccess=SystemDataAccessKind.Read
in your SQLFunction attribute.

Could you please provide your code.

Thanks,
-Vineet.
|||

I am including the attribute but stll get the error, plus did try the SystemDataAccess attribute. This is the code:

[SqlFunction(DataAccess = DataAccessKind.Read)]

public static SqlString GetDisplayName(SqlGuid id)

{

if (id.IsNull) return SqlString.Null;

string itemTypeFullName = String.Empty;

using (SqlConnection connection = new SqlConnection("context connection=true"))

{

string sql = @."SELECT [itemtype-full-name] FROM [ItemType] WHERE [id] = '"+id.ToString()+"'";

using (SqlCommand command = new SqlCommand(sql, connection))

{

try

{

connection.Open();

itemTypeFullName = (string)command.ExecuteScalar();

|||I got the same error "This statement has attempted to access data whose access is restricted by the assembly".

I specified DataAccessKind.Read and SystemDataAccessKind.Read and that helped

[Microsoft.SqlServer.Server.SqlFunction(DataAccess=DataAccessKind.Read, SystemDataAccess=SystemDataAccessKind.Read)]

Database Schemas and "This statement has attempted to access data whose access is restr

Hello.

In reference to my post yesterday which got removed when i edited this one: After trying a few things i realized that the reason i was getting the error "Invalid use of side-effecting or time-dependent operator in 'SET ON/OFF' within a function." was because a CLR function was executing a stored procedure, which for whatever reason i completely disregarded the fact that functions cannot call stored procedures. After removing that i am faced with the second issue of my assembly being restricted.
I now get the error "This statement has attempted to access data whose access is restricted by the assembly" I am not certain what is causing this, but i think it has something to do with the database security i am using. I created a schema whose owner is dbo. All my database objects are in this schema. The assembly's owner is also dbo. However accessing my database objects in my custom schema will give me the error talking about access restricted by the assembly. Does anyone have any idea why my assembly cannot access data that is owned by the assembly's owner?

Thanks!It looks like you are missing either
DataAccess=DataAccessKind.Read
or SystemDataAccess=SystemDataAccessKind.Read
in your SQLFunction attribute.

Could you please provide your code.

Thanks,
-Vineet.
|||

I am including the attribute but stll get the error, plus did try the SystemDataAccess attribute. This is the code:

[SqlFunction(DataAccess = DataAccessKind.Read)]

public static SqlString GetDisplayName(SqlGuid id)

{

if (id.IsNull) return SqlString.Null;

string itemTypeFullName = String.Empty;

using (SqlConnection connection = new SqlConnection("context connection=true"))

{

string sql = @."SELECT [itemtype-full-name] FROM [ItemType] WHERE [id] = '"+id.ToString()+"'";

using (SqlCommand command = new SqlCommand(sql, connection))

{

try

{

connection.Open();

itemTypeFullName = (string)command.ExecuteScalar();

|||I got the same error "This statement has attempted to access data whose access is restricted by the assembly".

I specified DataAccessKind.Read and SystemDataAccessKind.Read and that helped

[Microsoft.SqlServer.Server.SqlFunction(DataAccess=DataAccessKind.Read, SystemDataAccess=SystemDataAccessKind.Read)]

Tuesday, February 14, 2012

Database Options

What is the real difference between setting the database
options using A SET statement which applies to the current
connection only or specifying the setting as a database-
level default with ALTER DATABASE?
When the option is set at the database level, that is the default setting
for all new connections.
The Set statement overrides the DB setting however...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?
|||Well, one change is temporary for the current session, the other change is
permanent?
http://www.aspfaq.com/
(Reverse address to reply.)
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?

Database Options

What is the real difference between setting the database
options using A SET statement which applies to the current
connection only or specifying the setting as a database-
level default with ALTER DATABASE?When the option is set at the database level, that is the default setting
for all new connections.
The Set statement overrides the DB setting however...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx
.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?|||Well, one change is temporary for the current session, the other change is
permanent?
http://www.aspfaq.com/
(Reverse address to reply.)
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx
.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?

Database Options

What is the real difference between setting the database
options using A SET statement which applies to the current
connection only or specifying the setting as a database-
level default with ALTER DATABASE?When the option is set at the database level, that is the default setting
for all new connections.
The Set statement overrides the DB setting however...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?|||Well, one change is temporary for the current session, the other change is
permanent?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?