April 13, 2016 at 1:36 pm
This is basically the means that I use now instead of revlogin
N' WITH PASSWORD = 0x' +
CAST('' AS XML).value('xs:hexBinary(sql:column("l.password_hash"))','nvarchar(300)') +
N' HASHED, SID = 0x' + CAST('' AS XML).value('xs:hexBinary(sql:column("p.sid"))', 'nvarchar(100)')
This works on 2008 up through 2014. I don't remember the last time I tried it on 2005 if I did or not. I have yet to test on 2016.
I haven't had a problem with any accounts created using this method.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 13, 2016 at 1:49 pm
SQLRNNR (4/13/2016)
This is basically the means that I use now instead of revlogin
N' WITH PASSWORD = 0x' +
CAST('' AS XML).value('xs:hexBinary(sql:column("l.password_hash"))','nvarchar(300)') +
N' HASHED, SID = 0x' + CAST('' AS XML).value('xs:hexBinary(sql:column("p.sid"))', 'nvarchar(100)')
This works on 2008 up through 2014. I don't remember the last time I tried it on 2005 if I did or not. I have yet to test on 2016.
I haven't had a problem with any accounts created using this method.
Thanks, Jason. I'll play around with this when I get some free time. Always looking for better ways to do things. 😉
April 14, 2016 at 6:52 am
SQLRNNR (4/13/2016)
This is basically the means that I use now instead of revlogin
N' WITH PASSWORD = 0x' +
CAST('' AS XML).value('xs:hexBinary(sql:column("l.password_hash"))','nvarchar(300)') +
N' HASHED, SID = 0x' + CAST('' AS XML).value('xs:hexBinary(sql:column("p.sid"))', 'nvarchar(100)')
This works on 2008 up through 2014. I don't remember the last time I tried it on 2005 if I did or not. I have yet to test on 2016.
I haven't had a problem with any accounts created using this method.
Once the light dawned in my head that you're using sys.sql_logins instead of sys.syslogins (like revlogin uses,) I got this working. Tested it by snagging one of my current SQL2012 logins, and using the create script to create it on one of the new SQL2014s, with no hitches.
You da' man!
April 14, 2016 at 10:03 am
jasona.work (4/14/2016)
SQLRNNR (4/13/2016)
This is basically the means that I use now instead of revlogin
N' WITH PASSWORD = 0x' +
CAST('' AS XML).value('xs:hexBinary(sql:column("l.password_hash"))','nvarchar(300)') +
N' HASHED, SID = 0x' + CAST('' AS XML).value('xs:hexBinary(sql:column("p.sid"))', 'nvarchar(100)')
This works on 2008 up through 2014. I don't remember the last time I tried it on 2005 if I did or not. I have yet to test on 2016.
I haven't had a problem with any accounts created using this method.
Once the light dawned in my head that you're using sys.sql_logins instead of sys.syslogins (like revlogin uses,) I got this working. Tested it by snagging one of my current SQL2012 logins, and using the create script to create it on one of the new SQL2014s, with no hitches.
You da' man!
Actually, the real credit goes to Robert Davis http://www.sqlsoldier.com/wp/sqlserver/transferring-logins-to-a-database-mirror for bringing it to light and Wayne Sheffield for making it work better.
And credit to you as well. You took a small snippit and ran with it until it worked.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 14, 2016 at 10:07 am
Is this guy for real?
How is it possible that he can't work out a basic DML statement and still have a job?
April 14, 2016 at 10:17 am
Ummmm. Ouch?
April 14, 2016 at 10:24 am
I feel that many of these standards to certify processes are simply created to make money.
April 14, 2016 at 10:25 am
Luis Cazares (4/14/2016)
Is this guy for real?How is it possible that he can't work out a basic DML statement and still have a job?
Hopefully Hugo has him sorted.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 14, 2016 at 10:44 am
SQLRNNR (4/14/2016)
jasona.work (4/14/2016)
SQLRNNR (4/13/2016)
This is basically the means that I use now instead of revlogin
N' WITH PASSWORD = 0x' +
CAST('' AS XML).value('xs:hexBinary(sql:column("l.password_hash"))','nvarchar(300)') +
N' HASHED, SID = 0x' + CAST('' AS XML).value('xs:hexBinary(sql:column("p.sid"))', 'nvarchar(100)')
This works on 2008 up through 2014. I don't remember the last time I tried it on 2005 if I did or not. I have yet to test on 2016.
I haven't had a problem with any accounts created using this method.
Once the light dawned in my head that you're using sys.sql_logins instead of sys.syslogins (like revlogin uses,) I got this working. Tested it by snagging one of my current SQL2012 logins, and using the create script to create it on one of the new SQL2014s, with no hitches.
You da' man!
Actually, the real credit goes to Robert Davis http://www.sqlsoldier.com/wp/sqlserver/transferring-logins-to-a-database-mirror for bringing it to light and Wayne Sheffield for making it work better.
And credit to you as well. You took a small snippit and ran with it until it worked.
Thank you!
In case anyone's wondering, here's what I came up with:
select p.name
, l.is_disabled
, 'CREATE LOGIN ' + QUOTENAME( p.name ) + N' WITH PASSWORD = 0x' +
CAST('' AS XML).value('xs:hexBinary(sql:column(''l.password_hash''))','nvarchar(300)') +
N' HASHED, SID = 0x' + CAST('' AS XML).value('xs:hexBinary(sql:column(''p.sid''))', 'nvarchar(100)') + ', DEFAULT_DATABASE = [' + p.default_database_name + ']' as [Create_Login]
from sys.server_principals as p
left join sys.sql_logins as l
ON ( l.name = p.name )
WHERE p.type = 'S'
and p.name not like '##%'
April 14, 2016 at 11:33 am
SQLRNNR (4/14/2016)
Luis Cazares (4/14/2016)
Is this guy for real?How is it possible that he can't work out a basic DML statement and still have a job?
Hopefully Hugo has him sorted.
Yes he did. Then the OP moved on to his loop to split strings. I referred him to Jeff's article and I'm curious on where it'll go.
April 14, 2016 at 11:40 am
Ed Wagner (4/14/2016)
SQLRNNR (4/14/2016)
Luis Cazares (4/14/2016)
Is this guy for real?How is it possible that he can't work out a basic DML statement and still have a job?
Hopefully Hugo has him sorted.
Yes he did. Then the OP moved on to his loop to split strings. I referred him to Jeff's article and I'm curious on where it'll go.
IMO, people that can't understand INSERT INTO...SELECT shouldn't be coding splitters in T-SQL.
April 14, 2016 at 11:48 am
Luis Cazares (4/14/2016)
Ed Wagner (4/14/2016)
SQLRNNR (4/14/2016)
Luis Cazares (4/14/2016)
Is this guy for real?How is it possible that he can't work out a basic DML statement and still have a job?
Hopefully Hugo has him sorted.
Yes he did. Then the OP moved on to his loop to split strings. I referred him to Jeff's article and I'm curious on where it'll go.
IMO, people that can't understand INSERT INTO...SELECT shouldn't be coding
splittersin T-SQL.
Agreed. Learn the basics of the language before using it. Then, after you've learned it, learn something new every day.
April 14, 2016 at 11:59 am
Well, apparently I don't write good questions to teach these people things.
Maybe some of you should write some questions to help people learn how to write DML?
:-P:-D:w00t::hehe:
Seriously, looking for articles and questions, if you are so inclined.
April 14, 2016 at 12:08 pm
Steve Jones - SSC Editor (4/14/2016)
Well, apparently I don't write good questions to teach these people things.Maybe some of you should write some questions to help people learn how to write DML?
:-P:-D:w00t::hehe:
Seriously, looking for articles and questions, if you are so inclined.
Something like: What is the problem with the following query?
select * from
(delete
(update (insert into
where
select 1/0 where 4 = 5)
)
)
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
April 14, 2016 at 12:12 pm
Phil Parkin (4/14/2016)
Steve Jones - SSC Editor (4/14/2016)
Well, apparently I don't write good questions to teach these people things.Maybe some of you should write some questions to help people learn how to write DML?
:-P:-D:w00t::hehe:
Seriously, looking for articles and questions, if you are so inclined.
Something like: What is the problem with the following query?
select * from
(delete
(update (insert into
where
select 1/0 where 4 = 5)
)
)
That made my head hurt.
Viewing 15 posts - 53,506 through 53,520 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply