Showing posts with label adding. Show all posts
Showing posts with label adding. Show all posts

Friday, March 23, 2012

problem in adding user and permission

Hi all
I want to create a sp which will from
Master database add user and give permission to that user to any
specified database using t-sql code.
How can I do it?
Thanks
AmHi
sp_addrole and GRANT operate against the current DB, so you can not be in
master and perform those operations against a user DB.
Look at "permissions-SQL Server" in BOL.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"AM" <anonymous@.examnotes.net> wrote in message
news:e%23G6glwXFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi all
> I want to create a sp which will from
> Master database add user and give permission to that user to any
> specified database using t-sql code.
> How can I do it?
>
> --
> Thanks
> Am
>

problem in Adding NewItem(Database.mdf) in Asp.net project

Hi All,

I am new to Asp.net in my application i want to perform some operations with sql server 2005 database, but whenever i am inserting New Item Database.mdf in Myproject(Myproject -> Add NewItem -> Database.mdf ) its displaying the following warning

Failed to generate a user instance of Sql server due to failure in starting the process for the user instance. The connection will be closed

so that i am unable to insert Database.mdf in my project ..

Any help will be greatly appreciated

Thanks,

Vision.

basicl you need to remove "User instance=true " from your connection string .

also you may need to look at similar problem.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=293667&SiteID=1

|||

Solution: Modify the SQL Server (SQLExpress) service to use your local or system account and restart the service. SQLEXPRESS allows a User-Instance process that can connect to a physical MDF database file directly from the connection string. If the User Instance process does not have permissions, it will fail. You can also ATTACH the database file and use a normal connection string, e.g. server=(local);database=DatabaseName;uid=sa;pwd=yourpass

|||

Hi pbromberg,

Can you please suggest how to modify the Sql Server service to use system account. And also i don't want to connect to a physical MDF database file directly from the connection string.(just i want to add new item datasoure.mdf)

waiting for u r suggestion..

Thanks,

Vision.v1

Problem in Adding column in table

Dear Friends
I am getting the following problem while adding a column
in the replication table.
Please suggest.
Problem:
Code:
sp_repladdcolumn [ @.source_object = ] 'OTHALLOCATION'
, [ @.column = ] 'CCICAPPNUM' ]
[ , [ @.typetext = ] 'NVARCHAR(50)' ]
[ , [ @.publication_to_add = ] 'GEMREPLGNETINFOTECH' ]
[ , [ @.schema_change_script = ] 'NVARCHAR(1000)' ]
[ , [ @.force_invalidate_snapshot = ]
force_invalidate_snapshot ]
[ , [ @.force_reinit_subscription = ]
force_reinit_subscription ]
Your earlier reply would be a great help.
Best regards
Sharad
Did you forget to paste the error message?
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Sharad" <niitmalad@.yahoo.co.in> wrote in message
news:06dd01c48b52$703f6b00$a501280a@.phx.gbl...
Dear Friends
I am getting the following problem while adding a column
in the replication table.
Please suggest.
Problem:
Code:
sp_repladdcolumn [ @.source_object = ] 'OTHALLOCATION'
, [ @.column = ] 'CCICAPPNUM' ]
[ , [ @.typetext = ] 'NVARCHAR(50)' ]
[ , [ @.publication_to_add = ] 'GEMREPLGNETINFOTECH' ]
[ , [ @.schema_change_script = ] 'NVARCHAR(1000)' ]
[ , [ @.force_invalidate_snapshot = ]
force_invalidate_snapshot ]
[ , [ @.force_reinit_subscription = ]
force_reinit_subscription ]
Your earlier reply would be a great help.
Best regards
Sharad
sql