Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Thursday, March 22, 2012

Copy Database Wizard on Vista x64 machine

I've got a new Vista x64 build with SQL2005 (+SP2) freshly installed. I'm
now trying to copy existing databased from other services but I can't get it
to work. I get the following error logged in the Event Viewer Application
Log:
"Log Name: Application
Source: Application Error
Date: 29/11/2007 16:16:56
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: mycomputer
Description:
The description for Event ID 1000 from source Application Error cannot be
found. Either the component that raises this event is not installed on your
local computer or the installation is corrupted. You can install or repair
the component on the local computer.
If the event originated on another computer, the display information had to
be saved with the event.
The following information was included with the event:
DTExec.exe
2005.90.3042.0
45cd7539
kernel32.dll
6.0.6000.16386
4549d328
e053534f
00000000000233ac
The substitution string for insert index (%1) could not be found"
I cant find anything online that enlightens me - I know that Vista needs SP
installed to work, so I've installed it:
@.@.Version=
Microsoft SQL Server 2005 - 9.00.3054.00 (X64)
Mar 23 2007 18:41:50
Copyright (c) 1988-2005 Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.0 (Build 6000: )
All the services are running under a domain user that has access to the
areas where the data is stored, both source and destination, so I'm hoping
it's not a permissions issue - if it is, I wouldnt know where to look.
I *could* copy a local database to the same server (renamed of course), so
it suggests that the server is largely OK - does this suggest it *is* a
permissions issue?
The domain user that the services are running under are not in the local
Administrators group, but they are in the
SQLServer2005MSSQLUser$MyComputer$MSSQLS
ERVER group - which I assume is the
group that was set up by the SQL Server Provisioning Tool for Vista.
This is a development machine so I frequently want to copy different
versions of different databases backwards and forwards.
Any suggestions? Any other Vista x64-ers out there?
Thanks in advance...
ChrisSQL Server uses Active Directory accounts and groups for its
permissions.
Active Directory accounts and groups are represented by GUIDs that are
unique to a particular Active Directory Domain which is run by a
Primary Domain Contoroller. If your new Vista machine is not part of
a network, or is on a different domain than the old one, then it
probably uses different GUIDs for the active directory accounts than
the source machine did. If you copied over the SQL Server database
using a backup, then you probably also copied all the old GUIDs for
the SQL Server accounts that point to the GUIDs on the old machine,
and not the ones on new machine.
This means that your SQL Server accounts are out of sync with active
directory. you may have to recreate your SQL Server accounts on the
new machine.
Permissions are assigned through SQL Server Management Studio in two
steps. First, you assign the active directory accounts that are
allowed to connect to a SQL Server instance. This is done by right
clicking the Logins folder under the Security folder of the SQL Server
instance the user is to connect to and selecting New Login.
Then, you assign what SQL Server instance users are allowed to connect
to a particular database within an instance. This is done by right
clicking the Security folder under the database you want to give
permission for and selecting New->user.
In both cases, an extensive permissions dialog will open. For the
Login folder, you only have to specify an active directory account.
For the Security folder, you have to click securables in the left
sidebar, add the entities you want to view (tables), and then set
select, reference, update, delete, and insert permissions. There are
more steps, but this should point you in the right direction.|||Andy, thanks for your reply...
"Andy" <anedza@.infotek-consulting.com> wrote in message
news:1ee305c9-338f-4a4f-9a42-198b42c597b5@.w40g2000hsb.googlegroups.com...
> If your new Vista machine is not part of
> a network, or is on a different domain than the old one,
>
My new machine is part of the same Domain and is recognised within Active
Directory.
> Permissions are assigned through SQL Server Management Studio in two
> steps. First, you assign the active directory accounts that are
> allowed to connect to a SQL Server instance. This is done by right
> clicking the Logins folder under the Security folder of the SQL Server
> instance the user is to connect to and selecting New Login.
Each human administrator is per of an SQL Admins group as are each of the
domain users that the different servers run under. On each server, the SQL
Admins group is added with a login and has sufficiend permissions (AFAIK).

> Then, you assign what SQL Server instance users are allowed to connect
> to a particular database within an instance. This is done by right
> clicking the Security folder under the database you want to give
> permission for and selecting New->user.
>
Done

> In both cases, an extensive permissions dialog will open. For the
> Login folder, you only have to specify an active directory account.
> For the Security folder, you have to click securables in the left
> sidebar, add the entities you want to view (tables), and then set
> select, reference, update, delete, and insert permissions. There are
> more steps, but this should point you in the right direction.
>
The login is set as a sysdamin so surely this shouldnt be necessary?
Somewhere in my tweaking, I've changed something. I *think* it's for the
better - I'm still getting errors but I'm getting further along.
I'm now getting Error 12550: Access to the path
'\\MyServer\MyShare\MyDB.mdf' is denied. The SQL Admins group has read/write
permissions to this area so I'm puzzled.
This is immediately followed by another Error 12550: Object reference not
set to an instance of an object. There are other errors further on, but I
think they are just as a consequence of these earlier errors.
I'm actually going to start copying backups because I need to crack on with
things, but I'm determined to get to the bottom of this. In my work, this
wizard is very useful so I'd rather not have to work around it.
Any further ideas?
Cheers
Chris

Copy Database Wizard on Vista x64 machine

I've got a new Vista x64 build with SQL2005 (+SP2) freshly installed. I'm
now trying to copy existing databased from other services but I can't get it
to work. I get the following error logged in the Event Viewer Application
Log:
"Log Name: Application
Source: Application Error
Date: 29/11/2007 16:16:56
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: mycomputer
Description:
The description for Event ID 1000 from source Application Error cannot be
found. Either the component that raises this event is not installed on your
local computer or the installation is corrupted. You can install or repair
the component on the local computer.
If the event originated on another computer, the display information had to
be saved with the event.
The following information was included with the event:
DTExec.exe
2005.90.3042.0
45cd7539
kernel32.dll
6.0.6000.16386
4549d328
e053534f
00000000000233ac
The substitution string for insert index (%1) could not be found"
I cant find anything online that enlightens me - I know that Vista needs SP
installed to work, so I've installed it:
@.@.Version= Microsoft SQL Server 2005 - 9.00.3054.00 (X64)
Mar 23 2007 18:41:50
Copyright (c) 1988-2005 Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.0 (Build 6000: )
All the services are running under a domain user that has access to the
areas where the data is stored, both source and destination, so I'm hoping
it's not a permissions issue - if it is, I wouldnt know where to look.
I *could* copy a local database to the same server (renamed of course), so
it suggests that the server is largely OK - does this suggest it *is* a
permissions issue?
The domain user that the services are running under are not in the local
Administrators group, but they are in the
SQLServer2005MSSQLUser$MyComputer$MSSQLSERVER group - which I assume is the
group that was set up by the SQL Server Provisioning Tool for Vista.
This is a development machine so I frequently want to copy different
versions of different databases backwards and forwards.
Any suggestions? Any other Vista x64-ers out there?
Thanks in advance...
ChrisSQL Server uses Active Directory accounts and groups for its
permissions.
Active Directory accounts and groups are represented by GUIDs that are
unique to a particular Active Directory Domain which is run by a
Primary Domain Contoroller. If your new Vista machine is not part of
a network, or is on a different domain than the old one, then it
probably uses different GUIDs for the active directory accounts than
the source machine did. If you copied over the SQL Server database
using a backup, then you probably also copied all the old GUIDs for
the SQL Server accounts that point to the GUIDs on the old machine,
and not the ones on new machine.
This means that your SQL Server accounts are out of sync with active
directory. you may have to recreate your SQL Server accounts on the
new machine.
Permissions are assigned through SQL Server Management Studio in two
steps. First, you assign the active directory accounts that are
allowed to connect to a SQL Server instance. This is done by right
clicking the Logins folder under the Security folder of the SQL Server
instance the user is to connect to and selecting New Login.
Then, you assign what SQL Server instance users are allowed to connect
to a particular database within an instance. This is done by right
clicking the Security folder under the database you want to give
permission for and selecting New->user.
In both cases, an extensive permissions dialog will open. For the
Login folder, you only have to specify an active directory account.
For the Security folder, you have to click securables in the left
sidebar, add the entities you want to view (tables), and then set
select, reference, update, delete, and insert permissions. There are
more steps, but this should point you in the right direction.|||Andy, thanks for your reply...
"Andy" <anedza@.infotek-consulting.com> wrote in message
news:1ee305c9-338f-4a4f-9a42-198b42c597b5@.w40g2000hsb.googlegroups.com...
> If your new Vista machine is not part of
> a network, or is on a different domain than the old one,
>
My new machine is part of the same Domain and is recognised within Active
Directory.
> Permissions are assigned through SQL Server Management Studio in two
> steps. First, you assign the active directory accounts that are
> allowed to connect to a SQL Server instance. This is done by right
> clicking the Logins folder under the Security folder of the SQL Server
> instance the user is to connect to and selecting New Login.
Each human administrator is per of an SQL Admins group as are each of the
domain users that the different servers run under. On each server, the SQL
Admins group is added with a login and has sufficiend permissions (AFAIK).
> Then, you assign what SQL Server instance users are allowed to connect
> to a particular database within an instance. This is done by right
> clicking the Security folder under the database you want to give
> permission for and selecting New->user.
>
Done
> In both cases, an extensive permissions dialog will open. For the
> Login folder, you only have to specify an active directory account.
> For the Security folder, you have to click securables in the left
> sidebar, add the entities you want to view (tables), and then set
> select, reference, update, delete, and insert permissions. There are
> more steps, but this should point you in the right direction.
>
The login is set as a sysdamin so surely this shouldnt be necessary?
Somewhere in my tweaking, I've changed something. I *think* it's for the
better - I'm still getting errors but I'm getting further along.
I'm now getting Error 12550: Access to the path
'\\MyServer\MyShare\MyDB.mdf' is denied. The SQL Admins group has read/write
permissions to this area so I'm puzzled.
This is immediately followed by another Error 12550: Object reference not
set to an instance of an object. There are other errors further on, but I
think they are just as a consequence of these earlier errors.
I'm actually going to start copying backups because I need to crack on with
things, but I'm determined to get to the bottom of this. In my work, this
wizard is very useful so I'd rather not have to work around it.
Any further ideas?
Cheers
Chrissqlsql

Thursday, March 8, 2012

copy data from one database to another

Hi,
In our build process (where SQLServer is used as an embedded database) we always
recreate the database from scratch. When the database is recreated, the script
also recreates some basic data from the script.
Some of the QA folks are having a problem with this. They are not willing to lose all
of their existing data when a new build is invoked. I am trying to come with a simple
solution.
1. thr EM user will rename current database they have.
ALTER DATABASE OldName
MODIFY NAME = NewName
2. the build process will recreate the new database.
3. Now I need a tool to copy data from the old database. Since both old and new database
will
be in the same instance, a simple INSERT INTO TABLE(col1,col2,col3) select
col1,col2,col3
from olddatabase:table will do. What the tool should do is to disregard any dropped
columns
from being copied and set any new columns added in the newdatabase to null.
To perform step 3 is there a tool already available. I have a vague idea on how to write a
stored procedure for this, but I would prefer a tool already existing. Why reinvent the
wheel?
TIA
I think the easiest way to go about this is to use DTS. You can create a DTS
script that will do a straight copy from one database to another, specifying
which columns to skip.
|||"mmm" <mmm@.discussions.microsoft.com> wrote

>I think the easiest way to go about this is to use DTS. You can create a DTS
> script that will do a straight copy from one database to another, specifying
> which columns to skip.
The columns to skip should be automatic. I don't want to be editing DTS every
time.
I am thinking of writing a stored procedure in master database
which will use the following logic.
1. It will loop around every table of the target database where the data will go to.
2. For each table it will find out the columns and build a string as follows
INSERT INTO TARGET_DB.TABLE(COL LIST) SELECT COL_LIST
FROM SOURCE_DB.TABLE
Next the problem to tackle is the order of table. While poplating the tables
in step (1), it should populate all those tables first which either have no child tables
or child tables. That is, the sequence of loading the tables should not violate
PKY and FKY relationship.
Anyone knows a way to query tables in a database in required order mentioned above.
TIA

copy data from one database to another

Hi,
In our build process (where SQLServer is used as an embedded database) we al
ways
recreate the database from scratch. When the database is recreated, the scri
pt
also recreates some basic data from the script.
Some of the QA folks are having a problem with this. They are not willing to
lose all
of their existing data when a new build is invoked. I am trying to come with
a simple
solution.
1. thr EM user will rename current database they have.
ALTER DATABASE OldName
MODIFY NAME = NewName
2. the build process will recreate the new database.
3. Now I need a tool to copy data from the old database. Since both old and
new database
will
be in the same instance, a simple INSERT INTO TABLE(col1,col2,col3) select
col1,col2,col3
from olddatabase:table will do. What the tool should do is to disregard any
dropped
columns
from being copied and set any new columns added in the newdatabase to null.
To perform step 3 is there a tool already available. I have a vague idea on
how to write a
stored procedure for this, but I would prefer a tool already existing. Why r
einvent the
wheel?
TIAI think the easiest way to go about this is to use DTS. You can create a DTS
script that will do a straight copy from one database to another, specifying
which columns to skip.|||"mmm" <mmm@.discussions.microsoft.com> wrote

>I think the easiest way to go about this is to use DTS. You can create a DT
S
> script that will do a straight copy from one database to another, specifyi
ng
> which columns to skip.
The columns to skip should be automatic. I don't want to be editing DTS ever
y
time.
I am thinking of writing a stored procedure in master database
which will use the following logic.
1. It will loop around every table of the target database where the data wil
l go to.
2. For each table it will find out the columns and build a string as follows
INSERT INTO TARGET_DB.TABLE(COL LIST) SELECT COL_LIST
FROM SOURCE_DB.TABLE
Next the problem to tackle is the order of table. While poplating the tables
in step (1), it should populate all those tables first which either have no
child tables
or child tables. That is, the sequence of loading the tables should not viol
ate
PKY and FKY relationship.
Anyone knows a way to query tables in a database in required order mentioned
above.
TIA

copy data from one database to another

Hi,
In our build process (where SQLServer is used as an embedded database) we always
recreate the database from scratch. When the database is recreated, the script
also recreates some basic data from the script.
Some of the QA folks are having a problem with this. They are not willing to lose all
of their existing data when a new build is invoked. I am trying to come with a simple
solution.
1. thr EM user will rename current database they have.
ALTER DATABASE OldName
MODIFY NAME = NewName
2. the build process will recreate the new database.
3. Now I need a tool to copy data from the old database. Since both old and new database
will
be in the same instance, a simple INSERT INTO TABLE(col1,col2,col3) select
col1,col2,col3
from olddatabase:table will do. What the tool should do is to disregard any dropped
columns
from being copied and set any new columns added in the newdatabase to null.
To perform step 3 is there a tool already available. I have a vague idea on how to write a
stored procedure for this, but I would prefer a tool already existing. Why reinvent the
wheel?
TIAI think the easiest way to go about this is to use DTS. You can create a DTS
script that will do a straight copy from one database to another, specifying
which columns to skip.|||"mmm" <mmm@.discussions.microsoft.com> wrote
>I think the easiest way to go about this is to use DTS. You can create a DTS
> script that will do a straight copy from one database to another, specifying
> which columns to skip.
The columns to skip should be automatic. I don't want to be editing DTS every
time.
I am thinking of writing a stored procedure in master database
which will use the following logic.
1. It will loop around every table of the target database where the data will go to.
2. For each table it will find out the columns and build a string as follows
INSERT INTO TARGET_DB.TABLE(COL LIST) SELECT COL_LIST
FROM SOURCE_DB.TABLE
Next the problem to tackle is the order of table. While poplating the tables
in step (1), it should populate all those tables first which either have no child tables
or child tables. That is, the sequence of loading the tables should not violate
PKY and FKY relationship.
Anyone knows a way to query tables in a database in required order mentioned above.
TIA