Monday, March 12, 2012
How to switch identity within stored procedure
These users will not know who has created the view.
To make this possible I am trying to write a procedure which will switch
identity of user to dbo and then create a view and again restore original
identity. I have not found anything which will switch identity, what can be
used to do this part?
If this is not possible then how else this can be achievedhave a look at setuser
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Shilpa" <Shilpa@.discussions.microsoft.com> wrote in message
news:1AA35FFE-3C0C-40B6-8852-FCFDB4B1DB4F@.microsoft.com...
>I want dynamically created views by one user get viewed by other users.
> These users will not know who has created the view.
> To make this possible I am trying to write a procedure which will switch
> identity of user to dbo and then create a view and again restore original
> identity. I have not found anything which will switch identity, what can
> be
> used to do this part?
> If this is not possible then how else this can be achieved|||If the user is in the db_owner role, he could create some views with the dbo
schema and others with his own schema.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
How to switch identity within stored procedure
These users will not know who has created the view.
To make this possible I am trying to write a procedure which will switch
identity of user to dbo and then create a view and again restore original
identity. I have not found anything which will switch identity, what can be
used to do this part?
If this is not possible then how else this can be achievedhave a look at setuser
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Shilpa" <Shilpa@.discussions.microsoft.com> wrote in message
news:1AA35FFE-3C0C-40B6-8852-FCFDB4B1DB4F@.microsoft.com...
>I want dynamically created views by one user get viewed by other users.
> These users will not know who has created the view.
> To make this possible I am trying to write a procedure which will switch
> identity of user to dbo and then create a view and again restore original
> identity. I have not found anything which will switch identity, what can
> be
> used to do this part?
> If this is not possible then how else this can be achieved|||If the user is in the db_owner role, he could create some views with the dbo
schema and others with his own schema.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
How to switch identity using stored procedure
These users will not know who has created the view.
To make this possible I am trying to write a procedure which will switch
identity of user to dbo and then create a view and again restore original
identity. I have not found anything which will switch identity, what can be
used to do this part?
If this is not possible then how else this can be achievedHi,
Take a look into system procedure sp_changeobjectowner. This procedure will
help you to change the object owners.
Thanks
Hari
SQL Server MVP
"Shilpa" <Shilpa@.discussions.microsoft.com> wrote in message
news:F42A25B8-74B6-4192-BCEA-47EA588C90FE@.microsoft.com...
>I want dynamically created views by one user get viewed by other users.
> These users will not know who has created the view.
> To make this possible I am trying to write a procedure which will switch
> identity of user to dbo and then create a view and again restore original
> identity. I have not found anything which will switch identity, what can
> be
> used to do this part?
> If this is not possible then how else this can be achieved|||If you add the developers to the db_ddladmin database role, they can give
the procedure ownership to the 'dbo' schema when they create it.
A good practice is to use "CREATE PROCEDURE dbo.MyProcedure".
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Shilpa" <Shilpa@.discussions.microsoft.com> wrote in message
news:F42A25B8-74B6-4192-BCEA-47EA588C90FE@.microsoft.com...
>I want dynamically created views by one user get viewed by other users.
> These users will not know who has created the view.
> To make this possible I am trying to write a procedure which will switch
> identity of user to dbo and then create a view and again restore original
> identity. I have not found anything which will switch identity, what can
> be
> used to do this part?
> If this is not possible then how else this can be achieved
Friday, February 24, 2012
how to store an "" value in my database instead of null
I have a problem I 'get stuck on it. i hope someone can help me.
I have a SQLServer table with an ID-field with a primary key and identity on it, and a couple of other fields with defaultvalue "" and NOT nullable
When i like to update an record in an formview of ASP 2.0 and fill in all fields everything is updated and everything goes fine
but
when I leave one field blank then I get the message 'can not enter null value in column X'
even when I place in the Updateparameter in my code
<asp:Parameter Name="Name" DefaultValue="" /> ASP tries to update an Null value
when i place an space as default value like
<asp:Parameter Name="Name" DefaultValue=" " />
everything goes fine exept there is an space in my database.
How can I update my record, and leave some textboxes emtpy AND where my fields are NOT nullable
I'm getting desparate of this.
make my fields nullable is not an option because this is a 'customerswish'
Please help
There is another property of the parameter, something like nullempty, or emptynull, nullifyemtpy. Because all form variables are encoded as strings, you can't really represent the null value, and in most cases where you are doing form entry from the web, leaving a field blank should enter a null value (As if the value is unknown/unspecified), so the default for this property of the parameter is ON.|||Thanks a lot, that's the one.
Shame on me, why haven't I see this setting.
is this new in 2005 (I've previously working with Beta 2) and this occur in my 2005 projects
Thanks