Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Sunday, March 25, 2012

Can not create unsafe assembly

I try to create assembly with UNSAFE permissions.
I granted "unsafe assembly" to my login, set TRUSTWORTHY property ON.
Now I have this error:

Could not obtain information about Windows NT group/user <MyDomain>/<MyName>, error code 0x5. (Microsoft SQL Server, Error: 15404).

How to resolve this?

Looks like your server isn't able to reach the D.C. to get information on your particular user/group...have you verified connectivity to the domain controller?

|||On a side note, it isn't recommended setting the TRUSTWORTHY property to ON if you only need to create an unsafe assembly. You can also create an asymmetric key, map a login to that key, and grant UNSAFE permission to the login to create an unsafe assembly. See http://msdn2.microsoft.com/ms345106(en-US,SQL.90).aspx for more info.|||Chad, how to verify connectivity to D.C.?|||I've gotten that error before. I think the owner of your database doesn't have permission to create assemblies. Try running sp_ChangeDBOwner 'sa' to change the owner of your database to sa.|||

Good Morning,
Is this the same Chad Boyd from Mars Hill who used to work for ATX in Caribou, ME?

ChrisRogeski@.gmail.com

Can not Create a DSN

I am trying to create a new System DSN but when I get to the part where it
reads" How should SQL Server verify the authenticity of the login ID?" I
select the second option: "With SQL Server authentication...." Then on the
bottom part I enter a username and password. When I click on NEXT, it
fails telling me it's not associated with a trusted SQL Server connection.
I don't use SQL that much, so I am a bit lost.
Can you give me some ideas? Or at least a link to somewhere where I can
find out on my own?
Thanks
Hi,
Check if you SQL Server is supporting authentication of SQL users.
It should be set to use "SQL Server and Windows authentication mode". You
can set that in server properties.
Danijel Novak
"Johnfli" <john@.ivhs.us> wrote in message
news:uUbzupFHGHA.1628@.TK2MSFTNGP12.phx.gbl...
>I am trying to create a new System DSN but when I get to the part where it
>reads" How should SQL Server verify the authenticity of the login ID?" I
>select the second option: "With SQL Server authentication...." Then on
>the bottom part I enter a username and password. When I click on NEXT, it
>fails telling me it's not associated with a trusted SQL Server connection.
> I don't use SQL that much, so I am a bit lost.
> Can you give me some ideas? Or at least a link to somewhere where I can
> find out on my own?
> Thanks
>

Can not Create a DSN

I am trying to create a new System DSN but when I get to the part where it
reads" How should SQL Server verify the authenticity of the login ID?" I
select the second option: "With SQL Server authentication...." Then on the
bottom part I enter a username and password. When I click on NEXT, it
fails telling me it's not associated with a trusted SQL Server connection.
I don't use SQL that much, so I am a bit lost.
Can you give me some ideas? Or at least a link to somewhere where I can
find out on my own'
ThanksHi,
Check if you SQL Server is supporting authentication of SQL users.
It should be set to use "SQL Server and Windows authentication mode". You
can set that in server properties.
Danijel Novak
"Johnfli" <john@.ivhs.us> wrote in message
news:uUbzupFHGHA.1628@.TK2MSFTNGP12.phx.gbl...
>I am trying to create a new System DSN but when I get to the part where it
>reads" How should SQL Server verify the authenticity of the login ID?" I
>select the second option: "With SQL Server authentication...." Then on
>the bottom part I enter a username and password. When I click on NEXT, it
>fails telling me it's not associated with a trusted SQL Server connection.
> I don't use SQL that much, so I am a bit lost.
> Can you give me some ideas? Or at least a link to somewhere where I can
> find out on my own'
> Thanks
>

Can not Create a DSN

I am trying to create a new System DSN but when I get to the part where it
reads" How should SQL Server verify the authenticity of the login ID?" I
select the second option: "With SQL Server authentication...." Then on the
bottom part I enter a username and password. When I click on NEXT, it
fails telling me it's not associated with a trusted SQL Server connection.
I don't use SQL that much, so I am a bit lost.
Can you give me some ideas? Or at least a link to somewhere where I can
find out on my own'
ThanksHi,
Check if you SQL Server is supporting authentication of SQL users.
It should be set to use "SQL Server and Windows authentication mode". You
can set that in server properties.
--
Danijel Novak
"Johnfli" <john@.ivhs.us> wrote in message
news:uUbzupFHGHA.1628@.TK2MSFTNGP12.phx.gbl...
>I am trying to create a new System DSN but when I get to the part where it
>reads" How should SQL Server verify the authenticity of the login ID?" I
>select the second option: "With SQL Server authentication...." Then on
>the bottom part I enter a username and password. When I click on NEXT, it
>fails telling me it's not associated with a trusted SQL Server connection.
> I don't use SQL that much, so I am a bit lost.
> Can you give me some ideas? Or at least a link to somewhere where I can
> find out on my own'
> Thanks
>

Thursday, March 22, 2012

Can not connect to SQL server

I am using SQL server 2005 express edition. I have instaled the managment studio, so I can create the databases and login. Than after it I have changed from Windows authentication to SQL server authentication. So I opened the VWD on another client pc and I tried to connect to specified database, but I get the error COULD NOT CONNECT TO SQL SERVER, check if the server allow the remote connections.

I have chenked it and it is configured to allow remote connections. Why this happens ?? I had never these problems when I used the sql server 2005 beta version. The client pc and this sql server have connections so there is no problem with network connection at all.

Any suggestions ??

PS: I also tried using syntax:

Server name: myserver\SQLEXPRESS (instance)

Best regards

This might occur also if you didnt specify the correct username/password for the SQL authentication method.

Make sure that the database contain that user and is already mapped to the db.

Regards

|||

Hello !! Thank You for answering !!

Actually I found that problem was DISABLED TCP / IP on the SQL server. I have enabled it and now it work fine. When installing the SQL server express the tcp/ip is disabled so it will not respond on the request for other pc`s.

Best regards

Can not connect to distributor because distributor_admin is not defined as remote login

Hello everyone,
We set up replication yesterday and it runs beautifully ... once. After
the first replication, we get the following error whenever we try to
access any of the replication admin screens, with the exception of the
"disable replication" screen:
Error 18483: Could not connect to server XXXX because
'distributor_admin' is not defined as a remote login at the server.
Our setup consists of two SQL Server machines, a primary server which
acts as a publisher and a secondary which acts as both distributor and
subscriber. Replication setup works great, as does the initial snapshot
copy. The transaction agent works perfectly as well.
The error goes away if I disable publishing on both machines and set it
up again, but then it breaks as soon as I complete the initial
replication.
Any help? This has everyone here stumped.
Thanks!!
Sorry - posted this to the wrong group. Please ignore.
rich@.adgooroo.com wrote:
> Hello everyone,
> We set up replication yesterday and it runs beautifully ... once. After
> the first replication, we get the following error whenever we try to
> access any of the replication admin screens, with the exception of the
> "disable replication" screen:
> Error 18483: Could not connect to server XXXX because
> 'distributor_admin' is not defined as a remote login at the server.
> Our setup consists of two SQL Server machines, a primary server which
> acts as a publisher and a secondary which acts as both distributor and
> subscriber. Replication setup works great, as does the initial snapshot
> copy. The transaction agent works perfectly as well.
> The error goes away if I disable publishing on both machines and set it
> up again, but then it breaks as soon as I complete the initial
> replication.
> Any help? This has everyone here stumped.
> Thanks!!

Sunday, March 11, 2012

can login from (Windows) Admin account

Can login from (Windows) Admin account but not from (Windows) Power User account. If I understood correctly, one can only log in with (Windows) _Admin_ account using Windows authentication. Non-admins should use the mixed mode, i.e., use SQL login rather
than Windows authentication.
How does one assign (SQL) sysadmin permissions to a newly created (SQL) account?
sp_addrolemember
"Lolik" <Lolik@.discussions.microsoft.com> wrote in message
news:81DA72A8-E3AF-43FC-8764-C779CAF4D337@.microsoft.com...
> Can login from (Windows) Admin account but not from (Windows) Power User
account. If I understood correctly, one can only log in with (Windows)
_Admin_ account using Windows authentication. Non-admins should use the
mixed mode, i.e., use SQL login rather than Windows authentication.
> How does one assign (SQL) sysadmin permissions to a newly created (SQL)
account?
|||OOps, that's
sp_addsrvrolemember [ @.loginame = ] 'login', [ @.rolename = ] 'role'
"Lolik" <Lolik@.discussions.microsoft.com> wrote in message
news:81DA72A8-E3AF-43FC-8764-C779CAF4D337@.microsoft.com...
> Can login from (Windows) Admin account but not from (Windows) Power User
account. If I understood correctly, one can only log in with (Windows)
_Admin_ account using Windows authentication. Non-admins should use the
mixed mode, i.e., use SQL login rather than Windows authentication.
> How does one assign (SQL) sysadmin permissions to a newly created (SQL)
account?
|||Thanks Michael, I just had found another workaround before I read your suggestion. Please check in the following posting.
Lolik

Saturday, February 25, 2012

Can I use ALTER LOGIN in a stored procedure?

Can the ALTER USER statement be used (without a hack like using EXEC) in a stored procedure? I know that the sp_password system stored procedure can not be. Additionally, it is being deprecated anyway. I guess what is boggling me about my attempts so far relate to the errors I am getting due to the user being specified not being in quotes in the syntax. All of the searching I have done so far have come up lame so far; the only examples I have found about it were in scripts that create other scripts for transferring users and other administrative tasks that would be run from the query window, but not from an application. To be complete as possible, here is an example of a script the returns errors:

ALTER PROC [dbo].[lbxChangePassword]
(
@.loginid nvarchar(180),
@.oldpassword nvarchar(40),
@.newpassword nvarchar(40)
) AS BEGIN

IF @.oldpassword = (SELECT password FROM contacts WHERE loginid = @.loginid)
BEGIN
BEGIN TRANSACTION
UPDATE contacts
SET password = @.newpassword
WHERE loginid = @.loginid

ALTER LOGIN @.loginid WITH PASSWORD=@.newpassword OLD_PASSWORD=@.oldpassword
END
ELSE
BEGIN
RAISERROR(N'The password you entered does not match your current password.', 16, 1)
RETURN
END

IF @.@.ERROR <> 0
BEGIN
RAISERROR(N'There was an error creating your new password.', 16, 1)
RETURN
END

COMMIT TRANSACTION

END

************
This returns:

Msg 102, Level 15, State 1, Procedure lbxChangePassword, Line 15
Incorrect syntax near '@.loginid'.
Msg 319, Level 15, State 1, Procedure lbxChangePassword, Line 15
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.
************

If ALTER LOGIN isn't how to change the password, then please tell me what the correct practice of changing a password is. I want to use the CURRENT_USER keyword in my queries and want I can't finish setting that up until I have this resolved because users will need to change their own passwords through the application I am developing.

I guess you have to put that in dynamic sql to execute:

DECLARE @.SQLStrng NVARCHAR(500)
SET @.SQLString = 'ALTER LOGIN ' + @.loginid + ' WITH PASSWORD= '' + @.newpassword + '' OLD_PASSWORD= '' + @.oldpassword + '''
EXEC(SQLString )

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Yes, the DDL does not accept variables. If you build the string dynamically, use quotename() around the variable names to get them quoted properly:

DECLARE @.SQLStrng NVARCHAR(500)
SET @.SQLString = 'ALTER LOGIN ' + quotename(@.loginid) + ' WITH PASSWORD= ' + quotename(@.newpassword, '''') + ' OLD_PASSWORD= ' + quotename(@.oldpassword, '''')
EXEC(SQLString )

Thanks
Laurentiu

|||

I'll try this, but I was hoping that there would be a way to do this without using a "hack".

Am I not approaching this the right way? The user will be logging into a PHP application and I need for them to be able to change their password. Would you recommend a stored procedure to accomplish this like the ones we've been writing about, or is there a best practice for this. I mean, otherwise how can one administer database users from a web app and still use SQL Server's security model? I don't understand Microsoft's reasoning in this architecture.

|||

Writing a stored procedure to accomplish this is OK. If you don't like to build the dynamic SQL and execute it with EXEC, you might prefer using sp_executesql instead: http://msdn2.microsoft.com/en-US/library/ms175170(SQL.90).aspx.

Thanks
Laurentiu

|||

Well, I read a post by a SQL Server MVP that said that another way to do this is to specify the old/new password in a connection string to the SQL Server Native Client. e.g.:

"Provider=SQLNCLI;Data Source=MyServer;User ID=MyLogin;Old Password=oldpassword;Password=password"

But I don't think PHP is friendly to connection strings though; I tried fiddling with ODBC connections in PHP with no luck. Has anyone heard anything about this?

|||

Try posting on SQL Server Data Access for more details on the connection string idea. I think this connection string is probably meant to be used when a login password is expired; it is not the regular way of changing a login password. If you're looking at all possible ways of changing a login password, you should also check the SQL Server SMO/DMO forum - you could write a CLR procedure to perform this action (see .NET Framework inside SQL Server for questions on using CLR inside SQL Server).

Thanks
Laurentiu

|||

I'm just a curious person :-) Thanks. Good Ideas.

-Ryan