can i create a non-updatable view?
i cannot use user level restrictions.Check out the "CREATE VIEW" page in SQL Server 2000 Books Online, which
outlines some rules to make views updatable, and see if you can use one of
those rules to make your views non-updatable. For example, if the view
definition contains a derived column, that view cannot be updated. Here's a
quick example:
CREATE VIEW MyView AS SELECT Col1, Col2, 'X' AS NotUpdatable FROM MyTable
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
<mcourter@.mindspring.com> wrote in message
news:1122910718.612379.166500@.g44g2000cwa.googlegroups.com...
can i create a non-updatable view?
i cannot use user level restrictions.
Showing posts with label views. Show all posts
Showing posts with label views. Show all posts
Friday, March 23, 2012
Tuesday, March 20, 2012
Non-English Characters in Table/Stored Procedure Names
Could you tell me what are the limitations/concerns regarding Non-English characters being used for Table/Views/Stored Procedure Names?
I have been studying that very topic, my web site is built on 12 languages at present, and storing documents with UTF-8 encoding in SQL text fields works well. Its a bit tricky though with HTML tags embedded.|||See the topic below for more details:
http://msdn2.microsoft.com/en-us/library/ms175874(SQL.90).aspx
|||Thanks!Wednesday, March 7, 2012
NOLOCK on views
Hey guys,
I came across a SQL statement, thought up by a developer, in which two views were joined with the NOLOCK hint:
SELECT v1.xxx, v2.yyy
FROM dbo.vw_SomeView v1 WITH (NOLOCK)
INNER JOIN dbo.vw_SomeOtherView WITH (NOLOCK) ON v1.id = v2.id
The views are not created the NOLOCK hint. So my question is: has the NOLOCK hint any effect here?
I've looked in the BOL and searched on the net but can't find anything on this particular topic.
Lex
PS. Personally I don't like to use views in JOINs. I've seen too many cases in which tables are joined twice just because they are part of both views. Further more I don't like the "random" use of NOLOCK because most people don't seem to understand the implications of it. But this is besides the point of my question ;)Looks like it's time for a little hands on experiment. Take an update lock on one of the tables used in either of the views in one QA window, and try to run the sql in another.|||Looks like it's time for a little hands on experiment. Take an update lock on one of the tables used in either of the views in one QA window, and try to run the sql in another.
I use and recommend (NOLOCK) Optimizer hints on a regular basis. Just know that when a (NOLOCK) hint is used, it performs a "Dirty Read" against the data.
The primary benefit to a (NOLOCK) hint is to prevent the blocking of objects from occurring when users are selecting data. I would recommend using them if you have contention in your environment with users holding exclusive locks on tables.
Hope this helps!
I came across a SQL statement, thought up by a developer, in which two views were joined with the NOLOCK hint:
SELECT v1.xxx, v2.yyy
FROM dbo.vw_SomeView v1 WITH (NOLOCK)
INNER JOIN dbo.vw_SomeOtherView WITH (NOLOCK) ON v1.id = v2.id
The views are not created the NOLOCK hint. So my question is: has the NOLOCK hint any effect here?
I've looked in the BOL and searched on the net but can't find anything on this particular topic.
Lex
PS. Personally I don't like to use views in JOINs. I've seen too many cases in which tables are joined twice just because they are part of both views. Further more I don't like the "random" use of NOLOCK because most people don't seem to understand the implications of it. But this is besides the point of my question ;)Looks like it's time for a little hands on experiment. Take an update lock on one of the tables used in either of the views in one QA window, and try to run the sql in another.|||Looks like it's time for a little hands on experiment. Take an update lock on one of the tables used in either of the views in one QA window, and try to run the sql in another.
I use and recommend (NOLOCK) Optimizer hints on a regular basis. Just know that when a (NOLOCK) hint is used, it performs a "Dirty Read" against the data.
The primary benefit to a (NOLOCK) hint is to prevent the blocking of objects from occurring when users are selecting data. I would recommend using them if you have contention in your environment with users holding exclusive locks on tables.
Hope this helps!
NOLOCK hint on views?
Hi all
If i have a view:
CREATE VIEW vw_Users
AS
SELECT * FROM Users WITH(NOLOCK)
Is it suggested to use nolock in views?
And if i needed to use this view in stored procs is it then suggested to apply the nolock hint?
CREATE PROC [dbo] .[usp_GetCompanyUsers]
AS
SELECT * FROM Companies WITH(NOLOCK) JOIN
vw_Users WITH(NOLOCK) --<< --is this suggested?
If you using NOLOCK hint while creating view, you don't need to use the NOLOCK again when accessing the view. The locking is always done on the table and not on the view.
Saturday, February 25, 2012
No Views in SQL Web Data Administrator
Does anyone know how I can access Views in the SQL Web Data Administrator? All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.Hi,
I guess its by design.No UDF's too :-(
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Checkbox" <Checkbox@.discussions.microsoft.com> wrote in message
news:48BE1D32-E933-4807-B37B-38FD280017D3@.microsoft.com...
> Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
>
I guess its by design.No UDF's too :-(
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Checkbox" <Checkbox@.discussions.microsoft.com> wrote in message
news:48BE1D32-E933-4807-B37B-38FD280017D3@.microsoft.com...
> Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
>
No Views in SQL Web Data Administrator
Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.Hi,
I guess its by design.No UDF's too :-(
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Checkbox" <Checkbox@.discussions.microsoft.com> wrote in message
news:48BE1D32-E933-4807-B37B-38FD280017D3@.microsoft.com...
> Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
>
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.Hi,
I guess its by design.No UDF's too :-(
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Checkbox" <Checkbox@.discussions.microsoft.com> wrote in message
news:48BE1D32-E933-4807-B37B-38FD280017D3@.microsoft.com...
> Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
>
No Views in SQL Web Data Administrator
Does anyone know how I can access Views in the SQL Web Data Administrator? All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
Hi,
I guess its by design.No UDF's too :-(
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Checkbox" <Checkbox@.discussions.microsoft.com> wrote in message
news:48BE1D32-E933-4807-B37B-38FD280017D3@.microsoft.com...
> Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
>
Hi,
I guess its by design.No UDF's too :-(
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Checkbox" <Checkbox@.discussions.microsoft.com> wrote in message
news:48BE1D32-E933-4807-B37B-38FD280017D3@.microsoft.com...
> Does anyone know how I can access Views in the SQL Web Data Administrator?
All I can see is Tables, Stored Procedures, Query, Properties, Users, Roles.
>
Subscribe to:
Posts (Atom)