Showing posts with label customers. Show all posts
Showing posts with label customers. Show all posts

Sunday, February 26, 2012

Enabling Mixed Mode Auth. with tSQL?

Is it possible to run a tSql statement that will enable Mixed-Mode authentication? My customers need to have this set and I don't want them to have to go into Enterprise Mgr. Any ideas?
Thanks!I'm not aware of any way. You may want to run a profiler trace and then do it through enterprise manager to see what command sit executes.

Just an idea...|||Valid tip by Loach, but that does include reading thru registry keys which is not advisable to deal with a code.
YOu're better of with GUI supplied tools.|||Originally posted by riceman744
Is it possible to run a tSql statement that will enable Mixed-Mode authentication? My customers need to have this set and I don't want them to have to go into Enterprise Mgr. Any ideas?

Thanks!

Hello,
you can change security model this way

begin
DECLARE @.hr int
DECLARE @.sqlserver int
declare @.hresult int
DECLARE @.IntegratedSecutiry int
declare @.hostname varchar(255)

declare @.servername varchar(255) set @.servername = @.@.servername

EXEC @.hr = master.dbo.sp_OACreate 'SQLDMO.SQLServer', @.sqlserver OUTPUT
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver

EXEC @.hr = master.dbo.sp_OASetProperty @.sqlserver, 'LoginSecure', 'TRUE'
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver


exec @.hr = sp_OAMethod @.sqlserver, 'Connect', NULL, @.servername
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver

EXEC @.hr = master.dbo.sp_OAGetProperty @.sqlserver, 'IntegratedSecurity', @.IntegratedSecutiry OUTPUT
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver


EXEC @.hr = master.dbo.sp_OASetProperty @.IntegratedSecutiry, 'SecurityMode', '2'
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver


EXEC @.hr = master.dbo.sp_OAGetProperty @.IntegratedSecutiry, 'SecurityMode'--, @.IntegratedSecutiry OUTPUT
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver

EXEC @.hr = master.dbo.sp_OADestroy @.sqlserver
end
GO

by
Paan-cha|||You can do it by modifying the registry.
For default instance
HKLM/Software/Microsoft/MSSQLServer/MSSQLServer/LoginMode

= 1 integrated security, 2 mixed.

But you probably don't want them to do that either.|||If you want to go that route then how about:

declare @.IntValue int
exec xp_regread 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServ er\MSSQLServer','LoginMode',@.IntValue OUTPUT
select @.IntValue as LoginMode

exec xp_regwrite 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServ er\MSSQLServer','LoginMode','REG_DWORD',1

exec xp_regread 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServ er\MSSQLServer','LoginMode',@.IntValue OUTPUT
select @.IntValue as LoginMode

Enabling Fulltext Service on database

Hi guys,
one of my customers moved a SQL Database from one server
to another. The database had 2 fulltext catalogs associated.
On the new DB Server the fulltext service doesn't start using
sp_fulltext_database 'enable'.
QA shows "Executing Query Batch..." but never returns.
I googled on the newsgroups and found the solution to update the
path in the sysfulltextcatalogs to a physical existent folder on the
new server. I tried again with sp_fulltext_database but again it
doesn't work.
The only thing I need is to clean/remove the two catalogs, rebuild
them and enabling the fulltext. What can I do ?
I read also the support ms doc #240867.
So, what am I missing ? Thank you all.
David De Giacomi
Microsoft MVP
Blog @. http://blogs.dotnethell.it/david/
http://www.dotnethell.it
sp_fulltext_database 'disable' in your problem database and run profiler to
see where it is getting stuck (if it does at all). Then I would try to
reenable it (sp_fulltext_database 'enable') and again run profiler to see
where it is getting stuck.
Make sure you kick all users out of this database when you run this command.
I would also bounce the box if you have this luxury before running this
command.
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
"David De Giacomi [dotNetHell.it]" <david_NOSPAM@.dotnethell.it> wrote in
message news:uv%23YZTGOGHA.812@.TK2MSFTNGP10.phx.gbl...
> Hi guys,
> one of my customers moved a SQL Database from one server
> to another. The database had 2 fulltext catalogs associated.
> On the new DB Server the fulltext service doesn't start using
> sp_fulltext_database 'enable'.
> QA shows "Executing Query Batch..." but never returns.
> I googled on the newsgroups and found the solution to update the
> path in the sysfulltextcatalogs to a physical existent folder on the
> new server. I tried again with sp_fulltext_database but again it
> doesn't work.
> The only thing I need is to clean/remove the two catalogs, rebuild
> them and enabling the fulltext. What can I do ?
> I read also the support ms doc #240867.
> So, what am I missing ? Thank you all.
> --
> David De Giacomi
> Microsoft MVP
> Blog @. http://blogs.dotnethell.it/david/
> http://www.dotnethell.it
>