I have 470 new database accounts in SYBASE ASE

I certainly don't want to do it manually since it is definitely time consuming.

Here by I have old script which I try to add logins

Can someone help to me write this script in another way?

SCRIPT :

source /cis1/sybase/SYBASE.sh set passs=cat /cis1/prod/dba/input/. ----

isql -Usa -SPDSQTS1 <<EO_SQL $passs

declare a varchar(10) declare n int declare count int declare Iuser varchar(10) declare date varchar(20) declare id int

count=1

while n<427

a=sed -n 'count{p;q;}' "/tmp/addthese.txt"

select Iuser=name from syslogins where name='a'

if [Iuser!=a] sp_addlogin a,Sybase123 go

use qts_db go sp_adduser a,a,eng go use engcomdb go sp_adduser a,a,eng go use sybasedb go sp_adduser a,a,eng go use engdb go sp_adduser a,a,eng go use msgdb go sp_adduser a,a,eng go

use master go sp_modifylogin 'a',"authenticate with","ldap" go

select id=suid from syslogins where name='a' select date=crdate from syslogins where name='a'

use qts_db go

insert into dbo.profiles(login_name,userid,security_level,delta_ts,delta_sy_user) values ('a',id,'ADMIN','date',id) go

insert into dbo.users(userid,site_id,delta_sy_user,delta_ts,email,displayname,lastname,firstname) values(id,'SYBASE',10407,'date','a',', : id','', '') go

end

count=count+1

end

asked 21 Jun, 10:08

Arunraj's gravatar image

Arunraj
101
accept rate: 0%

reverted 21 Jun, 16:27

Breck%20Carter's gravatar image

Breck Carter
26.6k433604879

1

This forum is for SQL Anywhere, not ASE. They are vastly different products, like aircraft and donkey carts.

(21 Jun, 16:28) Breck Carter
Replies hidden

Love the order of your comparison - and the first is often a stealth fighther, as we know:)

(21 Jun, 16:44) Volker Barth
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×51

question asked: 21 Jun, 10:08

question was seen: 91 times

last updated: 21 Jun, 16:44