Copying Sybase users from one database to another - ASA7 WIN32

TEST ONLY - SYBASE ASA703 WIN32.

Hi all,

I have two systems both the same. I want to copy the Sybase users from one
system to another. I know I could unload the schema from the one database
and strip out everything but the create user ids. But could I do it through
a CURSOR and Proxy tables. So far I can apart from the password field from
sysuserperm as it is encrypted. Is there any way of solving this problem
given the following example:


IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
'SYBASE_USERS_COPY_PROC') THEN
Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
END IF;

CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
BEGIN
DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
DECLARE U_NAME Char(128);
DECLARE P_WORD binary(36);

DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
--SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase users I
want.

Select User_name, password from SYSUSERPERM_PX
WHERE USER_NAME <> 'dba'
AND USER_NAME <> 'dbo'
AND USER_NAME <> 'PUBLIC'
AND USER_NAME <> 'SA_DEBUG'
AND USER_NAME <> 'rs_systabgroup';

OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;

SYBASE_USERS_COPY_PROC_LOOP:
LOOP

    FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
  IF SQLSTATE = err_notFound THEN
     print SQLSTATE;
     LEAVE SYBASE_USERS_COPY_PROC_LOOP;
    END IF;

PRINT U_NAME || ' ' || P_WORD;

GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
GRANT BLAH BLAH.......

END LOOP SYBASE_USERS_COPY_PROC_LOOP;
CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
END;

---------------------------

May thanks

Russell J Morgan


0
Russell
5/29/2003 3:42:23 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

6 Replies
211 Views

Similar Articles

[PageSpeed] 13

Sorry the encryptions are one-way by design and the internal and external
encryptions are different (also by design) so the fallout of that is that
you can
cannot go from one to the other through inspection of system tables.

It only makes sense though.  Anybody who can connect can snoop that
field by simply selecting that column from the system table ... so if there
was
a direct transformation of that, anybody (even a guest account if one is set
up) could become DBA if they wanted.  You can see why WE would not
want that to be possible.


"Russell J Morgan" <russell@careervision.co.uk> wrote in message
news:%23waGymfJDHA.311@forums-1-dub...
> TEST ONLY - SYBASE ASA703 WIN32.
>
> Hi all,
>
> I have two systems both the same. I want to copy the Sybase users from one
> system to another. I know I could unload the schema from the one database
> and strip out everything but the create user ids. But could I do it
through
> a CURSOR and Proxy tables. So far I can apart from the password field from
> sysuserperm as it is encrypted. Is there any way of solving this problem
> given the following example:
>
>
> IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
> 'SYBASE_USERS_COPY_PROC') THEN
> Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
> END IF;
>
> CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
> BEGIN
> DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
> DECLARE U_NAME Char(128);
> DECLARE P_WORD binary(36);
>
> DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
> --SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase users
I
> want.
>
> Select User_name, password from SYSUSERPERM_PX
> WHERE USER_NAME <> 'dba'
> AND USER_NAME <> 'dbo'
> AND USER_NAME <> 'PUBLIC'
> AND USER_NAME <> 'SA_DEBUG'
> AND USER_NAME <> 'rs_systabgroup';
>
> OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;
>
> SYBASE_USERS_COPY_PROC_LOOP:
> LOOP
>
>     FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
>   IF SQLSTATE = err_notFound THEN
>      print SQLSTATE;
>      LEAVE SYBASE_USERS_COPY_PROC_LOOP;
>     END IF;
>
> PRINT U_NAME || ' ' || P_WORD;
>
> GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
> GRANT BLAH BLAH.......
>
> END LOOP SYBASE_USERS_COPY_PROC_LOOP;
> CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
> END;
>
> ---------------------------
>
> May thanks
>
> Russell J Morgan
>
>


0
Nick
5/30/2003 3:44:08 PM
Its wonderful the fact that the security is there.
I will create new passwords but keep the user ids as they are.

Thanks for help


"Nick Elson" <no_spam_nicelson@sybase.com> wrote in message
news:uacmTLsJDHA.220@forums-1-dub...
> Sorry the encryptions are one-way by design and the internal and external
> encryptions are different (also by design) so the fallout of that is that
> you can
> cannot go from one to the other through inspection of system tables.
>
> It only makes sense though.  Anybody who can connect can snoop that
> field by simply selecting that column from the system table ... so if
there
> was
> a direct transformation of that, anybody (even a guest account if one is
set
> up) could become DBA if they wanted.  You can see why WE would not
> want that to be possible.
>
>
> "Russell J Morgan" <russell@careervision.co.uk> wrote in message
> news:%23waGymfJDHA.311@forums-1-dub...
> > TEST ONLY - SYBASE ASA703 WIN32.
> >
> > Hi all,
> >
> > I have two systems both the same. I want to copy the Sybase users from
one
> > system to another. I know I could unload the schema from the one
database
> > and strip out everything but the create user ids. But could I do it
> through
> > a CURSOR and Proxy tables. So far I can apart from the password field
from
> > sysuserperm as it is encrypted. Is there any way of solving this problem
> > given the following example:
> >
> >
> > IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
> > 'SYBASE_USERS_COPY_PROC') THEN
> > Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
> > END IF;
> >
> > CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
> > BEGIN
> > DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
> > DECLARE U_NAME Char(128);
> > DECLARE P_WORD binary(36);
> >
> > DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
> > --SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase
users
> I
> > want.
> >
> > Select User_name, password from SYSUSERPERM_PX
> > WHERE USER_NAME <> 'dba'
> > AND USER_NAME <> 'dbo'
> > AND USER_NAME <> 'PUBLIC'
> > AND USER_NAME <> 'SA_DEBUG'
> > AND USER_NAME <> 'rs_systabgroup';
> >
> > OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;
> >
> > SYBASE_USERS_COPY_PROC_LOOP:
> > LOOP
> >
> >     FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
> >   IF SQLSTATE = err_notFound THEN
> >      print SQLSTATE;
> >      LEAVE SYBASE_USERS_COPY_PROC_LOOP;
> >     END IF;
> >
> > PRINT U_NAME || ' ' || P_WORD;
> >
> > GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
> > GRANT BLAH BLAH.......
> >
> > END LOOP SYBASE_USERS_COPY_PROC_LOOP;
> > CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
> > END;
> >
> > ---------------------------
> >
> > May thanks
> >
> > Russell J Morgan
> >
> >
>
>


0
Russell
5/30/2003 4:21:42 PM
Why not use the same format of GRANT that unload produces? Does that
not allow the creation of user ids with the original passwords?

Breck

On Fri, 30 May 2003 11:44:08 -0400, "Nick Elson"
<no_spam_nicelson@sybase.com> wrote:

>Sorry the encryptions are one-way by design and the internal and external
>encryptions are different (also by design) so the fallout of that is that
>you can
>cannot go from one to the other through inspection of system tables.
>
>It only makes sense though.  Anybody who can connect can snoop that
>field by simply selecting that column from the system table ... so if there
>was
>a direct transformation of that, anybody (even a guest account if one is set
>up) could become DBA if they wanted.  You can see why WE would not
>want that to be possible.
>
>
>"Russell J Morgan" <russell@careervision.co.uk> wrote in message
>news:%23waGymfJDHA.311@forums-1-dub...
>> TEST ONLY - SYBASE ASA703 WIN32.
>>
>> Hi all,
>>
>> I have two systems both the same. I want to copy the Sybase users from one
>> system to another. I know I could unload the schema from the one database
>> and strip out everything but the create user ids. But could I do it
>through
>> a CURSOR and Proxy tables. So far I can apart from the password field from
>> sysuserperm as it is encrypted. Is there any way of solving this problem
>> given the following example:
>>
>>
>> IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
>> 'SYBASE_USERS_COPY_PROC') THEN
>> Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
>> END IF;
>>
>> CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
>> BEGIN
>> DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
>> DECLARE U_NAME Char(128);
>> DECLARE P_WORD binary(36);
>>
>> DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
>> --SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase users
>I
>> want.
>>
>> Select User_name, password from SYSUSERPERM_PX
>> WHERE USER_NAME <> 'dba'
>> AND USER_NAME <> 'dbo'
>> AND USER_NAME <> 'PUBLIC'
>> AND USER_NAME <> 'SA_DEBUG'
>> AND USER_NAME <> 'rs_systabgroup';
>>
>> OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;
>>
>> SYBASE_USERS_COPY_PROC_LOOP:
>> LOOP
>>
>>     FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
>>   IF SQLSTATE = err_notFound THEN
>>      print SQLSTATE;
>>      LEAVE SYBASE_USERS_COPY_PROC_LOOP;
>>     END IF;
>>
>> PRINT U_NAME || ' ' || P_WORD;
>>
>> GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
>> GRANT BLAH BLAH.......
>>
>> END LOOP SYBASE_USERS_COPY_PROC_LOOP;
>> CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
>> END;
>>
>> ---------------------------
>>
>> May thanks
>>
>> Russell J Morgan
>>
>>
>

bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
http://www.risingroad.com
0
Breck
6/1/2003 4:21:19 PM
Your suggestion does work perfectly. It was the editing of the unload file I
was trying to avoid. Its a bit of a pain when your trying to get a customer
to do it.



"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in
message news:fu9kdvgv6b81ff2j3g93j1r4cm086okl5c@4ax.com...
> Why not use the same format of GRANT that unload produces? Does that
> not allow the creation of user ids with the original passwords?
>
> Breck
>
> On Fri, 30 May 2003 11:44:08 -0400, "Nick Elson"
> <no_spam_nicelson@sybase.com> wrote:
>
> >Sorry the encryptions are one-way by design and the internal and external
> >encryptions are different (also by design) so the fallout of that is that
> >you can
> >cannot go from one to the other through inspection of system tables.
> >
> >It only makes sense though.  Anybody who can connect can snoop that
> >field by simply selecting that column from the system table ... so if
there
> >was
> >a direct transformation of that, anybody (even a guest account if one is
set
> >up) could become DBA if they wanted.  You can see why WE would not
> >want that to be possible.
> >
> >
> >"Russell J Morgan" <russell@careervision.co.uk> wrote in message
> >news:%23waGymfJDHA.311@forums-1-dub...
> >> TEST ONLY - SYBASE ASA703 WIN32.
> >>
> >> Hi all,
> >>
> >> I have two systems both the same. I want to copy the Sybase users from
one
> >> system to another. I know I could unload the schema from the one
database
> >> and strip out everything but the create user ids. But could I do it
> >through
> >> a CURSOR and Proxy tables. So far I can apart from the password field
from
> >> sysuserperm as it is encrypted. Is there any way of solving this
problem
> >> given the following example:
> >>
> >>
> >> IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
> >> 'SYBASE_USERS_COPY_PROC') THEN
> >> Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
> >> END IF;
> >>
> >> CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
> >> BEGIN
> >> DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
> >> DECLARE U_NAME Char(128);
> >> DECLARE P_WORD binary(36);
> >>
> >> DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
> >> --SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase
users
> >I
> >> want.
> >>
> >> Select User_name, password from SYSUSERPERM_PX
> >> WHERE USER_NAME <> 'dba'
> >> AND USER_NAME <> 'dbo'
> >> AND USER_NAME <> 'PUBLIC'
> >> AND USER_NAME <> 'SA_DEBUG'
> >> AND USER_NAME <> 'rs_systabgroup';
> >>
> >> OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;
> >>
> >> SYBASE_USERS_COPY_PROC_LOOP:
> >> LOOP
> >>
> >>     FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
> >>   IF SQLSTATE = err_notFound THEN
> >>      print SQLSTATE;
> >>      LEAVE SYBASE_USERS_COPY_PROC_LOOP;
> >>     END IF;
> >>
> >> PRINT U_NAME || ' ' || P_WORD;
> >>
> >> GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
> >> GRANT BLAH BLAH.......
> >>
> >> END LOOP SYBASE_USERS_COPY_PROC_LOOP;
> >> CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
> >> END;
> >>
> >> ---------------------------
> >>
> >> May thanks
> >>
> >> Russell J Morgan
> >>
> >>
> >
>
> bcarter@risingroad.com
> Mobile and Distributed Enterprise Database Applications
> http://www.risingroad.com


0
Russell
6/2/2003 1:53:26 PM
Can't you generate the unload-style GRANT statements yourself, via
SELECT, using the encrypted passwords? The challenge would be to
represent the string as a series of \x99 hex literals.

Breck 


On Mon, 2 Jun 2003 14:53:26 +0100, "Russell J Morgan"
<russell@careervision.co.uk> wrote:

>Your suggestion does work perfectly. It was the editing of the unload file I
>was trying to avoid. Its a bit of a pain when your trying to get a customer
>to do it.
>
>
>
>"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in
>message news:fu9kdvgv6b81ff2j3g93j1r4cm086okl5c@4ax.com...
>> Why not use the same format of GRANT that unload produces? Does that
>> not allow the creation of user ids with the original passwords?
>>
>> Breck
>>
>> On Fri, 30 May 2003 11:44:08 -0400, "Nick Elson"
>> <no_spam_nicelson@sybase.com> wrote:
>>
>> >Sorry the encryptions are one-way by design and the internal and external
>> >encryptions are different (also by design) so the fallout of that is that
>> >you can
>> >cannot go from one to the other through inspection of system tables.
>> >
>> >It only makes sense though.  Anybody who can connect can snoop that
>> >field by simply selecting that column from the system table ... so if
>there
>> >was
>> >a direct transformation of that, anybody (even a guest account if one is
>set
>> >up) could become DBA if they wanted.  You can see why WE would not
>> >want that to be possible.
>> >
>> >
>> >"Russell J Morgan" <russell@careervision.co.uk> wrote in message
>> >news:%23waGymfJDHA.311@forums-1-dub...
>> >> TEST ONLY - SYBASE ASA703 WIN32.
>> >>
>> >> Hi all,
>> >>
>> >> I have two systems both the same. I want to copy the Sybase users from
>one
>> >> system to another. I know I could unload the schema from the one
>database
>> >> and strip out everything but the create user ids. But could I do it
>> >through
>> >> a CURSOR and Proxy tables. So far I can apart from the password field
>from
>> >> sysuserperm as it is encrypted. Is there any way of solving this
>problem
>> >> given the following example:
>> >>
>> >>
>> >> IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
>> >> 'SYBASE_USERS_COPY_PROC') THEN
>> >> Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
>> >> END IF;
>> >>
>> >> CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
>> >> BEGIN
>> >> DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
>> >> DECLARE U_NAME Char(128);
>> >> DECLARE P_WORD binary(36);
>> >>
>> >> DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
>> >> --SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase
>users
>> >I
>> >> want.
>> >>
>> >> Select User_name, password from SYSUSERPERM_PX
>> >> WHERE USER_NAME <> 'dba'
>> >> AND USER_NAME <> 'dbo'
>> >> AND USER_NAME <> 'PUBLIC'
>> >> AND USER_NAME <> 'SA_DEBUG'
>> >> AND USER_NAME <> 'rs_systabgroup';
>> >>
>> >> OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;
>> >>
>> >> SYBASE_USERS_COPY_PROC_LOOP:
>> >> LOOP
>> >>
>> >>     FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
>> >>   IF SQLSTATE = err_notFound THEN
>> >>      print SQLSTATE;
>> >>      LEAVE SYBASE_USERS_COPY_PROC_LOOP;
>> >>     END IF;
>> >>
>> >> PRINT U_NAME || ' ' || P_WORD;
>> >>
>> >> GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
>> >> GRANT BLAH BLAH.......
>> >>
>> >> END LOOP SYBASE_USERS_COPY_PROC_LOOP;
>> >> CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
>> >> END;
>> >>
>> >> ---------------------------
>> >>
>> >> May thanks
>> >>
>> >> Russell J Morgan
>> >>
>> >>
>> >
>>
>> bcarter@risingroad.com
>> Mobile and Distributed Enterprise Database Applications
>> http://www.risingroad.com
>

bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
http://www.risingroad.com
0
Breck
6/2/2003 2:40:13 PM
This is one way I can do it.



Dump out the file to txt. Jiggle the output file in XLS.



SELECT * FROM SYSUSERPERM;

OUTPUT TO d:\test.txt

FORMAT ASCII

HEXADECIMAL OFF



Establish d:\test.xls as proxy table.

Cycle through users 1 by 1 by the cursor method completing the following on
the database without the users.



 GRANT CONNECT TO "test1"  IDENTIFIED BY ENCRYPTED

'V\x18��A"h?\x17�\x0c�ʰBֿ��<@gs�0~+?��O}�V�'';



Adding the authorities as I go....



 Works a treat.



Is there a better, simpler way?

Russell J Morgan


"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in
message news:p6omdvk0kgpo29gm1fe5ji33inrvrqcjnp@4ax.com...
> Can't you generate the unload-style GRANT statements yourself, via
> SELECT, using the encrypted passwords? The challenge would be to
> represent the string as a series of \x99 hex literals.
>
> Breck
>
>
> On Mon, 2 Jun 2003 14:53:26 +0100, "Russell J Morgan"
> <russell@careervision.co.uk> wrote:
>
> >Your suggestion does work perfectly. It was the editing of the unload
file I
> >was trying to avoid. Its a bit of a pain when your trying to get a
customer
> >to do it.
> >
> >
> >
> >"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in
> >message news:fu9kdvgv6b81ff2j3g93j1r4cm086okl5c@4ax.com...
> >> Why not use the same format of GRANT that unload produces? Does that
> >> not allow the creation of user ids with the original passwords?
> >>
> >> Breck
> >>
> >> On Fri, 30 May 2003 11:44:08 -0400, "Nick Elson"
> >> <no_spam_nicelson@sybase.com> wrote:
> >>
> >> >Sorry the encryptions are one-way by design and the internal and
external
> >> >encryptions are different (also by design) so the fallout of that is
that
> >> >you can
> >> >cannot go from one to the other through inspection of system tables.
> >> >
> >> >It only makes sense though.  Anybody who can connect can snoop that
> >> >field by simply selecting that column from the system table ... so if
> >there
> >> >was
> >> >a direct transformation of that, anybody (even a guest account if one
is
> >set
> >> >up) could become DBA if they wanted.  You can see why WE would not
> >> >want that to be possible.
> >> >
> >> >
> >> >"Russell J Morgan" <russell@careervision.co.uk> wrote in message
> >> >news:%23waGymfJDHA.311@forums-1-dub...
> >> >> TEST ONLY - SYBASE ASA703 WIN32.
> >> >>
> >> >> Hi all,
> >> >>
> >> >> I have two systems both the same. I want to copy the Sybase users
from
> >one
> >> >> system to another. I know I could unload the schema from the one
> >database
> >> >> and strip out everything but the create user ids. But could I do it
> >> >through
> >> >> a CURSOR and Proxy tables. So far I can apart from the password
field
> >from
> >> >> sysuserperm as it is encrypted. Is there any way of solving this
> >problem
> >> >> given the following example:
> >> >>
> >> >>
> >> >> IF EXISTS(Select Proc_name from sysprocedure where Proc_name =
> >> >> 'SYBASE_USERS_COPY_PROC') THEN
> >> >> Drop PROCEDURE dba.SYBASE_USERS_COPY_PROC;
> >> >> END IF;
> >> >>
> >> >> CREATE PROCEDURE dba.SYBASE_USERS_COPY_PROC()
> >> >> BEGIN
> >> >> DECLARE err_notfound EXCEPTION FOR SQLSTATE '02000';
> >> >> DECLARE U_NAME Char(128);
> >> >> DECLARE P_WORD binary(36);
> >> >>
> >> >> DECLARE SYBASE_USERS_COPY_PROC_CURSOR CURSOR FOR
> >> >> --SYSUSERPERM_PX   is proxy - sysuserperm that contains the sysbase
> >users
> >> >I
> >> >> want.
> >> >>
> >> >> Select User_name, password from SYSUSERPERM_PX
> >> >> WHERE USER_NAME <> 'dba'
> >> >> AND USER_NAME <> 'dbo'
> >> >> AND USER_NAME <> 'PUBLIC'
> >> >> AND USER_NAME <> 'SA_DEBUG'
> >> >> AND USER_NAME <> 'rs_systabgroup';
> >> >>
> >> >> OPEN SYBASE_USERS_COPY_PROC_CURSOR WITH HOLD;
> >> >>
> >> >> SYBASE_USERS_COPY_PROC_LOOP:
> >> >> LOOP
> >> >>
> >> >>     FETCH NEXT SYBASE_USERS_COPY_PROC_CURSOR INTO U_NAME, P_WORD;
> >> >>   IF SQLSTATE = err_notFound THEN
> >> >>      print SQLSTATE;
> >> >>      LEAVE SYBASE_USERS_COPY_PROC_LOOP;
> >> >>     END IF;
> >> >>
> >> >> PRINT U_NAME || ' ' || P_WORD;
> >> >>
> >> >> GRANT CONNECT TO U_NAME IDENTIFIED BY P_WORD;
> >> >> GRANT BLAH BLAH.......
> >> >>
> >> >> END LOOP SYBASE_USERS_COPY_PROC_LOOP;
> >> >> CLOSE SYBASE_USERS_COPY_PROC_CURSOR;
> >> >> END;
> >> >>
> >> >> ---------------------------
> >> >>
> >> >> May thanks
> >> >>
> >> >> Russell J Morgan
> >> >>
> >> >>
> >> >
> >>
> >> bcarter@risingroad.com
> >> Mobile and Distributed Enterprise Database Applications
> >> http://www.risingroad.com
> >
>
> bcarter@risingroad.com
> Mobile and Distributed Enterprise Database Applications
> http://www.risingroad.com


0
Russell
6/3/2003 9:54:20 AM
Reply:

Similar Artilces:

Copying users from one database to another
I am using SQLAnywhere and PB 6.0. Each quarter we plan on distributing the latest and great version of our database to our customers. The dilema I am having is that each customers verison has unique users. I am dont want to make them re enter thier users every quarter. But I cant think of a good way to copy all the users AND their passwords from one version of database to the next. One option would be that I could store the users password in my own tables, but I would prefer not having to do that. Does anyone know of a way to copy users intact from one database to another? Bob ...

Copying a Remote Database from One User to Another
I have a need to pass a remote database from one user to another. If I just copy the .db and the .log files from user A to B, then during merge, the Mobilink server will think that user A and B performed the same changes (because they have the same entries in the transaction log) and it will treat these changes as conflicts. So I was thinking, perhaps if I copy the .db and .log file from A to B, then truncate the transaction log of user B, Mobilink will not treat the same changes as conflicts. As far as Mobilink is concerned, user B has not performed any changes on the database. ...

Need to copy users and groups from one database to another
I am trying to copy the users and groups that are set up in one ASA 7 database to another one using command line. I would like to find a way such a running a dbunload to get this information out in such a way that I can easily get it into another database. I am able to move most the information with command like dbunload -c "..." -ac "..." -d (No -d and I get conflicts with things already existing.) But I cannot seem to get the user information to go across. I even tried specify what I thought was the underlying table (could be wrong). Any ideas? Thanks...

copying tables from one database to another database
i am using visual web developer 2005 and SQL Express 2005 with VB  as the code behindi have two databases . i want to copy all the tables with all the contents from one database to another database programaticallyhow to achieve this ?please help me  easiest way is to use the detach - attach method or backup and restoreKH...

How to copy a table from one database to another database ?
Hello to you, I'm newbie using pb8.02 I'm uisng ms-access 2000 I'd database abc & xyz that contains customer table I want to copy some record on abc.customer to xyz.customer How ? What is the easy way ? should I using datawindow ? (i meant should I always had dw to got this purpose ? ) please advice steven DataWindow purists will flinch, but I think an embedded SQL INSERT INTO xyz.customer (SELECT ... FROM abc.customer) is the clearest way to do that. Two datawindows/datastores, retrieve the first, RowsCopy, Update on the second will also work. Pi...

how to copy one database entries to another database
hi i have a windows based application and a web based application. the database of windows based application and web based application are same but located on different machiene. like windows based application is located on local machiene and web based databased is located on another machiene. Now my prob is that after inserting all the entries in local database i want to copy these entries to web database using my windows application on single click of the button. but i have no idea about it. how could i do this. Thanks in adwance. well you have to create a DTS id ur using sql 2000 or SSI...

How to copy table from one database to another database ?
Hello to you, I'm uisng pb8 How to copy some rows from customer table in (ABC database) to customer table in (XYZ databases) the selection row is : select * from customer where startdate = 2002-06-15 Please show me the code, step by step steven On Sun, 16 Jun 2002 22:30:37 -0400, steven wrote: >Hello to you, >I'm uisng pb8 > >How to copy some rows from customer table in (ABC database) to customer >table in (XYZ databases) > >the selection row is : >select * from customer where startdate = 2002-06-15 > >Please show me the code...

Transfer och Copy roles from one user to another user.
I would like to see two more methods to the Role feature in Whidbey, one that apply user's roles to another user and one that merge a user's roles with another user. This will be very useful in a Business Portal where employees (users) belong to several roles, and one of the employees quits and a new person will take the other person's roles. Roles.ApplyRoles(sourceUser, destUser); Roles.MergeRoles(sourceUser, destUser); I have added those methods to the Permission manager I'm working on. The company I work for has several customers that have requested this kind of feature, because ...

how to copy one table from one database to another on different servers?
 Hello. I need to copy all of the rows in a table from a database on one server, to another existing table of the same name in a different database on a different server.  I'm trying to use a SELECT INTO statement.  Any idea how to do this?I've tried SELECT          *   INTO                  DestinationServer.dbo.DestinationDB.DestinationTableFROM             &nb...

How to write a stored procedure to copy the data from one database to another database
 I want to copy the data from one database to another database every 12 hrs.(This is variable). Say for example I have 3 applications and I want to copy the data from Parentdatabase1 and insert into CopyofParentdatabase1 for every 6 hrsParentdatabase2 and insert into CopyofParentdatabase2 for every 8 hrsParentdatabase3 and insert into CopyofParentdatabase3 for every 12 hrsI have heard that we can do this by using SQL Server Integration Services but as of now we cannot use SSIS. So I want to do this using Stored procedures. Is there a way to schedule the batch job for to run all these stored procedures at the specified time. The above mentioned times may change. So this should pull up these duration hrs from some place.If there is a way to copy all these data using stored procedures and can schedule these batch jobs using Sql Server management studio, then any one help me or guide to write  storeprocedure and creating that batch job Thanks You should Creat A DTS or SSIs Packages to do this its faster A fine is a tax for doing wrong. A tax is a fine for doing well.__________________________________________________Please remember to click “Mark as Answer” on the post that helps you.  HI,   You can create a DTS package for copy the database to another db. You can also schedule these DTS package for regular intervals.Both steps you can do it using Enterprise Manager itself.  -Sri-------------------------------------------------If this post...

Copying information from One table to Another from 2 different databases on one server
Can I copy accross databases e.g.: In MS SQL I can: Insert into Database2..customer select * from Database1..customer Thanks in Advance Yes you can. The syntax in Sybase is same. The syntax is the same if you are on ASE. ASA does not support that syntax. You need to use a Proxy table instead. -- Jim Egan [TeamSybase] Houston, TX http://www.eganomics.com Sybase Developers Network http://sdn.sybase.com/sdn/mec/mec_home.stm ...

Copy one database to another
Hi      I want to Copy one database to another in MSAcess i am using asp.net, C#  and copy all tables from one database to another.     Regards Neha Probably the easiest way is to simply use the classes in the System.IO namespace to copy the mdb file.  If you only want the structure, and not the data, iterate the tables in the copy database and DELETE * from them.  Have a look at Jet Replication Objects for compacting and repairing the copy database afterwards: http://www.codeproject.com/KB/database/mdbcompact_latebind.aspx Regards Mi...

import one table from one database to another database
if i have one table from database A, and i want to copy the table to database B, then how to do it in SQL server management studio express? is it i have to make sql query?Taj FreewarezNo limitations...It is not a shareware...It is simply free :)http://tajfreeware.blogspot.com try      select * into databaseB.dbo.TableA            from databaseA.dbo.TableA or go to database B and run   select * into TableA              from databaseA.dbo.TableA...

copy database one database to onther database
hii want to copy one database table to onther database table using script?my database is ms-sql server 2000 Nothing is really over,untill the moment stop trying for it...Amitsp(MCTS,MCP)sqlreporting.blogspot.com You can use import/export task and DTS package created automatically by Enterprise manager or just try  select * INTO [newdatabase].dbo.[newTable] from [sourceDatabase].dbo.[sourcetable]  good luckThanksJPazgier no dear i want to this programatticallyiusing c #,source is my database in local machine and target is other computer means server Nothing is really...

Copy tables from one database to another?
Hello there, Is there an easy way to copy alle tables from one database to another?I have not really tried to create tables or copy or something like that, so i dont even know if its possible?Hope some of you can help me, ----------------Regards,Jeppe Richardt Hey you could use SQL Bulkcopy:http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy(VS.80).aspx Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue....

Copy table from one database to another
Hi, I need to create a exe, that will copy some columns from one table (present in DB1)  to another table (present in DB2). I need to do in C#. I got no idea from where to start. Can someone please help me out. Thanks in advance. I'm missing how this is Web related (Asp.Net)? Hi amp0201, You can execute this sql: SELECT * INTO TableTemp FROM Table http://www.sqlservercurry.com/2008/03/copy-table-from-one-database-to-another.html  Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they ...

Copying records from one database to another
I know I've seen this before, but can't seem to find it now that I need it. How can I use ISQL or Sybase Central to copy records from one database to another one. I accidentally deleted a bunch of records from my database, and want to re-insert the deleted records them from my backup copy, which I have started on my local computer. -- David Kerber An optimist says "Good morning, Lord." While a pessimist says "Good Lord, it's morning". Remove the ns_ from the address before e-mailing. In article <MPG.180cecffa8a66ce39896ae@forums.sybase...

Copying the permissions of one user to another
Hi, Is there a way to copy all the permissions of one user to another ? We tried to create groups, but with that, a user can only belong to one group (plus the public group) Thanks in advance. Gizem gizem wrote: > > Hi, > > Is there a way to copy all the permissions of one user to another ? > We tried to create groups, but with that, a user can only belong to one > group (plus the public group) > You might want to look into the user-defined roles feature introduced in ASE 11.5. These work very much like groups, but are much more flexible...

How to copy data from one database to another
I am using Interbase XE. I am trying to copy the data from the tables from Database1 to Database2. In IBConssole, the «Copy Data» option is not working certainly because the character set in Database1 is «NONE» and the one in Database2 is «UTF8». I tried to backup and restore but I realized that there' no option in IBConsole to backup and restore only the data (without the Metadata). Is it possible to use for example a SQL SELECT by specifying the origin and final Database? Which option can I use to copy the data from the tables from Database1 to ...

Copying data from one database to another
Hi! I'm looking for the way to copy data from one database to another. Both databases are SQL Anywhere. Destination database = source database + new tables + new columns. Destination database has different structure then the source one. It can have new tables, new columns. For copying data I must use RTDSK50.EXE (SQL Anywhere). Mechanism of copying data must be integrated with our program. When user upgrades our program (he does it by Internet) he also must upgrade database. We must copy his data to a new upgraded database. Joanna Have you looked at using a pipeline obj...

Copying users from another SQL database
I have DNN 2.x running with its database on the same SQL server that has another database which contains the names, username, password, e-mail information for about 400 users that I need to add to the DNN user table. I would like to automate adding all of these 400 users and giving them the same role. Is there a way to do this in a fairly straightforward way using SQL procedures, programs or scripts. I searched this form and found one example using a SQL stored procedure that I can probably adapt, if necessary. I am just wondering if anyone knows of other ways to accomplish this that...

Copy a table from a one database to another
Hi. I need to copy a table from one database to another with all the records the first has, but when I use the pipeline in the powerbuilder enviroment it only copy the table with no records. Is there any way to use the pipeline to append the records from a table that is in a diferent database. Any help would be apreciated. Hi, AFAIK, you can use the pipeline object to do this. One of the options of the pipeline object is 'Append'. HTH -- - Met vriendelijke groet, Eric Aling [TeamPS], Cypres Informatisering bv, The Netherlands http://ourworld.compuserve...

copying users from one server to another?
Howdy All! I've just moved one of our apps onto another server and I've run into difficulty transferring over login names and passwords. I've tried to bcp out/in from syslogins and sysloginroles but while I get the login names into the new server, no permissions follow them over? I've had to recreate the logins, passwords and groups by hand! There HAS to be a better way? Can anyone share it with me please? many thanks, Norm Well, probably your logins do have roles as well, so you need to bcp out/in syssrvroles and sysloginroles. Also check the master..s...

How to copy data from one database to another
Hi, I want to update the data from one sqlanywhere database to another sql anywhere database. I know we can do this in other databases like Oracle and Sybase. How I can do this in SQLANYWHERE version 5.5.04 build 1867. Any help would highly appreciated. Thanks You can use the OUTPUT and INPUT statements that are part of ISQL. For better raw performance you can use UNLOAD TABLE and LOAD TABLE which are server commands (sent to the server 'via' isql but there server does all the reading and writing). &q...

copying a table from one database to another
Hey in query analyzer, how do you copy a table form one db to another db i thort it was something like select * into dbo.databaseA.tableNew from dbo.databaseB.tableOld cheers  insert into databaseA..tableNew select * From databaseb..tableOld   The difference between SELECT INTO and INSERT INTO is that with INSERT the table must already exist. SELECT INTO creates a new table. Your original query looked okay, assuming that you wanted a new table tableNew. What error were you getting? You might also have a permissions problem since you are going from one database to a...

Web resources about - Copying Sybase users from one database to another - ASA7 WIN32 - sybase.sqlanywhere.general

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

Oracle: Fear Not, ’12c’ Database Nearing Its Breakout, Says Credit Suisse
... from cloud computing applications in 2016, along with the adoption by customers of the its “ 12c ” version of its flagship relational database ...

Enterprises want to run databases in containers
More than three out of four IT decision makers are interested in running stateful applications like databases within containers, according to ...

NFL mock draft database 2016: Tracking Giants picks from around the Internet
Let's keep track of mock drafts from around the Internet as the 2016 NFL Draft approaches. Can we find a consensus for the New York Giants?

Top US School District Switches to Rimini Street for Oracle Database and Oracle E-Business Suite Support ...
Douglas County School District using savings from Rimini Street independent support to develop district-wide data visualization capabilities ...

Consumer Group Sues DOT For Failure To Create Searchable Database Of Safety Defects
... about safety defects. One safety group says this hasn’t happened, and is suing DOT Secretary Anthony Foxx in an effort to make this database ...

TSA Will Finally Be Given Access To Counterterrorism Database To Screen Airport Workers
TSA Will Finally Be Given Access To Counterterrorism Database To Screen Airport Workers

Former Ohio cop uses cop database to stalk victim
... stalked her like an average person would, but stalked her in the way that only a police officer could: he stalked her utilizing a police database ...

U.S. Attorney Suggests Password Cardinals Used To Access Astros Scouting Database Was “Eckstein123"
... scouting director Christopher Correa plead guilty to five counts of unauthorized access to a computer for hacking the Houston Astros database. ...

Resources last updated: 2/23/2016 1:02:08 PM