Showing posts with label carry. Show all posts
Showing posts with label carry. Show all posts

Thursday, March 8, 2012

carrying values from a subreport to a main report

How can I carry a value over from a subreport to a main report?

If I have a total in a sub report, I want to use that total in expression on the main report.

Any ideas?

You can't. You can only pass parameters from the main report to the subreport.|||IS there any way around this? some other method perhaps?|||

Here is something you can try. Create a NET assembly referenced by both reports (master and subreport). In the assembly, define a static collection to store values on per user and report basis (so users can't overwrite each other values), e.g. collection key consists of the user name (User!UserID) and report name (Globals!ReportName(. Next, try adding/changing values from the subreport and see if the master can get them. SSRS 2005 changed the order in which expressions are evaluated so I don't know what will happen but you asked for another way...

If you decide to try this, please share the results here.

carrying values from a subreport to a main report

How can I carry a value over from a subreport to a main report?

If I have a total in a sub report, I want to use that total in expression on the main report.

Any ideas?

You can't. You can only pass parameters from the main report to the subreport.|||IS there any way around this? some other method perhaps?|||

Here is something you can try. Create a NET assembly referenced by both reports (master and subreport). In the assembly, define a static collection to store values on per user and report basis (so users can't overwrite each other values), e.g. collection key consists of the user name (User!UserID) and report name (Globals!ReportName(. Next, try adding/changing values from the subreport and see if the master can get them. SSRS 2005 changed the order in which expressions are evaluated so I don't know what will happen but you asked for another way...

If you decide to try this, please share the results here.

carry over values to next page

hi, all.
is it possible to carry-over a subtotal of a page to the page header of the
next page?
we use ssrs 2005.
thx,
Carstenhi, all.
no idea? am i the one and only who needs a carry-forward value?
pls help.

Wednesday, March 7, 2012

Carry Over Hours Monthend

I was wondering if anyone knew if this was possible in T-SQL. I need to
calculate the total number of hours carried over from a previous month,
based on a 6 hours per day rate. Some examples,
Job has 12 hours total and starts on 2/28/2005 it would carry over 6 hours
into March.
Job has 5 hours total and starts on 2/28/2005 it would carry over 0 hours in
March.
Job has 30 hours total and starts on 2/25/2005 it would carry over 18 hours
(30-12).
Note that I have to ignore wends as they are not work days. Thanks.
Davidhttp://www.aspfaq.com/etiquette.asp?id=5006
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:%23TzCw%23ZHFHA.1096@.tk2msftngp13.phx.gbl...
>I was wondering if anyone knew if this was possible in T-SQL. I need to
>calculate the total number of hours carried over from a previous month,
>based on a 6 hours per day rate. Some examples,
> Job has 12 hours total and starts on 2/28/2005 it would carry over 6 hours
> into March.
> Job has 5 hours total and starts on 2/28/2005 it would carry over 0 hours
> in March.
> Job has 30 hours total and starts on 2/25/2005 it would carry over 18
> hours (30-12).
> Note that I have to ignore wends as they are not work days. Thanks.
> David
>|||Roji,
Your link took me to a DDL example. Are you sure that is correct?
David
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||David,
What Roji is trying to tell you is to post some DDL, sample data and
expected result if you need help with this problem.
AMB
"David" wrote:

> Roji,
> Your link took me to a DDL example. Are you sure that is correct?
> David
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>|||Below is what I have done so far:
SELECT dbo.RepairOrder.RecordID, dbo.vw_LaborTotalsAll.TotalHours,
dbo.RepairOrder.RepairStartDate,
dbo.RepairOrder.RepairCompleteDate
FROM dbo.RepairOrder INNER JOIN
dbo.vw_LaborTotalsAll ON dbo.RepairOrder.RecordID
= dbo.vw_LaborTotalsAll.RecordID
WHERE (dbo.RepairOrder.RepairStartDate > CONVERT(DATETIME,
'2005-02-01 00:00:00', 102)) AND (dbo.RepairOrder.RepairCompleteDate IS
NULL) AND
(dbo.RepairOrder.RepairStartDate <
CONVERT(DATETIME, '2005-03-01 00:00:00', 102))
I assume I need something else in WHERE clause as I only need to get
back records that have more hours left than 6 x the number of work days
left in the month.
David
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

Carry Over Balances

I have a purchase table and a sales table. I used a union query to join
them and using CASE statement, I have been able to extract purchase and
sales amounts. Now, I can now generate the following report using a matrix:
JAN FEB
Purchase product x xx xx
product y xx xx
product z xx xx
total xx xx
Sales product x xx xx
product y xx xx
product z xx xx
total xx xx
I need to put an Inventory group at the bottom so that it looks like this:
JAN FEB
Purchase product x xx xx
product y xx xx
product z xx xx
total xx xx
Sales product x xx xx
product y xx xx
product z xx xx
total xx xx
Inventory product x xx xx (Purchase-Sales)
product y xx xx
product z xx xx
total xx xx
My problem is:
1. How to add the Inventory group efficiently
2. How to carry over the balances of Jan and add it to Feb... and so on
Would appreciate any inputs. Thanks!
Message posted via http://www.webservertalk.comHi
Have you looks at the ROLLUP function in Books Online?
Posting DDL (Create table statements etc...)
http://www.aspfaq.com/etiquette.asp?id=5006 and example data as insert
statements http://vyaskn.tripod.com/code.htm#inserts
along with your current code would help to answer the second question. You
may need to use a derived table to get the monthly values and/or us a
inequality to get the cumulative total e.g JAN is '< 1-Feb', Feb is '<
1-Mar' etc...
John
"Randy via webservertalk.com" wrote:

> I have a purchase table and a sales table. I used a union query to join
> them and using CASE statement, I have been able to extract purchase and
> sales amounts. Now, I can now generate the following report using a matri
x:
> JAN FEB
> Purchase product x xx xx
> product y xx xx
> product z xx xx
> total xx xx
> Sales product x xx xx
> product y xx xx
> product z xx xx
> total xx xx
> I need to put an Inventory group at the bottom so that it looks like this:
> JAN FEB
> Purchase product x xx xx
> product y xx xx
> product z xx xx
> total xx xx
> Sales product x xx xx
> product y xx xx
> product z xx xx
> total xx xx
> Inventory product x xx xx (Purchase-Sales)
> product y xx xx
> product z xx xx
> total xx xx
> My problem is:
> 1. How to add the Inventory group efficiently
> 2. How to carry over the balances of Jan and add it to Feb... and so on
> Would appreciate any inputs. Thanks!
> --
> Message posted via http://www.webservertalk.com
>

Carry Forward Balance

Hello All,
I'm creating a "stock ledger" using Crystal Reports 8.0. This report is printed monthly and requires that the previous month's closing balance become current month's opening balance. How do I do this?
Regards,
Rajmathihi.........

i dont know wts ur tables structure is.................but u can apply condition in ur query as

select sum(AmountField) from TableName where Month(TableName.DateField)=Month(TableName.DateField)-1

Best of Luck|||Hello "Silly Star"

Thanks for the reply, but the opening balance stock quantity and stock value are to be calculated as follows:

Every time new stock is received, the new quantity and its value gets added to the existing stock and a new rate-per-unit is calculated. suppose say I have received two consignments of a particular item on different dates, one of 100 units at 1 Re. each and the other also of 100 units, but at a cost of Rs. 1.10 each then the total stock with me is worth 210.

The same concept is applicable when stock is issued. Now when I have to issue an item I have to issue at Rs. 1.05 each.

Therefore directly considering the total of the quantity recieved and quantity issued can give me info on the quantity used, but there is huge variation in the cost (value) factor. There is fluctuation in the value and the RPU gets changed everytime new stock is received.

The report that I have designed could be used to get stock across months (say Apr - Oct). The closing balance of Apr should be taken as opening balance for May and so on.

It seems in D2K there is separate option using which this can be performed. I just wanted to know if there is a way out in Crystal Reports too

Regards,
Rajmathi|||RajMathi,
I am not sure about this.
I think you can use formula field having the code

currencyvar opbal;
whilprintingrecords;
if month{datefiled}="April" then
opbal:=opbal+{ClosingBalField};

Use other formula to check whether the month is may, if so
add opbal value to openingbalance value of May|||Hello madhi,

Well, I missed out one thing. There are several items in stock and the grouping is on items, so opening balance is separate for each item.

Regards|||RajMathi,
Ok then use other formula named @.Reset having this code

currencyvar opbal;
EhilePrintingRecords;
opbal:=0;

and place this in Group header and other formula in Dectails Section

carry database of 2000 to new computer with SQL Server 2005

>I used "detach" in old computer with running SQL SERVER 2000 and copy the
> A.MDF file to the new computer with SQL Server 2005.
OK, should be fine.

> Then used "attach" to restore the database A in the new computer. The
> database A still keeps the user names and machine name. I can not delete them.
User names are expected. Yes, you can remove these if you wish. Check out DROP USER.
SQL Server does not store the machine name inside the database, except for the master and msdb
databases.

> The problem is that I can not expand the folder of Database Diagrams. When I
> do it, I got the message:
> Database diagram support objects cannot be installed because this database
> does not have a valid owner. To continue, first use the Files page of
> Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> the database owner to a valid login, then add the database diagram support
> objects.
You need to set the owner to a login that exists as a login inside SQL Server. After that is done
(and restart SSMS just in case), SSMS will add the procedures etc automatically.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"david" <david@.discussions.microsoft.com> wrote in message
news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
>I used "detach" in old computer with running SQL SERVER 2000 and copy the
> A.MDF file to the new computer with SQL Server 2005.
> Then used "attach" to restore the database A in the new computer. The
> database A still keeps the user names and machine name. I can not delete them.
> The problem is that I can not expand the folder of Database Diagrams. When I
> do it, I got the message:
> Database diagram support objects cannot be installed because this database
> does not have a valid owner. To continue, first use the Files page of
> Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> the database owner to a valid login, then add the database diagram support
> objects.
> I did the "use the Files page of Database Properties dialog box to to set
> the database owner to a valid login", by using a new computer valid user
> name. But it does not work. I do not know how "then add the database diagram
> support objects" either.
> Thanks for any help.
> Dabin
IT seems you did set the owner to a valid login. You could try to set the owner to "sa" and see if
that helps. If not, I'm out of ideas, I'm afraid.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"david" <david@.discussions.microsoft.com> wrote in message
news:7F6BE323-F22F-42E1-846F-3CB685913381@.microsoft.com...[vbcol=seagreen]
> Thank you, Tibor:
> My problem is the last one "You need to set the owner to a login that exists
> as a login inside SQL Server. After that is done
> (and restart SSMS just in case), SSMS will add the procedures etc
> automatically.
> --
> "
> I did something wrong.
> I login to computer system, computer, by using my account, for example,
> david. So the full name: computer\david.
> I used SSMS to connect the database dbase. I right click on the database and
> select the Properties. In the popup window, select Files. In the owner bos,
> browser my account name, computer\david. Then click OK.
> Restart SSMS. Tried to open the database diagrams, and I got the same error
> massage.
> David
> "Tibor Karaszi" wrote:
|||Hi David,
I got the same error and fixed it by
right click on database
properties
files
options
Then change the compatibility from 80 which is SQL2000 to 90 which is
SQL2005.
"Tibor Karaszi" wrote:

> IT seems you did set the owner to a valid login. You could try to set the owner to "sa" and see if
> that helps. If not, I'm out of ideas, I'm afraid.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "david" <david@.discussions.microsoft.com> wrote in message
> news:7F6BE323-F22F-42E1-846F-3CB685913381@.microsoft.com...
>

carry database of 2000 to new computer with SQL Server 2005

I used "detach" in old computer with running SQL SERVER 2000 and copy the
A.MDF file to the new computer with SQL Server 2005.
Then used "attach" to restore the database A in the new computer. The
database A still keeps the user names and machine name. I can not delete them.
The problem is that I can not expand the folder of Database Diagrams. When I
do it, I got the message:
Database diagram support objects cannot be installed because this database
does not have a valid owner. To continue, first use the Files page of
Database Properties dialog box or the ALTER AUTHORIZATION statement to set
the database owner to a valid login, then add the database diagram support
objects.
I did the "use the Files page of Database Properties dialog box to to set
the database owner to a valid login", by using a new computer valid user
name. But it does not work. I do not know how "then add the database diagram
support objects" either.
Thanks for any help.
Dabin>I used "detach" in old computer with running SQL SERVER 2000 and copy the
> A.MDF file to the new computer with SQL Server 2005.
OK, should be fine.
> Then used "attach" to restore the database A in the new computer. The
> database A still keeps the user names and machine name. I can not delete them.
User names are expected. Yes, you can remove these if you wish. Check out DROP USER.
SQL Server does not store the machine name inside the database, except for the master and msdb
databases.
> The problem is that I can not expand the folder of Database Diagrams. When I
> do it, I got the message:
> Database diagram support objects cannot be installed because this database
> does not have a valid owner. To continue, first use the Files page of
> Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> the database owner to a valid login, then add the database diagram support
> objects.
You need to set the owner to a login that exists as a login inside SQL Server. After that is done
(and restart SSMS just in case), SSMS will add the procedures etc automatically.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"david" <david@.discussions.microsoft.com> wrote in message
news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
>I used "detach" in old computer with running SQL SERVER 2000 and copy the
> A.MDF file to the new computer with SQL Server 2005.
> Then used "attach" to restore the database A in the new computer. The
> database A still keeps the user names and machine name. I can not delete them.
> The problem is that I can not expand the folder of Database Diagrams. When I
> do it, I got the message:
> Database diagram support objects cannot be installed because this database
> does not have a valid owner. To continue, first use the Files page of
> Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> the database owner to a valid login, then add the database diagram support
> objects.
> I did the "use the Files page of Database Properties dialog box to to set
> the database owner to a valid login", by using a new computer valid user
> name. But it does not work. I do not know how "then add the database diagram
> support objects" either.
> Thanks for any help.
> Dabin|||Thank you, Tibor:
My problem is the last one "You need to set the owner to a login that exists
as a login inside SQL Server. After that is done
(and restart SSMS just in case), SSMS will add the procedures etc
automatically.
--
"
I did something wrong.
I login to computer system, computer, by using my account, for example,
david. So the full name: computer\david.
I used SSMS to connect the database dbase. I right click on the database and
select the Properties. In the popup window, select Files. In the owner bos,
browser my account name, computer\david. Then click OK.
Restart SSMS. Tried to open the database diagrams, and I got the same error
massage.
David
"Tibor Karaszi" wrote:
> >I used "detach" in old computer with running SQL SERVER 2000 and copy the
> > A.MDF file to the new computer with SQL Server 2005.
> OK, should be fine.
>
> > Then used "attach" to restore the database A in the new computer. The
> > database A still keeps the user names and machine name. I can not delete them.
> User names are expected. Yes, you can remove these if you wish. Check out DROP USER.
> SQL Server does not store the machine name inside the database, except for the master and msdb
> databases.
>
> > The problem is that I can not expand the folder of Database Diagrams. When I
> > do it, I got the message:
> > Database diagram support objects cannot be installed because this database
> > does not have a valid owner. To continue, first use the Files page of
> > Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> > the database owner to a valid login, then add the database diagram support
> > objects.
> You need to set the owner to a login that exists as a login inside SQL Server. After that is done
> (and restart SSMS just in case), SSMS will add the procedures etc automatically.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "david" <david@.discussions.microsoft.com> wrote in message
> news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
> >I used "detach" in old computer with running SQL SERVER 2000 and copy the
> > A.MDF file to the new computer with SQL Server 2005.
> > Then used "attach" to restore the database A in the new computer. The
> > database A still keeps the user names and machine name. I can not delete them.
> >
> > The problem is that I can not expand the folder of Database Diagrams. When I
> > do it, I got the message:
> > Database diagram support objects cannot be installed because this database
> > does not have a valid owner. To continue, first use the Files page of
> > Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> > the database owner to a valid login, then add the database diagram support
> > objects.
> >
> > I did the "use the Files page of Database Properties dialog box to to set
> > the database owner to a valid login", by using a new computer valid user
> > name. But it does not work. I do not know how "then add the database diagram
> > support objects" either.
> >
> > Thanks for any help.
> >
> > Dabin
>|||IT seems you did set the owner to a valid login. You could try to set the owner to "sa" and see if
that helps. If not, I'm out of ideas, I'm afraid.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"david" <david@.discussions.microsoft.com> wrote in message
news:7F6BE323-F22F-42E1-846F-3CB685913381@.microsoft.com...
> Thank you, Tibor:
> My problem is the last one "You need to set the owner to a login that exists
> as a login inside SQL Server. After that is done
> (and restart SSMS just in case), SSMS will add the procedures etc
> automatically.
> --
> "
> I did something wrong.
> I login to computer system, computer, by using my account, for example,
> david. So the full name: computer\david.
> I used SSMS to connect the database dbase. I right click on the database and
> select the Properties. In the popup window, select Files. In the owner bos,
> browser my account name, computer\david. Then click OK.
> Restart SSMS. Tried to open the database diagrams, and I got the same error
> massage.
> David
> "Tibor Karaszi" wrote:
>> >I used "detach" in old computer with running SQL SERVER 2000 and copy the
>> > A.MDF file to the new computer with SQL Server 2005.
>> OK, should be fine.
>>
>> > Then used "attach" to restore the database A in the new computer. The
>> > database A still keeps the user names and machine name. I can not delete them.
>> User names are expected. Yes, you can remove these if you wish. Check out DROP USER.
>> SQL Server does not store the machine name inside the database, except for the master and msdb
>> databases.
>>
>> > The problem is that I can not expand the folder of Database Diagrams. When I
>> > do it, I got the message:
>> > Database diagram support objects cannot be installed because this database
>> > does not have a valid owner. To continue, first use the Files page of
>> > Database Properties dialog box or the ALTER AUTHORIZATION statement to set
>> > the database owner to a valid login, then add the database diagram support
>> > objects.
>> You need to set the owner to a login that exists as a login inside SQL Server. After that is done
>> (and restart SSMS just in case), SSMS will add the procedures etc automatically.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "david" <david@.discussions.microsoft.com> wrote in message
>> news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
>> >I used "detach" in old computer with running SQL SERVER 2000 and copy the
>> > A.MDF file to the new computer with SQL Server 2005.
>> > Then used "attach" to restore the database A in the new computer. The
>> > database A still keeps the user names and machine name. I can not delete them.
>> >
>> > The problem is that I can not expand the folder of Database Diagrams. When I
>> > do it, I got the message:
>> > Database diagram support objects cannot be installed because this database
>> > does not have a valid owner. To continue, first use the Files page of
>> > Database Properties dialog box or the ALTER AUTHORIZATION statement to set
>> > the database owner to a valid login, then add the database diagram support
>> > objects.
>> >
>> > I did the "use the Files page of Database Properties dialog box to to set
>> > the database owner to a valid login", by using a new computer valid user
>> > name. But it does not work. I do not know how "then add the database diagram
>> > support objects" either.
>> >
>> > Thanks for any help.
>> >
>> > Dabin|||Hi David,
I got the same error and fixed it by
right click on database
properties
files
options
Then change the compatibility from 80 which is SQL2000 to 90 which is
SQL2005.
"Tibor Karaszi" wrote:
> IT seems you did set the owner to a valid login. You could try to set the owner to "sa" and see if
> that helps. If not, I'm out of ideas, I'm afraid.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "david" <david@.discussions.microsoft.com> wrote in message
> news:7F6BE323-F22F-42E1-846F-3CB685913381@.microsoft.com...
> > Thank you, Tibor:
> > My problem is the last one "You need to set the owner to a login that exists
> > as a login inside SQL Server. After that is done
> > (and restart SSMS just in case), SSMS will add the procedures etc
> > automatically.
> > --
> > "
> >
> > I did something wrong.
> > I login to computer system, computer, by using my account, for example,
> > david. So the full name: computer\david.
> > I used SSMS to connect the database dbase. I right click on the database and
> > select the Properties. In the popup window, select Files. In the owner bos,
> > browser my account name, computer\david. Then click OK.
> > Restart SSMS. Tried to open the database diagrams, and I got the same error
> > massage.
> >
> > David
> >
> > "Tibor Karaszi" wrote:
> >
> >> >I used "detach" in old computer with running SQL SERVER 2000 and copy the
> >> > A.MDF file to the new computer with SQL Server 2005.
> >>
> >> OK, should be fine.
> >>
> >>
> >> > Then used "attach" to restore the database A in the new computer. The
> >> > database A still keeps the user names and machine name. I can not delete them.
> >>
> >> User names are expected. Yes, you can remove these if you wish. Check out DROP USER.
> >> SQL Server does not store the machine name inside the database, except for the master and msdb
> >> databases.
> >>
> >>
> >> > The problem is that I can not expand the folder of Database Diagrams. When I
> >> > do it, I got the message:
> >> > Database diagram support objects cannot be installed because this database
> >> > does not have a valid owner. To continue, first use the Files page of
> >> > Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> >> > the database owner to a valid login, then add the database diagram support
> >> > objects.
> >>
> >> You need to set the owner to a login that exists as a login inside SQL Server. After that is done
> >> (and restart SSMS just in case), SSMS will add the procedures etc automatically.
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://sqlblog.com/blogs/tibor_karaszi
> >>
> >>
> >> "david" <david@.discussions.microsoft.com> wrote in message
> >> news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
> >> >I used "detach" in old computer with running SQL SERVER 2000 and copy the
> >> > A.MDF file to the new computer with SQL Server 2005.
> >> > Then used "attach" to restore the database A in the new computer. The
> >> > database A still keeps the user names and machine name. I can not delete them.
> >> >
> >> > The problem is that I can not expand the folder of Database Diagrams. When I
> >> > do it, I got the message:
> >> > Database diagram support objects cannot be installed because this database
> >> > does not have a valid owner. To continue, first use the Files page of
> >> > Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> >> > the database owner to a valid login, then add the database diagram support
> >> > objects.
> >> >
> >> > I did the "use the Files page of Database Properties dialog box to to set
> >> > the database owner to a valid login", by using a new computer valid user
> >> > name. But it does not work. I do not know how "then add the database diagram
> >> > support objects" either.
> >> >
> >> > Thanks for any help.
> >> >
> >> > Dabin
> >>
>

carry database of 2000 to new computer with SQL Server 2005

I used "detach" in old computer with running SQL SERVER 2000 and copy the
A.MDF file to the new computer with SQL Server 2005.
Then used "attach" to restore the database A in the new computer. The
database A still keeps the user names and machine name. I can not delete the
m.
The problem is that I can not expand the folder of Database Diagrams. When I
do it, I got the message:
Database diagram support objects cannot be installed because this database
does not have a valid owner. To continue, first use the Files page of
Database Properties dialog box or the ALTER AUTHORIZATION statement to set
the database owner to a valid login, then add the database diagram support
objects.
I did the "use the Files page of Database Properties dialog box to to set
the database owner to a valid login", by using a new computer valid user
name. But it does not work. I do not know how "then add the database diagram
support objects" either.
Thanks for any help.
Dabin>I used "detach" in old computer with running SQL SERVER 2000 and copy the
> A.MDF file to the new computer with SQL Server 2005.
OK, should be fine.

> Then used "attach" to restore the database A in the new computer. The
> database A still keeps the user names and machine name. I can not delete them.[/vb
col]
User names are expected. Yes, you can remove these if you wish. Check out DR
OP USER.
SQL Server does not store the machine name inside the database, except for t
he master and msdb
databases.
[vbcol=seagreen]
> The problem is that I can not expand the folder of Database Diagrams. When
I
> do it, I got the message:
> Database diagram support objects cannot be installed because this database
> does not have a valid owner. To continue, first use the Files page of
> Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> the database owner to a valid login, then add the database diagram support
> objects.
You need to set the owner to a login that exists as a login inside SQL Serve
r. After that is done
(and restart SSMS just in case), SSMS will add the procedures etc automatica
lly.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"david" <david@.discussions.microsoft.com> wrote in message
news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
>I used "detach" in old computer with running SQL SERVER 2000 and copy the
> A.MDF file to the new computer with SQL Server 2005.
> Then used "attach" to restore the database A in the new computer. The
> database A still keeps the user names and machine name. I can not delete t
hem.
> The problem is that I can not expand the folder of Database Diagrams. When
I
> do it, I got the message:
> Database diagram support objects cannot be installed because this database
> does not have a valid owner. To continue, first use the Files page of
> Database Properties dialog box or the ALTER AUTHORIZATION statement to set
> the database owner to a valid login, then add the database diagram support
> objects.
> I did the "use the Files page of Database Properties dialog box to to set
> the database owner to a valid login", by using a new computer valid user
> name. But it does not work. I do not know how "then add the database diagr
am
> support objects" either.
> Thanks for any help.
> Dabin|||Thank you, Tibor:
My problem is the last one "You need to set the owner to a login that exists
as a login inside SQL Server. After that is done
(and restart SSMS just in case), SSMS will add the procedures etc
automatically.
--
"
I did something wrong.
I login to computer system, computer, by using my account, for example,
david. So the full name: computer\david.
I used SSMS to connect the database dbase. I right click on the database and
select the Properties. In the popup window, select Files. In the owner bos,
browser my account name, computer\david. Then click OK.
Restart SSMS. Tried to open the database diagrams, and I got the same error
massage.
David
"Tibor Karaszi" wrote:

> OK, should be fine.
>
> User names are expected. Yes, you can remove these if you wish. Check out
DROP USER.
> SQL Server does not store the machine name inside the database, except for
the master and msdb
> databases.
>
> You need to set the owner to a login that exists as a login inside SQL Ser
ver. After that is done
> (and restart SSMS just in case), SSMS will add the procedures etc automati
cally.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "david" <david@.discussions.microsoft.com> wrote in message
> news:4838E101-064B-4658-8F73-85696E7FB195@.microsoft.com...
>|||IT seems you did set the owner to a valid login. You could try to set the ow
ner to "sa" and see if
that helps. If not, I'm out of ideas, I'm afraid.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"david" <david@.discussions.microsoft.com> wrote in message
news:7F6BE323-F22F-42E1-846F-3CB685913381@.microsoft.com...[vbcol=seagreen]
> Thank you, Tibor:
> My problem is the last one "You need to set the owner to a login that exis
ts
> as a login inside SQL Server. After that is done
> (and restart SSMS just in case), SSMS will add the procedures etc
> automatically.
> --
> "
> I did something wrong.
> I login to computer system, computer, by using my account, for example,
> david. So the full name: computer\david.
> I used SSMS to connect the database dbase. I right click on the database a
nd
> select the Properties. In the popup window, select Files. In the owner bos
,
> browser my account name, computer\david. Then click OK.
> Restart SSMS. Tried to open the database diagrams, and I got the same erro
r
> massage.
> David
> "Tibor Karaszi" wrote:
>|||Hi David,
I got the same error and fixed it by
right click on database
properties
files
options
Then change the compatibility from 80 which is SQL2000 to 90 which is
SQL2005.
"Tibor Karaszi" wrote:

> IT seems you did set the owner to a valid login. You could try to set the
owner to "sa" and see if
> that helps. If not, I'm out of ideas, I'm afraid.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "david" <david@.discussions.microsoft.com> wrote in message
> news:7F6BE323-F22F-42E1-846F-3CB685913381@.microsoft.com...
>