Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Tuesday, March 27, 2012

copy DTS from a user to another

Hi,
I have some local packages that are owned by the old sqlserver dba.I'm not
able to see them, nor to save them with my user (i have granted the system
administrator role).
I want to see these packages and move them to a new user.
How can I do this?
Thanks in advance,If you are trying to change the owner of these packages, then you can use
the undocumented procedure, sp_reassign_dtspackageowner.
For details refer to: http://www.sqldts.com/?212
http://support.microsoft.com/?kbid=247052
Anith|||Hi,
I saved the DTS package as my user but I'm still not able to edit them.
Is it possible that there's a password?
Thanks,
Tarek
"Anith Sen" wrote:

> If you are trying to change the owner of these packages, then you can use
> the undocumented procedure, sp_reassign_dtspackageowner.
> For details refer to: http://www.sqldts.com/?212
> http://support.microsoft.com/?kbid=247052
> --
> Anith
>
>sqlsql

Monday, March 19, 2012

Copy Database into SQL Server 2000

I have a old dos base foxpro data. How can i move a copy of it into sql server 2000.I would use DTS because I helped a client with Foxpro recently and it uses few datatypes. Try the link below for sample DTS code. Hope this helps.
http://www.sqldts.com

Sunday, March 11, 2012

copy database error (finding folder, login timeout)

Hello, just got SQL Server 2005 installed on a new production box and am
trying desperately to get data to it from an old SQL2000 production box -
unfortunately for me each time i try to use the copy database tools in order
to copy the database i get to the step where i am to "configure the package"
and the following popup appears:
While trying to find a folder on SQL an OLE DB error was encountered with
error code 0x80004005 (Login timeout expired).
I'm using the credentials of users who have sysAdmin priviledges.
Obviously this is leading to much hair pulling, screaming and near laptop
hurling. Someone please tell me what i'm doing wrong!?Matt
Why not just RESTORE the 'old' database (SQL Server 2000) to SQL Server
2005?
"Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
news:OdKJlO5uGHA.4512@.TK2MSFTNGP05.phx.gbl...
> Hello, just got SQL Server 2005 installed on a new production box and am
> trying desperately to get data to it from an old SQL2000 production box -
> unfortunately for me each time i try to use the copy database tools in
> order to copy the database i get to the step where i am to "configure the
> package" and the following popup appears:
> While trying to find a folder on SQL an OLE DB error was encountered with
> error code 0x80004005 (Login timeout expired).
> I'm using the credentials of users who have sysAdmin priviledges.
> Obviously this is leading to much hair pulling, screaming and near laptop
> hurling. Someone please tell me what i'm doing wrong!?
>|||I unfortunately have no upload access to the box to get a backup onto it to
be able to restore an old DB
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OB$rmW5uGHA.4612@.TK2MSFTNGP02.phx.gbl...
> Matt
> Why not just RESTORE the 'old' database (SQL Server 2000) to SQL Server
> 2005?
>
> "Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
> news:OdKJlO5uGHA.4512@.TK2MSFTNGP05.phx.gbl...
>|||Matt
I understood you use SQL Server200 as you wrote, did not you?
What tool dp you use to transfer the data? SSIS,DTS?
"Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
news:u4riyy5uGHA.3552@.TK2MSFTNGP03.phx.gbl...[vbcol=seagreen]
>I unfortunately have no upload access to the box to get a backup onto it to
>be able to restore an old DB
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OB$rmW5uGHA.4612@.TK2MSFTNGP02.phx.gbl...
>|||I think that this "I unfortunately have no upload access to the box" is the
clue to the situation.
SQL Server 'should' have permissions to the file system on the local server.
This error "While trying to find a folder on SQL an OLE DB error was
encountered with error code 0x80004005 (Login timeout expired)." makes it
seem like a file system permission issue.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
news:u4riyy5uGHA.3552@.TK2MSFTNGP03.phx.gbl...
>I unfortunately have no upload access to the box to get a backup onto it to
>be able to restore an old DB
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OB$rmW5uGHA.4612@.TK2MSFTNGP02.phx.gbl...
>

copy database error (finding folder, login timeout)

Hello, just got SQL Server 2005 installed on a new production box and am
trying desperately to get data to it from an old SQL2000 production box -
unfortunately for me each time i try to use the copy database tools in order
to copy the database i get to the step where i am to "configure the package"
and the following popup appears:
While trying to find a folder on SQL an OLE DB error was encountered with
error code 0x80004005 (Login timeout expired).
I'm using the credentials of users who have sysAdmin priviledges.
Obviously this is leading to much hair pulling, screaming and near laptop
hurling. Someone please tell me what i'm doing wrong!?Matt
Why not just RESTORE the 'old' database (SQL Server 2000) to SQL Server
2005?
"Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
news:OdKJlO5uGHA.4512@.TK2MSFTNGP05.phx.gbl...
> Hello, just got SQL Server 2005 installed on a new production box and am
> trying desperately to get data to it from an old SQL2000 production box -
> unfortunately for me each time i try to use the copy database tools in
> order to copy the database i get to the step where i am to "configure the
> package" and the following popup appears:
> While trying to find a folder on SQL an OLE DB error was encountered with
> error code 0x80004005 (Login timeout expired).
> I'm using the credentials of users who have sysAdmin priviledges.
> Obviously this is leading to much hair pulling, screaming and near laptop
> hurling. Someone please tell me what i'm doing wrong!?
>|||I unfortunately have no upload access to the box to get a backup onto it to
be able to restore an old DB :(
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OB$rmW5uGHA.4612@.TK2MSFTNGP02.phx.gbl...
> Matt
> Why not just RESTORE the 'old' database (SQL Server 2000) to SQL Server
> 2005?
>
> "Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
> news:OdKJlO5uGHA.4512@.TK2MSFTNGP05.phx.gbl...
>> Hello, just got SQL Server 2005 installed on a new production box and am
>> trying desperately to get data to it from an old SQL2000 production box -
>> unfortunately for me each time i try to use the copy database tools in
>> order to copy the database i get to the step where i am to "configure the
>> package" and the following popup appears:
>> While trying to find a folder on SQL an OLE DB error was encountered with
>> error code 0x80004005 (Login timeout expired).
>> I'm using the credentials of users who have sysAdmin priviledges.
>> Obviously this is leading to much hair pulling, screaming and near laptop
>> hurling. Someone please tell me what i'm doing wrong!?
>>
>|||Matt
>> trying desperately to get data to it from an old SQL2000 production
>> box - unfortunately for me each time i try to use the copy database
>> tools in order to copy the database i get to the step where i am to
>> "configure the package" and the following popup appears:
I understood you use SQL Server200 as you wrote, did not you?
What tool dp you use to transfer the data? SSIS,DTS?
"Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
news:u4riyy5uGHA.3552@.TK2MSFTNGP03.phx.gbl...
>I unfortunately have no upload access to the box to get a backup onto it to
>be able to restore an old DB :(
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OB$rmW5uGHA.4612@.TK2MSFTNGP02.phx.gbl...
>> Matt
>> Why not just RESTORE the 'old' database (SQL Server 2000) to SQL Server
>> 2005?
>>
>> "Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
>> news:OdKJlO5uGHA.4512@.TK2MSFTNGP05.phx.gbl...
>> Hello, just got SQL Server 2005 installed on a new production box and am
>> trying desperately to get data to it from an old SQL2000 production
>> box - unfortunately for me each time i try to use the copy database
>> tools in order to copy the database i get to the step where i am to
>> "configure the package" and the following popup appears:
>> While trying to find a folder on SQL an OLE DB error was encountered
>> with error code 0x80004005 (Login timeout expired).
>> I'm using the credentials of users who have sysAdmin priviledges.
>> Obviously this is leading to much hair pulling, screaming and near
>> laptop hurling. Someone please tell me what i'm doing wrong!?
>>
>>
>|||I think that this "I unfortunately have no upload access to the box" is the
clue to the situation.
SQL Server 'should' have permissions to the file system on the local server.
This error "While trying to find a folder on SQL an OLE DB error was
encountered with error code 0x80004005 (Login timeout expired)." makes it
seem like a file system permission issue.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
news:u4riyy5uGHA.3552@.TK2MSFTNGP03.phx.gbl...
>I unfortunately have no upload access to the box to get a backup onto it to
>be able to restore an old DB :(
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OB$rmW5uGHA.4612@.TK2MSFTNGP02.phx.gbl...
>> Matt
>> Why not just RESTORE the 'old' database (SQL Server 2000) to SQL Server
>> 2005?
>>
>> "Matt Pallatt" <matt.pallatt@.cmwnorth.com> wrote in message
>> news:OdKJlO5uGHA.4512@.TK2MSFTNGP05.phx.gbl...
>> Hello, just got SQL Server 2005 installed on a new production box and am
>> trying desperately to get data to it from an old SQL2000 production
>> box - unfortunately for me each time i try to use the copy database
>> tools in order to copy the database i get to the step where i am to
>> "configure the package" and the following popup appears:
>> While trying to find a folder on SQL an OLE DB error was encountered
>> with error code 0x80004005 (Login timeout expired).
>> I'm using the credentials of users who have sysAdmin priviledges.
>> Obviously this is leading to much hair pulling, screaming and near
>> laptop hurling. Someone please tell me what i'm doing wrong!?
>>
>>
>

Thursday, March 8, 2012

Copy data from one MS SQL database to another

Hi
The old database layout is very slow on queries so I have created a new
layout and want to copy the data from the old database into the new layout.
How can this best be done?
Do I need an application do this or can it be done by the SQL Server running
a stored procedure located in one of the databases?
Can you give me an example of a script copying data from one table in one
database to a table in another database?
Most of the tables are the same as before but there is one table that have
been normalized. Text fields have been moved to their own tables and
referenced from the main table.
Thank You for your help.
Regards
Kjell Arne Johansenyou can simply use
Insert into database1.DBO.newtable
(Select * from database2.dbo.oldtable )
before this be sure that your Newtable is empty or does not contain
duplicated rows
hch
"Kjell Arne Johansen" wrote:

> Hi
> The old database layout is very slow on queries so I have created a new
> layout and want to copy the data from the old database into the new layout
.
> How can this best be done?
> Do I need an application do this or can it be done by the SQL Server runni
ng
> a stored procedure located in one of the databases?
> Can you give me an example of a script copying data from one table in one
> database to a table in another database?
> Most of the tables are the same as before but there is one table that have
> been normalized. Text fields have been moved to their own tables and
> referenced from the main table.
> Thank You for your help.
> Regards
> Kjell Arne Johansen
>
>|||Hello Kjell
To copy the data, probably the best thing to do is use Data Transformation
Services from within Enterprise Manager. Have you also considered adding
indexes to the old database instead of creating a new one. Also, is your
database setup to automatically update statistics? If the database has been
in use for a while, the statistics that the server uses for your database
may be out of date which may be causing the slow queries.
HTH
D.
"Kjell Arne Johansen" <kjellarj@.online.no> wrote in message
news:SXihe.10020$SL4.226519@.news4.e.nsc.no...
> Hi
> The old database layout is very slow on queries so I have created a new
> layout and want to copy the data from the old database into the new
> layout.
> How can this best be done?
> Do I need an application do this or can it be done by the SQL Server
> running a stored procedure located in one of the databases?
> Can you give me an example of a script copying data from one table in one
> database to a table in another database?
> Most of the tables are the same as before but there is one table that have
> been normalized. Text fields have been moved to their own tables and
> referenced from the main table.
> Thank You for your help.
> Regards
> Kjell Arne Johansen
>|||Hi
My company deliver process control systems and a part of this system is
logging of alarms and events to an SQL alarms and events database.
We have just moved from Access to SQL Server and may have some tuning and
architecture problems, I think..
There is one application writing to the database and several applications
that will read from the database.
Existing records in the database will not be edited but new one will be
added as soon there is a not normal situation in the process control.
The old database layout is not fully normalized. Many of the text fields
can be moved to their own tables.
I am experimenting with tables, relations and indexes in different new
layout to make the database so fast as possible both for writinig and
reading.
It is very important that the writer application always have access to the
database. The main table must not be locked for a longer time be the
readers.
Also the readers must have fast access to the data in the database even when
the main table grow to houndred millions of records.
To make the testing as complite as possible the database must be filled with
relevant data. I have got a database from one of our customers where the
main table has several million records with relevant data from their
process. I want to copy these data into a now layout and test reading and
writing.
The requrement is that it shall be possible to write bursts of data into the
database, up to 8000 records a minute.
This will not be the normal situation. In a good tuned process control
there will be less than one record each ten minute.
-But during configuration and equipment tuning there will be a lot of
situations that will cause an alarm or event.
I will try to write 2000 - 8000 alarms and events each minute to the
database, at same time as I am reading records from the database filtering
on different fields.
The repsons from the SQL Server shall be fast and the load on the SQL Server
shall not be high.
"Fast" and "High" is not fully defined yet. What is a fast respons, what
is high load on the SQL Server?
Typically I can say that the user will not want to wait for a respons for
more than 10 seconds.
The load on the SQL Server should not be so high that the writing
application does not get access to it.
I think normailizing the the database by putting fields that will have much
duplicated data into their own tables should be done.
The clustered primary key in the main table will be a combination of an auto
number desc, time desc, milliseconds desc, sequence desc, station desc.
I do not know about database statistics setup. Is this important?
Regards
Kjell Arne Johansen
"DJP" <djp@.snotmail.com> skrev i melding
news:pNkhe.2481$E7.1770@.news-server.bigpond.net.au...
> Hello Kjell
> To copy the data, probably the best thing to do is use Data Transformation
> Services from within Enterprise Manager. Have you also considered adding
> indexes to the old database instead of creating a new one. Also, is your
> database setup to automatically update statistics? If the database has
> been in use for a while, the statistics that the server uses for your
> database may be out of date which may be causing the slow queries.
> HTH
> D.
> "Kjell Arne Johansen" <kjellarj@.online.no> wrote in message
> news:SXihe.10020$SL4.226519@.news4.e.nsc.no...
>|||Sounds like you just need to hire a competent databasedesigner to work with
you for a few days to get the schema correct. What you are asking SQL
Server to do is quite reasonable and should not be a problem with proper
normalization and indexing. Your PK sounds a bit much. If you have an
autonumber then it should be unique on its own. And SQL Server only has a
Datetime datatype which includes values down to the millisecond so you don't
need several columns for this.
Andrew J. Kelly SQL MVP
"Kjell Arne Johansen" <kjellarj@.online.no> wrote in message
news:lllhe.9690$ai7.234663@.news2.e.nsc.no...
> Hi
> My company deliver process control systems and a part of this system is
> logging of alarms and events to an SQL alarms and events database.
> We have just moved from Access to SQL Server and may have some tuning and
> architecture problems, I think..
> There is one application writing to the database and several applications
> that will read from the database.
> Existing records in the database will not be edited but new one will be
> added as soon there is a not normal situation in the process control.
> The old database layout is not fully normalized. Many of the text fields
> can be moved to their own tables.
> I am experimenting with tables, relations and indexes in different new
> layout to make the database so fast as possible both for writinig and
> reading.
> It is very important that the writer application always have access to the
> database. The main table must not be locked for a longer time be the
> readers.
> Also the readers must have fast access to the data in the database even
> when the main table grow to houndred millions of records.
> To make the testing as complite as possible the database must be filled
> with relevant data. I have got a database from one of our customers where
> the main table has several million records with relevant data from their
> process. I want to copy these data into a now layout and test reading and
> writing.
> The requrement is that it shall be possible to write bursts of data into
> the database, up to 8000 records a minute.
> This will not be the normal situation. In a good tuned process control
> there will be less than one record each ten minute.
> -But during configuration and equipment tuning there will be a lot of
> situations that will cause an alarm or event.
> I will try to write 2000 - 8000 alarms and events each minute to the
> database, at same time as I am reading records from the database filtering
> on different fields.
> The repsons from the SQL Server shall be fast and the load on the SQL
> Server shall not be high.
> "Fast" and "High" is not fully defined yet. What is a fast respons, what
> is high load on the SQL Server?
> Typically I can say that the user will not want to wait for a respons for
> more than 10 seconds.
> The load on the SQL Server should not be so high that the writing
> application does not get access to it.
> I think normailizing the the database by putting fields that will have
> much duplicated data into their own tables should be done.
> The clustered primary key in the main table will be a combination of an
> auto number desc, time desc, milliseconds desc, sequence desc, station
> desc.
> I do not know about database statistics setup. Is this important?
> Regards
> Kjell Arne Johansen
>
> "DJP" <djp@.snotmail.com> skrev i melding
> news:pNkhe.2481$E7.1770@.news-server.bigpond.net.au...
>|||Hi
Yes, I know that the autonumber is unique. The millisecond field is also
microseconds from our process stations.
I need an index with the combination of time, and two other fields. An
Oracle database man in our company says I should make them clustered.
It looks like You can have only one clustered index in the table. Should
the PK be the clustered index or can I decide to use the combination of
fields as a clustered index?
I am concidering hiring a database expert haveing a look at our existing
layout.
Thank You.
Regards
Kjell Arne Johansen
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> skrev i melding
news:ODz6QoIWFHA.3840@.tk2msftngp13.phx.gbl...
> Sounds like you just need to hire a competent databasedesigner to work
> with you for a few days to get the schema correct. What you are asking
> SQL Server to do is quite reasonable and should not be a problem with
> proper normalization and indexing. Your PK sounds a bit much. If you
> have an autonumber then it should be unique on its own. And SQL Server
> only has a Datetime datatype which includes values down to the millisecond
> so you don't need several columns for this.
> --
> Andrew J. Kelly SQL MVP
>
> "Kjell Arne Johansen" <kjellarj@.online.no> wrote in message
> news:lllhe.9690$ai7.234663@.news2.e.nsc.no...
>|||Yes hiring someone who really knows what they are doing can save you a LOT
of time and aggravation down the road. As for which is the best to cluster
you really have to know how your data is used overall to properly determine
that.
Andrew J. Kelly SQL MVP
"Kjell Arne Johansen" <kjellarj@.online.no> wrote in message
news:A6phe.9699$ai7.233873@.news2.e.nsc.no...
> Hi
> Yes, I know that the autonumber is unique. The millisecond field is also
> microseconds from our process stations.
> I need an index with the combination of time, and two other fields. An
> Oracle database man in our company says I should make them clustered.
> It looks like You can have only one clustered index in the table. Should
> the PK be the clustered index or can I decide to use the combination of
> fields as a clustered index?
> I am concidering hiring a database expert haveing a look at our existing
> layout.
> Thank You.
>
> Regards
> Kjell Arne Johansen
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> skrev i melding
> news:ODz6QoIWFHA.3840@.tk2msftngp13.phx.gbl...
>|||Try www.sqlscripter.com to copy your data.
Thomas
"Kjell Arne Johansen" wrote:

> Hi
> The old database layout is very slow on queries so I have created a new
> layout and want to copy the data from the old database into the new layout
.
> How can this best be done?
> Do I need an application do this or can it be done by the SQL Server runni
ng
> a stored procedure located in one of the databases?
> Can you give me an example of a script copying data from one table in one
> database to a table in another database?
> Most of the tables are the same as before but there is one table that have
> been normalized. Text fields have been moved to their own tables and
> referenced from the main table.
> Thank You for your help.
> Regards
> Kjell Arne Johansen
>
>

Copy data and objects between SQL Servers

I have recently moved from a Microsoft SQL Server 2000 to a SQL Server
2005.

In the good old Enterprise Manager, when I imported a table from a SQL
server to another, I could choose "Copy objects and data between SQL
Server
databases". When choosen, all primary keys, and default values was
copied.

My question is:
Is it possible to do the same in Microsoft SQL Server Management Studio
with
SQL Server 2005? And how do I do it?

I have tried using the "SELECT * INTO NewTable FROM OldTable"
statement, but
it just drops all information about primary keys and default values.

Best Regards

The functionality you refer to is now part of SSIS (SQL Server Integration Services). You can access it from the Management Studio in a number of ways. The simplest is to right click on the database you want to import the data into, select all tasks, then select import data...

If you didn't install SSIS with the Database Engine, I'm not sure if you'll be able to access the import functionalty.

See this article on msdn for more info.

Sunday, February 12, 2012

converting SELECT output to string

I'm looking for some good hints and tips for reprogrammin an old VB module I just found.

Basically what it does, is receive an input parameter (an int), does a select [name row] from Names where Name_id = [input parameter] and turns this into a string if multiplenames appear.

E.g. result set: John, Josh, Jock turns it into string "John Josh Jock".

So its piece of cake creating a stored procedure selecting data on the base of an input parameter. Select X from Y where Z = @.input... the trick is, I don't know how to do arrays in TSQL as in VB.

In the VB edition I create an array, load the names into it, I do a count on how many row the select returns and then a simple for... next adding the names to the string.

Any good examples on how to do this in a sql-server stored proc?

Thanks,

Trin

P.S. This is what I have pieced together this far:

CREATE PROCEDURE findnames

@.number int

AS

DECLARE @.instrument varchar(50)
DECLARE @.tempinstt varchar(10)

DECLARE medlemcursor CURSOR
FOR
SELECT [MCPS Kode]
FROM DW.dbo.names(NOLOCK)
WHERE number = @.number

OPEN medlemcursor

FETCH NEXT FROM medlemcursor INTO @.tempinstt
WHILE (@.@.FETCH_STATUS <> -1)
BEGIN
SET @.instrument = @.instrument + @.tempinstt + '-'
FETCH NEXT FROM medlemcursor INTO @.tempinstt
END

CLOSE medlemcursor
DEALLOCATE medlemcursor

SELECT @.instrument
GO

Just doesn't seem to work, returns NULL, even though I've checked that the cursor SELECT statement actually returns data,--u have to intialize ur variable 'instrument' before appending other values.

CREATE PROCEDURE findnames

@.number int

AS

DECLARE @.instrument varchar(50)
DECLARE @.tempinstt varchar(10)
set instrument =''
DECLARE medlemcursor CURSOR
FOR
SELECT [MCPS Kode]
FROM DW.dbo.names(NOLOCK)
WHERE number = @.number

OPEN medlemcursor

FETCH NEXT FROM medlemcursor INTO @.tempinstt
WHILE (@.@.FETCH_STATUS <> -1)
BEGIN
SET @.instrument = @.instrument + @.tempinstt + '-'
FETCH NEXT FROM medlemcursor INTO @.tempinstt
END

CLOSE medlemcursor
DEALLOCATE medlemcursor

SELECT @.instrument
GO|||Yeap, got it... and I just added a small substring addendum to cut off the trailing dash.

Mind boggling NULLs are..

Is it possible to call such a procedure within a select statement?

E.g. SELECT number, (EXEC findsnames number), city FROM names|||Just dump your cursor:CREATE PROCEDURE findnames(@.number int)
AS

declare @.instrument varchar(500) --varchar(50) seemed awfully short...

SELECT coalesce(@.instrument + '-', '') + [MCPS Kode]
FROM DW.dbo.names(NOLOCK)
WHERE number = @.number

SELECT @.instrument
GO|||u cannot call procedure from select statement,
instead of procedure , create a function,call that function from select statment.

blindman,
Poster wants to append record into a string,and ur query will not do that job.
select @.instrument returns NULL.|||Corrected code:CREATE PROCEDURE findnames(@.number int)
AS

declare @.instrument varchar(500) --varchar(50) seemed awfully short...

SELECT @.instrument = coalesce(@.instrument + '-', '') + [MCPS Kode]
FROM DW.dbo.names(NOLOCK)
WHERE number = @.number

SELECT @.instrument
GO

Copy/paste this to try it out:create table #Names([MCPS Kode] varchar(50), number int)
insert into #Names([MCPS Kode], number)
select 'Joe', 1
UNION
select 'James', 1
UNION
select 'Frank', 2
UNION
select 'Janis', 1
UNION
select 'Freda', 2
UNION
select 'Jeff', 1
UNION
select 'Fred', 2
UNION
select 'Foster', 2
UNION
select 'Jodi', 1

---------------------
declare @.instrument varchar(500) --varchar(50) seemed awfully short...
declare @.number int
set @.number = 1

SELECT @.instrument = coalesce(@.instrument + '-', '') + [MCPS Kode]
FROM #names(NOLOCK)
WHERE number = @.number

SELECT @.instrument
---------------------

drop table #Names

Output:James-Janis-Jeff-Jodi-Joe

Yes, it can be converted into a function if the user wishes.

Friday, February 10, 2012

Converting old Reports to Crystal 10

Hi you all,

When I try to open some reports (that were created using Crystal 5) in Crystal 10 I get the following warning as a pop-up window:

THE DATABASE FILE "XXX" HAS CHANGED. PROCEEDING TO FIX UP THE REPORT

After that, the report brings wrong data (different from the data that was brought by the original report).

Is this error common ? Should I have to re-write the queries ?

Thanks
Herr BurnierHy,

Your database design has maybe changed ?
What's happen if you "Verify database" on cr10 ?
Try to verify to database location.|||I get the same message even when I run "Verify Database". Crystal 10 tells me that tables have changed and it will fix them up.

The message even says that it cannot find a certain table and asks me if they should remove it from the report...

I have confirmed the location of the database and these tables.

The reports do work OK though if I do not make any suggested changes to the tables.

Strange.|||I found the answer.

In version 10 I had to Set database Location and update the tables, even though the names and locations were exactly the same as in my 8.5 reports...

Now I can verify the database with no errors or problems!