Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts

Thursday, March 29, 2012

duplicate the SQL login

I have some sql login but I have forgotten the password. I can't modify the password anyway. Is there anyway to copy the login to a new login so that I can use the new login to access the database which it is granted to?

i am not sure i got the problem correctly ........ but anyhow you can not have duplicate login... but what u can do is you can create script of the existing login and then change only the name and password ... keep all other setting... this is as good as cloning of this login...

BTW ... why you can not change the password

Madhu

Thursday, March 22, 2012

duplicate database

Is there a way to copy/duplicate and rename a database on the same server? I
need to make a copy for another application. I appreciate any tips or advice
you can provide!

TIA - RobYou can do this by either detaching, renaming & attaching the database files
with a different name or you can backup the database & restore it as a
different name. For smaller databases, you can even do the Copy database
wizard which can create a copy of the database with a different name.

Please refer to SQL Server Books Online for details on any of these
approaches and check the following MSKB links :
http://support.microsoft.com/default.aspx?kbid=314546
http://support.microsoft.com/defaul...scid=kb;q224071

--
- Anith
( Please reply to newsgroups only )|||Thanks for the reply! I can copy with a number of methods but I always loose
the database rules when I copy or import data (i.e. primary keys, identity,
default values, etc.). Any ideas or tips to keep the database and rules
intact?

TIA - Rob

"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:iy9Yb.7035$hm4.4664@.newsread3.news.atl.earthl ink.net...
> You can do this by either detaching, renaming & attaching the database
files
> with a different name or you can backup the database & restore it as a
> different name. For smaller databases, you can even do the Copy database
> wizard which can create a copy of the database with a different name.
> Please refer to SQL Server Books Online for details on any of these
> approaches and check the following MSKB links :
> http://support.microsoft.com/default.aspx?kbid=314546
> http://support.microsoft.com/defaul...scid=kb;q224071
> --
> - Anith
> ( Please reply to newsgroups only )|||"Rob Wahmann" <rob@.dotcomstudio.biz> wrote in message news:<H0gYb.8966$PY.8805@.newssvr26.news.prodigy.com>...
> Thanks for the reply! I can copy with a number of methods but I always loose
> the database rules when I copy or import data (i.e. primary keys, identity,
> default values, etc.). Any ideas or tips to keep the database and rules
> intact?
> TIA - Rob
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:iy9Yb.7035$hm4.4664@.newsread3.news.atl.earthl ink.net...
> > You can do this by either detaching, renaming & attaching the database
> files
> > with a different name or you can backup the database & restore it as a
> > different name. For smaller databases, you can even do the Copy database
> > wizard which can create a copy of the database with a different name.
> > Please refer to SQL Server Books Online for details on any of these
> > approaches and check the following MSKB links :
> > http://support.microsoft.com/default.aspx?kbid=314546
> > http://support.microsoft.com/defaul...scid=kb;q224071
> > --
> > - Anith
> > ( Please reply to newsgroups only )

You shouldn't lose anything if you use backup/restore or
detach/attach, as they don't make any changes within the database.
Backup/restore has the advantage that the source database is always
online during the process.

Simon

Duplicate an existing SQL Login Account

How does one create a copy of an existing SQL login account. I have a
database that has a single login with everything setup. I just want to be
able to copy/duplicate the existing account to a new user so I can set a
different
password.
Thanks!You might be able to get what you want by "Generating SQL Script" from
the right-click context menu on the database you want to add the user
to. Place the checkmarks on the first tab to create all types of
objects, uncheck the options to create the CREATE and DROP statements on
the second tab, and go to the 3rd tab and check "Script object-level
permissions".
When you build the script, it should include commands that grant the
permissions to the current account that holds the permissions. You will
have to manually pick through the script commands to find the
appropriate ones and change the name of the user to replace the old
user's username with the new one to build an entirely new script.
While not the answer you're looking for, I think you should consider
creating one or more roles configured to grant permissions that match
the account that is configured properly now, then create the new account
and add the both user accounts to the role you created.
Good luck,
Tony Sebion
"John Williams" <JohnWilliams@.discussions.microsoft.com> wrote in
message news:F0AEB5FA-2AFD-4785-9217-184B22E3CFE0@.microsoft.com:

> How does one create a copy of an existing SQL login account. I have a
> database that has a single login with everything setup. I just want to be
> able to copy/duplicate the existing account to a new user so I can set a
> different
> password.
> Thanks!|||Scripting it out will work, the only downside would be remebering to
propogate all changes from user to user as things change. And things
always do change...
I'd recommend setting the permissions that are on user account to a
role instead. Then you can assign the role to the users that need
those permissions.
If needed you can deny access to objects on a user by user basis if
necessary or create another role that has those denied permissions and
assign that to the users.
HTH
Jason Strate

Duplicate an existing SQL Login Account

How does one create a copy of an existing SQL login account. I have a
database that has a single login with everything setup. I just want to be
able to copy/duplicate the existing account to a new user so I can set a
different
password.
Thanks!
You might be able to get what you want by "Generating SQL Script" from
the right-click context menu on the database you want to add the user
to. Place the checkmarks on the first tab to create all types of
objects, uncheck the options to create the CREATE and DROP statements on
the second tab, and go to the 3rd tab and check "Script object-level
permissions".
When you build the script, it should include commands that grant the
permissions to the current account that holds the permissions. You will
have to manually pick through the script commands to find the
appropriate ones and change the name of the user to replace the old
user's username with the new one to build an entirely new script.
While not the answer you're looking for, I think you should consider
creating one or more roles configured to grant permissions that match
the account that is configured properly now, then create the new account
and add the both user accounts to the role you created.
Good luck,
Tony Sebion
"John Williams" <JohnWilliams@.discussions.microsoft.com> wrote in
message news:F0AEB5FA-2AFD-4785-9217-184B22E3CFE0@.microsoft.com:

> How does one create a copy of an existing SQL login account. I have a
> database that has a single login with everything setup. I just want to be
> able to copy/duplicate the existing account to a new user so I can set a
> different
> password.
> Thanks!
|||Scripting it out will work, the only downside would be remebering to
propogate all changes from user to user as things change. And things
always do change...
I'd recommend setting the permissions that are on user account to a
role instead. Then you can assign the role to the users that need
those permissions.
If needed you can deny access to objects on a user by user basis if
necessary or create another role that has those denied permissions and
assign that to the users.
HTH
Jason Strate

Duplicate an existing SQL Login Account

How does one create a copy of an existing SQL login account. I have a
database that has a single login with everything setup. I just want to be
able to copy/duplicate the existing account to a new user so I can set a
different
password.
Thanks!You might be able to get what you want by "Generating SQL Script" from
the right-click context menu on the database you want to add the user
to. Place the checkmarks on the first tab to create all types of
objects, uncheck the options to create the CREATE and DROP statements on
the second tab, and go to the 3rd tab and check "Script object-level
permissions".
When you build the script, it should include commands that grant the
permissions to the current account that holds the permissions. You will
have to manually pick through the script commands to find the
appropriate ones and change the name of the user to replace the old
user's username with the new one to build an entirely new script.
While not the answer you're looking for, I think you should consider
creating one or more roles configured to grant permissions that match
the account that is configured properly now, then create the new account
and add the both user accounts to the role you created.
Good luck,
Tony Sebion
"John Williams" <JohnWilliams@.discussions.microsoft.com> wrote in
message news:F0AEB5FA-2AFD-4785-9217-184B22E3CFE0@.microsoft.com:
> How does one create a copy of an existing SQL login account. I have a
> database that has a single login with everything setup. I just want to be
> able to copy/duplicate the existing account to a new user so I can set a
> different
> password.
> Thanks!|||Scripting it out will work, the only downside would be remebering to
propogate all changes from user to user as things change. And things
always do change...
I'd recommend setting the permissions that are on user account to a
role instead. Then you can assign the role to the users that need
those permissions.
If needed you can deny access to objects on a user by user basis if
necessary or create another role that has those denied permissions and
assign that to the users.
HTH
Jason Strate

Duplicate an existig SQL user login account

How does one create a copy of an existing SQL login account. I have a
database that has a single login with everything setup. I just want to be
able to copy the existing account to a new user so I can set a different
password.
Thanks!You might be able to get what you want by "Generating SQL Script" from
the right-click context menu on the database you want to add the user
to. Place the checkmarks on the first tab to create all types of
objects, uncheck the options to create the CREATE and DROP statements on
the second tab, and go to the 3rd tab and check "Script object-level
permissions".
When you build the script, it should include commands that grant the
permissions to the current account that holds the permissions. You will
have to manually pick through the script commands to find the
appropriate ones and change the name of the user to replace the old
user's username with the new one to build an entirely new script.
While not the answer you're looking for, I think you should consider
creating one or more roles configured to grant permissions that match
the account that is configured properly now, then create the new account
and add the both user accounts to the role you created.
Good luck,
Tony Sebion
"John Williams" <JohnWilliams@.discussions.microsoft.com> wrote in
message news:5EA1D83E-15E9-44B9-9707-C4AAB5C9CDB6@.microsoft.com:

> How does one create a copy of an existing SQL login account. I have a
> database that has a single login with everything setup. I just want to be
> able to copy the existing account to a new user so I can set a different
> password.
> Thanks!sql

Wednesday, March 7, 2012

DTSWizard and identity columns

I have used the dtswizard which comes with sql server 2005 to create a copy of my db. The problem is, that the dtswizard doesn't set identity columns and primary keys on the db-copy. This causes a lot of errors since there are no primary keys and identity columns. How do I copy these settings when using DTSwizard?

thanks,
Thomas

I don't believe you can copy the constraints and keys with the DTSWizard.

However, the Copy Database function copies the keys and constraints.

Using SSMS, in the Object Explorer pane, on the Database you wish to copy, right-click, and select [Tasks...], then [Copy Database...]

|||I cannot find the Copy Database function. Maybe it is because my DB is on a shared hosting solution. I am not sure, I have the rights to do it?

Is there another way in which I can do a complete copy of the DB?

|||

If I had known that first...

For shared hosting situations, the SQL Server team has created a special utilitiy (Database Publishing Wizard) to create a script of the database so that you can copy the script up to the host and execute the script on the remote server, making a duplicate of the database. The Wizard also allows updating specific tables, or data within the tables.

Download your copy here:

Database Publishing Wizard
http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

|||Thanks alot. That was exactly what I needed

Sunday, February 26, 2012

DTSRun Fails while executing from COM

Hi,
i wrote a VB function that runs DTS by DTSRUN command, its working fine but when i copy the same code in COM and run it from ASP page and VB it fails to execute.

Function ExeDTSRun(DTSName, mKey As String)
Dim mDTS, spServerName, spUid, spPwd As String

spUid = "sa"
spPwd = "test"
spServerName = "server"


mDTS = "DTSRun /S " & spServerName & " /U " & spUid & " /P " & spPwd & " /N " & DTSName & " /G " & mKey & " /W ""0"""
Shell mDTS, vbNormalFocus
ExeDTSRun = "Successfully Run DTS : " & DTSName
End Function

Regards
AdiDo you get an error?|||First guess: Does the account running the IIS thread have permission (NT permission) to execute DTSRUN.EXE. Also, if the DTS package is accessing resources other than on the local machine, you will need to grant permission for that as well.

Friday, February 24, 2012

DTS: import large database

Importing data from an Access database, I cannot overcome the limit of 1,000 records.
In DTS, I "copy one or more tables", select tables, run, and cannot see my 1,052 entries.
Where can I set a max size of ~1,500 in my sql target base?There's a limit on what you can copy? By default, I have been able to transfer (even from Access) more than 100,000 records at a time. Heck, from other db's, I have been able to transfer MILLIONS of records by default.

A quick workaround would be to do an export to text (preferrably .csv) and import that into SQL. You can even do that through SQL, I think, by selecting your source as Access and your target as Text file through DTS.

Friday, February 17, 2012

DTS with ActiveX script schedule problem

Hello gang, can someone help me with a problem?
I have a DTS package that uses ActiveX script to copy and rename files. I
can run this DTS package manually and the files are renamed and copied.
However, if I schedule this package with a job, the job runs successfully bu
t
the files are not copied and renamed. I have logged both the DTS activity
and Job activity and everything appears successful but no files are written.
Has anyone ran into this same problem.
These are the items I have thouroughly checked out:
The paths are correct (because the DTS package works)
The owner of the DTS has privleges to write(because the DTS package works)
The Owner of the Job has privileges to write(because the log activity shows
the steps in the DTS running)
Thanks for your help in advance.
Thanks Kllyj64BTW. Both the Job and the DTS package are running on the actual server, so
I
am not having a problem about "where I am executing the objects."
--
Thanks Kllyj64
"kllyj64" wrote:

> Hello gang, can someone help me with a problem?
> I have a DTS package that uses ActiveX script to copy and rename files. I
> can run this DTS package manually and the files are renamed and copied.
> However, if I schedule this package with a job, the job runs successfully
but
> the files are not copied and renamed. I have logged both the DTS activity
> and Job activity and everything appears successful but no files are writte
n.
> Has anyone ran into this same problem.
> These are the items I have thouroughly checked out:
> The paths are correct (because the DTS package works)
> The owner of the DTS has privleges to write(because the DTS package works)
> The Owner of the Job has privileges to write(because the log activity show
s
> the steps in the DTS running)
> Thanks for your help in advance.
>
> --
> Thanks Kllyj64|||I found the problem, SQL jobs runs under NT and does not recognize mapped
drives. I changed the DTS ActiveX scripts to use UNC drives and the job
worked. I should have looked further before posting.
--
Thanks Kllyj64
"kllyj64" wrote:
[vbcol=seagreen]
> BTW. Both the Job and the DTS package are running on the actual server, s
o I
> am not having a problem about "where I am executing the objects."
> --
> Thanks Kllyj64
>
> "kllyj64" wrote:
>

DTS with ActiveX script schedule problem

Hello gang, can someone help me with a problem?
I have a DTS package that uses ActiveX script to copy and rename files. I
can run this DTS package manually and the files are renamed and copied.
However, if I schedule this package with a job, the job runs successfully but
the files are not copied and renamed. I have logged both the DTS activity
and Job activity and everything appears successful but no files are written.
Has anyone ran into this same problem.
These are the items I have thouroughly checked out:
The paths are correct (because the DTS package works)
The owner of the DTS has privleges to write(because the DTS package works)
The Owner of the Job has privileges to write(because the log activity shows
the steps in the DTS running)
Thanks for your help in advance.
--
Thanks Kllyj64BTW. Both the Job and the DTS package are running on the actual server, so I
am not having a problem about "where I am executing the objects."
--
Thanks Kllyj64
"kllyj64" wrote:
> Hello gang, can someone help me with a problem?
> I have a DTS package that uses ActiveX script to copy and rename files. I
> can run this DTS package manually and the files are renamed and copied.
> However, if I schedule this package with a job, the job runs successfully but
> the files are not copied and renamed. I have logged both the DTS activity
> and Job activity and everything appears successful but no files are written.
> Has anyone ran into this same problem.
> These are the items I have thouroughly checked out:
> The paths are correct (because the DTS package works)
> The owner of the DTS has privleges to write(because the DTS package works)
> The Owner of the Job has privileges to write(because the log activity shows
> the steps in the DTS running)
> Thanks for your help in advance.
>
> --
> Thanks Kllyj64|||I found the problem, SQL jobs runs under NT and does not recognize mapped
drives. I changed the DTS ActiveX scripts to use UNC drives and the job
worked. I should have looked further before posting.
--
Thanks Kllyj64
"kllyj64" wrote:
> BTW. Both the Job and the DTS package are running on the actual server, so I
> am not having a problem about "where I am executing the objects."
> --
> Thanks Kllyj64
>
> "kllyj64" wrote:
> > Hello gang, can someone help me with a problem?
> >
> > I have a DTS package that uses ActiveX script to copy and rename files. I
> > can run this DTS package manually and the files are renamed and copied.
> > However, if I schedule this package with a job, the job runs successfully but
> > the files are not copied and renamed. I have logged both the DTS activity
> > and Job activity and everything appears successful but no files are written.
> > Has anyone ran into this same problem.
> >
> > These are the items I have thouroughly checked out:
> > The paths are correct (because the DTS package works)
> > The owner of the DTS has privleges to write(because the DTS package works)
> > The Owner of the Job has privileges to write(because the log activity shows
> > the steps in the DTS running)
> >
> > Thanks for your help in advance.
> >
> >
> > --
> > Thanks Kllyj64

Wednesday, February 15, 2012

dts to copy jobs

We are upgrading our SQL 2000 Enterprise Server to a new server running the
same. When using DTS to transfer the jobs from old server to new 4 of them
will not transfer over to the new server. It just gives a unspecified error.
Any ideas?
You can generate a script for the jobs instead, through Enterprise Manager
(right click a job name, and it is under Tasks). Just run the generated
script on the target server.
Andy Price,
Sr. Database Administrator,
MCDBA 2003
"Tom Reis" wrote:

> We are upgrading our SQL 2000 Enterprise Server to a new server running the
> same. When using DTS to transfer the jobs from old server to new 4 of them
> will not transfer over to the new server. It just gives a unspecified error.
> Any ideas?
>
>

dts to copy jobs

We are upgrading our SQL 2000 Enterprise Server to a new server running the
same. When using DTS to transfer the jobs from old server to new 4 of them
will not transfer over to the new server. It just gives a unspecified error.
Any ideas?You can generate a script for the jobs instead, through Enterprise Manager
(right click a job name, and it is under Tasks). Just run the generated
script on the target server.
Andy Price,
Sr. Database Administrator,
MCDBA 2003
"Tom Reis" wrote:

> We are upgrading our SQL 2000 Enterprise Server to a new server running th
e
> same. When using DTS to transfer the jobs from old server to new 4 of them
> will not transfer over to the new server. It just gives a unspecified erro
r.
> Any ideas?
>
>

dts to copy jobs

We are upgrading our SQL 2000 Enterprise Server to a new server running the
same. When using DTS to transfer the jobs from old server to new 4 of them
will not transfer over to the new server. It just gives a unspecified error.
Any ideas?You can generate a script for the jobs instead, through Enterprise Manager
(right click a job name, and it is under Tasks). Just run the generated
script on the target server.
Andy Price,
Sr. Database Administrator,
MCDBA 2003
"Tom Reis" wrote:
> We are upgrading our SQL 2000 Enterprise Server to a new server running the
> same. When using DTS to transfer the jobs from old server to new 4 of them
> will not transfer over to the new server. It just gives a unspecified error.
> Any ideas?
>
>

DTS to Access mdb - updates only

Is there a way to flow updates only to an Access mdb from SQL DTS. We have
a sql table that is a copy of an Access table, all adds/updates/deletes are
made to the sql table and replicated to the Access table. The problem is
the only options for replicating the data to the Access table are a.)Append
or b.) Full Table Delete then Insert. Append is out because we would get
duplicates, Full Table Delete/Insert works but this means for several
seconds we have an empty Access table (problem because many apps are reading
from the Access table 24/7). Is there a way to create a DTS job (or some
other strategy) to perform updates to an Access table in addition to inserts
and individual deletes. My goal is also avoid writing a full blown
sql/Access replication program.
Thanks,
JimHi
You may want to look at SQL Servers own replication options.
If your access database was a linked server your could write a T-SQL query
to insert only the rows that did not exist already in the table.
e.g.
INSERT INTO linkedsvr...accesstbl ( pkcol, col1, col2 )
SELECT pkcol, col1, col2 FROM SQLServerTable s
WHERE NOT EXISTS ( SELECT * FROM linkedsvr...accesstbl a WHERE a.pkcol =
s.pkcol )
John
"Jims" wrote:

> Is there a way to flow updates only to an Access mdb from SQL DTS. We hav
e
> a sql table that is a copy of an Access table, all adds/updates/deletes ar
e
> made to the sql table and replicated to the Access table. The problem is
> the only options for replicating the data to the Access table are a.)Appen
d
> or b.) Full Table Delete then Insert. Append is out because we would get
> duplicates, Full Table Delete/Insert works but this means for several
> seconds we have an empty Access table (problem because many apps are readi
ng
> from the Access table 24/7). Is there a way to create a DTS job (or some
> other strategy) to perform updates to an Access table in addition to inser
ts
> and individual deletes. My goal is also avoid writing a full blown
> sql/Access replication program.
> Thanks,
> Jim
>
>|||John - it was my understanding that linked access databases were read-only.
Have you heard different?
Thanks,
Jim
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:2FC8D1AB-6784-455B-98F6-2231C2357228@.microsoft.com...
> Hi
> You may want to look at SQL Servers own replication options.
> If your access database was a linked server your could write a T-SQL query
> to insert only the rows that did not exist already in the table.
> e.g.
> INSERT INTO linkedsvr...accesstbl ( pkcol, col1, col2 )
> SELECT pkcol, col1, col2 FROM SQLServerTable s
> WHERE NOT EXISTS ( SELECT * FROM linkedsvr...accesstbl a WHERE a.pkcol =
> s.pkcol )
> John
> "Jims" wrote:
>|||Hi
The easiest way to check this out is to create yourself a test linked
server. I have certainly managed to insert/update data in a linked access
database. It could be that you have not set up permissions correctly . See
example B in the "sp_addlinkedserver" topic in books online on how to create
a linked access server.
John
"Jims" wrote:

> John - it was my understanding that linked access databases were read-only
.
> Have you heard different?
> Thanks,
> Jim
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:2FC8D1AB-6784-455B-98F6-2231C2357228@.microsoft.com...
>
>|||This is definitely possible.
There are a series of permissions that need to be set in order to do this.
RSH
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:ABFC3E5D-2C84-471A-BB5F-622A540ED955@.microsoft.com...
> Hi
> The easiest way to check this out is to create yourself a test linked
> server. I have certainly managed to insert/update data in a linked access
> database. It could be that you have not set up permissions correctly . See
> example B in the "sp_addlinkedserver" topic in books online on how to
> create
> a linked access server.
> John
> "Jims" wrote:
>