Showing posts with label exist. Show all posts
Showing posts with label exist. Show all posts

Wednesday, March 7, 2012

call order

If a VIEW and a STORED PROCEDURE exist and have the same identical name -
is there a particular call sequence that SQL SERVER uses -
in other words if the particular name is called up in code - does SQL pull
the view first or the SP first.Not possible. Try below:
USE tempdb
GO
CREATE PROC xyz AS SELECT 1 AS s
GO
CREATE VIEW xyz AS SELECT 1 AS s
Object names need to be unique. And even if SQL Server would allow it, there
would not be any
ambiguity. You don't use a stored procedure and a view in the same way.
You execute a stored procedure. You don't execute a view.
You select data from a view. You don't select data from a stored procedure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"jduran" <jduran@.discussions.microsoft.com> wrote in message
news:A0D23A66-F34E-4177-9C79-54D92ABB216B@.microsoft.com...
> If a VIEW and a STORED PROCEDURE exist and have the same identical name -
> is there a particular call sequence that SQL SERVER uses -
> in other words if the particular name is called up in code - does SQL pul
l
> the view first or the SP first.|||Hi
This should not occur as the names must be unique
CREATE PROCEDURE MyProc
AS
SELECT * FROM SYSOBJECTS
CREATE VIEW MyProc AS SELECT * FROM SYSOBJECTS
Server: Msg 2714, Level 16, State 5, Procedure MyProc, Line 1
There is already an object named 'MyProc' in the database.
Using a strict naming convention policy to distinguish objects is also a
good idea.
John
"jduran" wrote:

> If a VIEW and a STORED PROCEDURE exist and have the same identical name -
> is there a particular call sequence that SQL SERVER uses -
> in other words if the particular name is called up in code - does SQL pul
l
> the view first or the SP first.|||You can not create two objects with the same name. Even if you could, you ca
n
not select from an sp or execute a view.
Example:
use northwind
go
create procedure proc1
as
return 0
go
-- this will give an error
create view proc1
as
select * from orders
go
drop procedure proc1
go
AMB
"jduran" wrote:

> If a VIEW and a STORED PROCEDURE exist and have the same identical name -
> is there a particular call sequence that SQL SERVER uses -
> in other words if the particular name is called up in code - does SQL pul
l
> the view first or the SP first.

Friday, February 24, 2012

Calculations for number of DB's on a SQL Server 2000 server

Is there a Microsoft recommendation for how many databases that can exist on
a SQL Server 2000 (std ed) server (Windows 2000 4 CPU, 4GB RAM)? What form
ulas/calculations can be made to determine the capacity (# of db's w/o affec
ting performance/resources)
for a given server?It's not so much the number of databases that matter as much as their usage.
We have a 2 CPU box with 2 Gb of RAM that has 107 databases on it and works
great. We also have a 4CPU box with 8Gb of RAM with 67 databases on it that
works fine. We then have a 4CPU cluster with 4 Gb of RAM that has only 3
databases, the application runs fine but our database box is about maxed
out.
Basically other than disk space, a database won't consume SQL Server
resources unless it's actually used. So apart from the fixed limitation of
32,767 databases per instance there is no concern about the number of
databases. It's all about their utilization.
"LAM" <anonymous@.discussions.microsoft.com> wrote in message
news:2F6DFF19-F6B1-446A-85FA-0BDA53230CF1@.microsoft.com...
> Is there a Microsoft recommendation for how many databases that can exist
on a SQL Server 2000 (std ed) server (Windows 2000 4 CPU, 4GB RAM)? What
formulas/calculations can be made to determine the capacity (# of db's w/o
affecting performance/resources) for a given server?

Calculations for number of DB's on a SQL Server 2000 server

Is there a Microsoft recommendation for how many databases that can exist on a SQL Server 2000 (std ed) server (Windows 2000 4 CPU, 4GB RAM)? What formulas/calculations can be made to determine the capacity (# of db's w/o affecting performance/resources) for a given server?It's not so much the number of databases that matter as much as their usage.
We have a 2 CPU box with 2 Gb of RAM that has 107 databases on it and works
great. We also have a 4CPU box with 8Gb of RAM with 67 databases on it that
works fine. We then have a 4CPU cluster with 4 Gb of RAM that has only 3
databases, the application runs fine but our database box is about maxed
out.
Basically other than disk space, a database won't consume SQL Server
resources unless it's actually used. So apart from the fixed limitation of
32,767 databases per instance there is no concern about the number of
databases. It's all about their utilization.
"LAM" <anonymous@.discussions.microsoft.com> wrote in message
news:2F6DFF19-F6B1-446A-85FA-0BDA53230CF1@.microsoft.com...
> Is there a Microsoft recommendation for how many databases that can exist
on a SQL Server 2000 (std ed) server (Windows 2000 4 CPU, 4GB RAM)? What
formulas/calculations can be made to determine the capacity (# of db's w/o
affecting performance/resources) for a given server?

Calculations for number of DB's on a SQL Server 2000 server

Is there a Microsoft recommendation for how many databases that can exist on a SQL Server 2000 (std ed) server (Windows 2000 4 CPU, 4GB RAM)? What formulas/calculations can be made to determine the capacity (# of db's w/o affecting performance/resources)
for a given server?
It's not so much the number of databases that matter as much as their usage.
We have a 2 CPU box with 2 Gb of RAM that has 107 databases on it and works
great. We also have a 4CPU box with 8Gb of RAM with 67 databases on it that
works fine. We then have a 4CPU cluster with 4 Gb of RAM that has only 3
databases, the application runs fine but our database box is about maxed
out.
Basically other than disk space, a database won't consume SQL Server
resources unless it's actually used. So apart from the fixed limitation of
32,767 databases per instance there is no concern about the number of
databases. It's all about their utilization.
"LAM" <anonymous@.discussions.microsoft.com> wrote in message
news:2F6DFF19-F6B1-446A-85FA-0BDA53230CF1@.microsoft.com...
> Is there a Microsoft recommendation for how many databases that can exist
on a SQL Server 2000 (std ed) server (Windows 2000 4 CPU, 4GB RAM)? What
formulas/calculations can be made to determine the capacity (# of db's w/o
affecting performance/resources) for a given server?