Friday, March 30, 2012

Mars Connection Problem

I am trying to make a connection to an SQL database held on myserver I am able to connect through a machine data source using access using the credentials as below the attempt fails at con.open with following error:

System.Runtime.InteropServices.COMException was caught
ErrorCode=-2147467259
Message="Named Pipes Provider: Could not open a connection to SQL Server [53]. "
Source="Microsoft SQL Native Client"
StackTrace:
at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
at Client_Access.JobRequest.AddJob_Click(Object sender, EventArgs e) in C:\Documents and Settings\Robert\My Documents\Visual Studio 2005\Projects\ Client Access\ Client Access\JobRequest.vb:line 392

Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sPassword As String, sUserID As String
sPassword = "abcde"
sUserID = "cClient"
Try
con.ConnectionString = "Provider=SQLNCLI;" _
& "Server=(myserver);" _
& "Database=transportRecs;" _
& "Integrated Security=SSPI;" _
& "DataTypeCompatibility=80;" _
& "UID=" & sUserID & ";" _
& "PWD=" & sPassword & ";" _
& "MARS Connection=True;"
Dim mySQL As String

mySQL = "SELECT * FROM dbo_jobitem " '& _
'" WHERE [Custid] ='" & strTag & "'"

con.Open()

rst = New ADODB.Recordset
With rst
.ActiveConnection = con
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.CursorType = ADODB.CursorTypeEnum.adOpenStatic
.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic
.Open(mySQL)
.MoveLast()
.MoveFirst()
.MoveLast()
.MoveFirst()
Debug.Print(.RecordCount)
End With

Catch ex As Exception
MsgBox(ex.ToString)
Finally
If (con.State = ConnectionState.Open) Then con.Close()
End Try

Can anyone help.

Regards,
Joe

The connection string is pooched. Use a UDL to write the connection string for you.

1. Open notepad

2. Save the blank file as test.udl to your desktop

3. Open the UDL and create and test your connection string.

4. Close and open in notepad

5. Copy the generated connection string

Adamus

|||

Hi Adamus Turner

I have follwed the instructions supplied. The connection is good using the connection string below:

con.ConnectionString = "Provider=MSDASQL.1;Password=abcde;Persist Security Info=True;User ID=cClient;Mode=ReadWrite;Extended Properties= DSN=TransportDB_Comp1;Description= ;UID= cClient;PWD=abcde;APP=Microsoft? Windows? Operating System;WSID=MIDLAPTOP2; transportRecs;Network=DBMSSOCN" & _

"MARS Connection=True;"

Dim mySQL As String

mySQL = "SELECT dwjobitemid FROM dbo_jobitem"

'";" '" WHERE [Custid] ='" & strTag & "'"

con.Open()

rst = New ADODB.Recordset

With rst

.ActiveConnection = con

.CursorLocation = ADODB.CursorLocationEnum.adUseClient

.CursorType = ADODB.CursorTypeEnum.adOpenStatic

.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic

.Open(mySQL)

.MoveLast()

.MoveFirst()

.MoveLast()

.MoveFirst()

MsgBox(.RecordCount)

End With

When the connection attemps to open a record set (.open(mySQL) an error is called, Invalid object name? I know the table exists?

Regards

Joe

|||

Is the table name dbo_jobitem or dbo.jobitem?

It's a strange convention to use an underscore.

Adamus

|||

Also, do not post logins and passwords to databases.

Moderator, please remove login and password from connection string.

Adamus

|||

Hi Adamus

I have managed to sort out the problem, the issue was not with the connection string after I had used your advice the connection was good. The database tables when viewed on the sql server all had names starting “dbo_” I had attempted to look at the database schema.tables using “select * from information_schema.tables” out of vbnet but could not work out how you returned recordset!table_name in vb.net> I did managed to achieve this using vba. The table names returned were all shown minus the “dbo_” prefix I altered my sql to match and bingo.

Any user names, passwords etc used in my examples are all fictitious. And have been used for illustration only. Many thanks for your assistance with my postings

Regards

Joe

Marking posts to get faster attention from SSIS Team

Here is one practical initiative for improving the service SSIS team provides to this forum:

We asked our MVPs to mark posts that need attention from the SSIS team and built a system to fetch those messages and send them directly to our internal distribution list. The report will contain all currently marked messages in non-answered threads.That way, forum posts that MVPs target to us will be much easier for us to find, and the response time for them will be shorter.

The MVPs have accepted to help us with this, and we started extracting messages marked by selected users and sending daily reports to the team.

Please let us know what you think about this action and keep an eye on how we are doing with providing answers on marked threads.

Thank you,

Bob Bojanic, SSIS Team

Well done. I think this is a good idea. Is there any difference between this approach and the SSIS MSDN manged forum?|||

Thanks, Larry.

I am not sure what you are referring to as "MSDN managed forum".

|||http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.public.sqlserver.dts|||

Pardon, I meant managed newsgroup.

http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.public.sqlserver.dts

|||

Oh, I see.

This seems to be a web client to our newsgroup discussions. We kind of pre-oriented into using this new forum (forums.microsoft.com) in the course of the last couple of years. The newsgroups seem to be still pretty active but there is no as many MS answerers as you can find here. The groups appear to be self-sustained though, and if you prefer less traffic and more focused discussion you should keep visiting them.

This initiative of marking threads to be looked at by the SSIS team is going to be limited to this forum. We do not have access to the server where the newsgroup posts are kept.

Thanks.

|||

Sounds like a good idea, but how about getting the list more than once a day, maybe once an hour?

Gary

|||

Gary Watson wrote:

Sounds like a good idea, but how about getting the list more than once a day, maybe once an hour?

Gary

Well, likely because the Microsoft guys actually have work to do! Once a day is appropriate, I think. Microsoft employees are under no obligation to answer any question on this forum; certainly in no set time frame.|||

Phil is right; answering posts on this forum is not going to give us a good excuse for not finishing our daily tasks.

This initiative is an attempt to get the questions from here closer to potential answerers. Usually, when we (SSIS team members) read these threads we try to use our time efficiently; so if we do not know the answer or do not have time to do some follow up investigation we will just skip the question hoping somebody else would answer it. If a right person does not come across those hard yet important questions in a few days, they might be left unanswered.

Our tool will find such questions, if marked appropriately, and make them visible to the entire SSIS team. There is no time limit when we have to answer them. They are listed in our report until answered. Most of those questions get answered in 2-3 days (it depends on the time it gets into the report, time zones, weekends, etc). Some of them might even require more time for investigations.

It would not make sense to send the report every hour if we cannot commit to the turnaround time on the same scale. The most important aspect is to get them marked so they do not get lost under new piles of posts.

Thanks,

Bob

|||

Hi Bob,

I did not understand before the use of this forum, thanks for clearing that up for me.

I am grateful that you guys can help out whenever you can.

Regards

Gary

sql

Marking posts to get faster attention from SSIS Team

Here is one practical initiative for improving the service SSIS team provides to this forum:

We asked our MVPs to mark posts that need attention from the SSIS team and built a system to fetch those messages and send them directly to our internal distribution list. The report will contain all currently marked messages in non-answered threads.That way, forum posts that MVPs target to us will be much easier for us to find, and the response time for them will be shorter.

The MVPs have accepted to help us with this, and we started extracting messages marked by selected users and sending daily reports to the team.

Please let us know what you think about this action and keep an eye on how we are doing with providing answers on marked threads.

Thank you,

Bob Bojanic, SSIS Team

Well done. I think this is a good idea. Is there any difference between this approach and the SSIS MSDN manged forum?|||

Thanks, Larry.

I am not sure what you are referring to as "MSDN managed forum".

|||http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.public.sqlserver.dts|||

Pardon, I meant managed newsgroup.

http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.public.sqlserver.dts

|||

Oh, I see.

This seems to be a web client to our newsgroup discussions. We kind of pre-oriented into using this new forum (forums.microsoft.com) in the course of the last couple of years. The newsgroups seem to be still pretty active but there is no as many MS answerers as you can find here. The groups appear to be self-sustained though, and if you prefer less traffic and more focused discussion you should keep visiting them.

This initiative of marking threads to be looked at by the SSIS team is going to be limited to this forum. We do not have access to the server where the newsgroup posts are kept.

Thanks.

|||

Sounds like a good idea, but how about getting the list more than once a day, maybe once an hour?

Gary

|||

Gary Watson wrote:

Sounds like a good idea, but how about getting the list more than once a day, maybe once an hour?

Gary

Well, likely because the Microsoft guys actually have work to do! Once a day is appropriate, I think. Microsoft employees are under no obligation to answer any question on this forum; certainly in no set time frame.|||

Phil is right; answering posts on this forum is not going to give us a good excuse for not finishing our daily tasks.

This initiative is an attempt to get the questions from here closer to potential answerers. Usually, when we (SSIS team members) read these threads we try to use our time efficiently; so if we do not know the answer or do not have time to do some follow up investigation we will just skip the question hoping somebody else would answer it. If a right person does not come across those hard yet important questions in a few days, they might be left unanswered.

Our tool will find such questions, if marked appropriately, and make them visible to the entire SSIS team. There is no time limit when we have to answer them. They are listed in our report until answered. Most of those questions get answered in 2-3 days (it depends on the time it gets into the report, time zones, weekends, etc). Some of them might even require more time for investigations.

It would not make sense to send the report every hour if we cannot commit to the turnaround time on the same scale. The most important aspect is to get them marked so they do not get lost under new piles of posts.

Thanks,

Bob

|||

Hi Bob,

I did not understand before the use of this forum, thanks for clearing that up for me.

I am grateful that you guys can help out whenever you can.

Regards

Gary

Marking posts to get faster attention from SSIS Team

Here is one practical initiative for improving the service SSIS team provides to this forum:

We asked our MVPs to mark posts that need attention from the SSIS team and built a system to fetch those messages and send them directly to our internal distribution list. The report will contain all currently marked messages in non-answered threads.That way, forum posts that MVPs target to us will be much easier for us to find, and the response time for them will be shorter.

The MVPs have accepted to help us with this, and we started extracting messages marked by selected users and sending daily reports to the team.

Please let us know what you think about this action and keep an eye on how we are doing with providing answers on marked threads.

Thank you,

Bob Bojanic, SSIS Team

Well done. I think this is a good idea. Is there any difference between this approach and the SSIS MSDN manged forum?|||

Thanks, Larry.

I am not sure what you are referring to as "MSDN managed forum".

|||http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.public.sqlserver.dts|||

Pardon, I meant managed newsgroup.

http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.public.sqlserver.dts

|||

Oh, I see.

This seems to be a web client to our newsgroup discussions. We kind of pre-oriented into using this new forum (forums.microsoft.com) in the course of the last couple of years. The newsgroups seem to be still pretty active but there is no as many MS answerers as you can find here. The groups appear to be self-sustained though, and if you prefer less traffic and more focused discussion you should keep visiting them.

This initiative of marking threads to be looked at by the SSIS team is going to be limited to this forum. We do not have access to the server where the newsgroup posts are kept.

Thanks.

|||

Sounds like a good idea, but how about getting the list more than once a day, maybe once an hour?

Gary

|||

Gary Watson wrote:

Sounds like a good idea, but how about getting the list more than once a day, maybe once an hour?

Gary

Well, likely because the Microsoft guys actually have work to do! Once a day is appropriate, I think. Microsoft employees are under no obligation to answer any question on this forum; certainly in no set time frame.|||

Phil is right; answering posts on this forum is not going to give us a good excuse for not finishing our daily tasks.

This initiative is an attempt to get the questions from here closer to potential answerers. Usually, when we (SSIS team members) read these threads we try to use our time efficiently; so if we do not know the answer or do not have time to do some follow up investigation we will just skip the question hoping somebody else would answer it. If a right person does not come across those hard yet important questions in a few days, they might be left unanswered.

Our tool will find such questions, if marked appropriately, and make them visible to the entire SSIS team. There is no time limit when we have to answer them. They are listed in our report until answered. Most of those questions get answered in 2-3 days (it depends on the time it gets into the report, time zones, weekends, etc). Some of them might even require more time for investigations.

It would not make sense to send the report every hour if we cannot commit to the turnaround time on the same scale. The most important aspect is to get them marked so they do not get lost under new piles of posts.

Thanks,

Bob

|||

Hi Bob,

I did not understand before the use of this forum, thanks for clearing that up for me.

I am grateful that you guys can help out whenever you can.

Regards

Gary

Marking Multiple Records?

I have a crystal report that I have been asked to modify for a new process.

This report will take a look at our scheduling system and display which Dies are needed for each order. The Problem I am running into is I need a way to be able to denote that a Die is at another operation if the die number is previously listed in the report. This would be fine if I could sort by Die number, but the report has to be sorted by time so our Die room staff knows when a die is due to a machine and are able to just run through the list without having to search through the report for the next order.

This report is currently grouped by run date (so we can keep shifts straight) and sorted by Run Start Time and then by machine number.
This is the order is has to be in, and I cannot deviate from that.

Attached is an example of the current layout of the report

My issue is that I need some way to Denote that the die for the last order 278381-1 is at another machine (the First 2 orders 278385-1) so our Die Room staff are not searching for the Die on Rack 51 when they go to get the dies for the the last order.

I have thought long and hard about this, and I cannot figure out a way to get through this issue without reordering the report, which I cant do.

Any assistance or direction would be greatly appreciatedProblem has been resolved
The solution involved creating a Sub-Report and filtering out the extra records that did not match and then adding a Formatting to the Field to denote a Duplicate record.

Marking copied records

I have a big problem now. I need to write a SQL statement to copy some
records from a table to another table. At the process of copying, I want to
update a field in both table. The field is to identify whether the record is
the 1st, 2nd, 3rd, 4th, ... record that I've copied, which will be in runnin
g
sequence. There should be repeating numbers. The reason for doing this is if
a user modifies a record in the new table in the future, I will still know
how it originally was by referring back by that number.
Do you get what I mean? I have no idea whether SQL can do that. And whether
it can be settled in a statement. Can someone help me? Give me some guide?
Thank you.You could do this by adding a DateCopied (datetime -default getdate() )
column to the tables -perhaps even adding a WhoChanged (varchar(50) -default
system_user) column.
Other options include a Sequence (timeStamp datatype) Column.
Either of these choices would allow you to always restructure the sequence
of data changes.
Then you just add a TRIGGER to the primary table to copy the old version to
the archive table whenever there is a data change.
You might google "SQL Server" and "Audit Trail". Here's an article to get
you started:
http://expertanswercenter.techtarge...i980058,00.html
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"wrytat" <wrytat@.discussions.microsoft.com> wrote in message
news:8D4B4729-8170-436E-BE05-D87933758E59@.microsoft.com...
>I have a big problem now. I need to write a SQL statement to copy some
> records from a table to another table. At the process of copying, I want
> to
> update a field in both table. The field is to identify whether the record
> is
> the 1st, 2nd, 3rd, 4th, ... record that I've copied, which will be in
> running
> sequence. There should be repeating numbers. The reason for doing this is
> if
> a user modifies a record in the new table in the future, I will still know
> how it originally was by referring back by that number.
> Do you get what I mean? I have no idea whether SQL can do that. And
> whether
> it can be settled in a statement. Can someone help me? Give me some guide?
> Thank you.

Marking a table as a System Table

Okay, most peoples answer to this may be "Gaaah. Why would you do
this?", or the like, but here's the question anyway:

Are there any stability issues if I mark one of my user tables as a
system table (by switching xtype in sysobjects from 'S' to 'U')?

I'm not doing this as "a cleved bit of security" or some such - my
actual reason for doing this is so that some of my automatic generation
tools do not process this particular table, and I want a method that
will not mean updating each of the tools if I ever add another table
like this.

It APPEARS to work, based on a quick trial, but has anybody got any
direct experience of this? Any horror stories like "Well, it worked
fine for two weeks, then it shot my co-workers, set fire to the company
accounts, and urinated in a corner. Then things got worse"

Also, yes, yes, yes, I do not necessarily expect this to work in future
releases of SQL Server (currently on 2000), but I should avoid naming
conflicts by the fact that the owner isn't dbo.
Thanks in advance for any insights."Damien" wrote:

> Okay, most peoples answer to this may be "Gaaah. Why would you do
> this?", or the like, but here's the question anyway:
> Are there any stability issues if I mark one of my user tables as a
> system table (by switching xtype in sysobjects from 'S' to 'U')?
> I'm not doing this as "a cleved bit of security" or some such - my
> actual reason for doing this is so that some of my automatic generation
> tools do not process this particular table, and I want a method that
> will not mean updating each of the tools if I ever add another table
> like this.
> It APPEARS to work, based on a quick trial, but has anybody got any
> direct experience of this? Any horror stories like "Well, it worked
> fine for two weeks, then it shot my co-workers, set fire to the company
> accounts, and urinated in a corner. Then things got worse"
> Also, yes, yes, yes, I do not necessarily expect this to work in future
> releases of SQL Server (currently on 2000), but I should avoid naming
> conflicts by the fact that the owner isn't dbo.
> Thanks in advance for any insights.

Well I changed a system table once and all the workers recovered, the
building only smoldered, no one noticed the puddle, and then things seemed
to clear up on their own :)

Seriously, though, why not use extended properties for this purpose? For
your table that you don't want to process, use...

exec sp_addextendedproperty
'DoNotProcess',
'1',
'USER',
'dbo',
'TABLE',
'TableThatIsntProcessed',
NULL,
NULL

...Then before you process any table you can...

if not exists (
select null
from ::fn_listextendedproperty(
'DoNotProcess',
'USER', 'dbo',
'TABLE', 'TableThatIsntProcessed',
NULL, NULL
)
where value = '1'
)
begin
print 'process table'
end

This way any table can be selectively set up for processing or not without
touching the system tables and you have a better chance of not getting
broken with succesive releases of SQL Server.

Craig|||Thanks, I'll look into that. I've not used extended properties before
(then again, we've only just upgraded from 7 (as in, last weekend), was
it available in 7?)|||"Damien" wrote:

<snip>
> was it available in 7?

<snip
http://www.microsoft.com/sql/techin...dproperties.asp

According to this link, no (the page above also contains links to articles
on using extended properties, although I didn't follow them to see if they
were still good). It's been a while since we upgraded from 7 to 2K, but
that also seems sync with my memory.

Craigsql

Marking a subscription for reinitialization

Is there a command I can execute through SQL Query Analyzer that will mark a
subscription for reinitialization?
Thanks
Brad
Never mind...found my answer in BOL.
Brad
"Brad M." <anonymous@.discussions.microsoft.com> wrote in message
news:%23ve4jolJEHA.2576@.TK2MSFTNGP12.phx.gbl...
> Is there a command I can execute through SQL Query Analyzer that will mark
a
> subscription for reinitialization?
> Thanks
> Brad
>

Marker colouring in Line Chart

Hi,

Two questions both on Line charts:

Is it possible to give the marker of a line chart a different colour from that given to the line?

Is it possible to make only the line in the line chart invisible? My requirement is to keep only the markers.

Regards,

Emil

1. Yes. On the point labels tab, click the label style button. In the color textbox, you can select a color or enter an expression (say one color for positive values and another for negative values -- use IIf).

2. Yes. Double click the field that you want to make disappear. In the value textbox (values tab) enter the following for the expression:

=""

This will keep the point labels as they were, but make the value for the line chart be empty.

|||

Hello I have similar requirements.

When I set the values tab to ="" I just get a solid line at origin. I am not seeing the markers at all anymore.

I tried putting the line to none and in the layout mode I dont see a line but as soon as I'm in preview mode I do.

Any ideas on what I'm doing wrong?

Thank you

|||

topekk wrote:

Hello I have similar requirements.

When I set the values tab to ="" I just get a solid line at origin. I am not seeing the markers at all anymore.

What is the expression that is used to create your markers? You need to have an expression there for the markers themselves.

I don't have access to RS at the moment, but I can give you precise instructions tomorrow.

|||

I can't find any tab or button that lets me use an expression to create or alter the markers.

Thanks for the quick reply btw!

|||

I'll take a look at it tomorrow for you.

|||

For the Line chart, I chose the data series in question and get the following tabs:

Values - Series Label, Value,

Appearance show markers checkboxbox, marker size, marker type, (plot data as line checkbox (disabled)), series style button

Point Labels - Show point labels checkbox, Data Label, Label Style, Position, Format code:

Action

Data Output

|||

I'm fairly sure it's point labels (not markers, sorry). You need to have an expression in the point labels. That way the point labels will remain when you blank out the line.

Marker colouring in Line Chart

Hi,

Two questions both on Line charts:

Is it possible to give the marker of a line chart a different colour from that given to the line?

Is it possible to make only the line in the line chart invisible? My requirement is to keep only the markers.

Regards,

Emil

1. Yes. On the point labels tab, click the label style button. In the color textbox, you can select a color or enter an expression (say one color for positive values and another for negative values -- use IIf).

2. Yes. Double click the field that you want to make disappear. In the value textbox (values tab) enter the following for the expression:

=""

This will keep the point labels as they were, but make the value for the line chart be empty.

|||

Hello I have similar requirements.

When I set the values tab to ="" I just get a solid line at origin. I am not seeing the markers at all anymore.

I tried putting the line to none and in the layout mode I dont see a line but as soon as I'm in preview mode I do.

Any ideas on what I'm doing wrong?

Thank you

|||

topekk wrote:

Hello I have similar requirements.

When I set the values tab to ="" I just get a solid line at origin. I am not seeing the markers at all anymore.

What is the expression that is used to create your markers? You need to have an expression there for the markers themselves.

I don't have access to RS at the moment, but I can give you precise instructions tomorrow.

|||

I can't find any tab or button that lets me use an expression to create or alter the markers.

Thanks for the quick reply btw!

|||

I'll take a look at it tomorrow for you.

|||

For the Line chart, I chose the data series in question and get the following tabs:

Values - Series Label, Value,

Appearance show markers checkboxbox, marker size, marker type, (plot data as line checkbox (disabled)), series style button

Point Labels - Show point labels checkbox, Data Label, Label Style, Position, Format code:

Action

Data Output

|||

I'm fairly sure it's point labels (not markers, sorry). You need to have an expression in the point labels. That way the point labels will remain when you blank out the line.

marked transactions

I am running the following script in Query Analizer:
begin transaction xxxx with mark
update logmarks set logmark=2
commit transaction xxxx
go
The script runs without error and the logmarks table is updated correctly,
but when I check the logmarkhistory table to see if a row was inserted there
is nothing in there. What am I doing wrong or why does this happen?
Thanks in advance for any help.The transaction information will be stored in the logmarkhistory table
only if there is a active log backup chain.sql

Marked "IN LOAD" messages

I do restores on a daily basis. The restores are taken from DISK backups. I
am not using backup devices.
I am noticing all these errors in the log file:
Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
When I do the restore, I am using the gui (rt click on database, select
restore).
Sometimes I need to restore over an existing DB, other times I restore to a
new database.
Any ideas? I want to make sure I am doing the restores correctly and remove
these errors
Is it possible if I do not specify "Force over existing Database" that it can
cause this error?
"Kristen" wrote:

> I do restores on a daily basis. The restores are taken from DISK backups. I
> am not using backup devices.
> I am noticing all these errors in the log file:
> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
> When I do the restore, I am using the gui (rt click on database, select
> restore).
> Sometimes I need to restore over an existing DB, other times I restore to a
> new database.
> Any ideas? I want to make sure I am doing the restores correctly and remove
> these errors
|||Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQL
and not the Gui.
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...[vbcol=seagreen]
> Is it possible if I do not specify "Force over existing Database" that it
> can
> cause this error?
> "Kristen" wrote:
|||I tried doing it in TSQL......didn't work
RESTORE DATABASE test2
FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
WITH RECOVERY,
MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
Bypassing recovery for database 'test2' because it is marked IN LOAD.
Starting up database 'test2'.
Recovery is checkpointing database 'test2' (58)
"Immy" wrote:

> Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQL
> and not the Gui.
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
>
>
|||So - to clarify, you did a full backup of your database, then copy the
database to a new location and then restore it?
What happens if you restore the backup on the same server that the backup
was taken from?
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...[vbcol=seagreen]
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
>
> "Immy" wrote:
|||And obviously I mean in a different DB name and not over the existing one ;)
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...[vbcol=seagreen]
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
>
> "Immy" wrote:
|||"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
Why do you think these are "errors"? The sql server log file contains
messages, some of which may be errors but many of which are not. The
messages you see are standard messages that indicate a successful restore
(btw - I don't think you posted all the relevant messages since there should
be a "Database restored: Database: <dbname>, creation ..." message.
|||I want to make sure the "IN LOAD" messages that I am getting will not create
any issues in the future. Do you know of any potential problems I could face
when getting this "IN LOAD" message
"Scott Morris" wrote:

> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> Why do you think these are "errors"? The sql server log file contains
> messages, some of which may be errors but many of which are not. The
> messages you see are standard messages that indicate a successful restore
> (btw - I don't think you posted all the relevant messages since there should
> be a "Database restored: Database: <dbname>, creation ..." message.
>
>
|||For this test, I took a backup, then restored it to a new database. When I
did that I got the error.
I am only working with 1 server so I did restore the backup on the same
server that the backup was taken from.
#2 - Most of the time, I need to restore a backup (from another DB) to an
existing database. I was using the GUI for this also. I think that may be
why I am having these messages in the log.
Can you give me an idea for the #2 scenario above what my RESTORE DATABASE
options should be?
Thanks for your help with this.
"Immy" wrote:

> So - to clarify, you did a full backup of your database, then copy the
> database to a new location and then restore it?
> What happens if you restore the backup on the same server that the backup
> was taken from?
>
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>
>
|||No I didn't post all the messages. The database did successfully restore. I
want to understand what I am doing wrong when restoring these databases so
the messages are not written to the log. Most of the time I am taking a
backup of 1 database and restoring it to another existing DB. Using the GUI
for the restore.
Any ideas?
"Scott Morris" wrote:

> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> Why do you think these are "errors"? The sql server log file contains
> messages, some of which may be errors but many of which are not. The
> messages you see are standard messages that indicate a successful restore
> (btw - I don't think you posted all the relevant messages since there should
> be a "Database restored: Database: <dbname>, creation ..." message.
>
>

Marked "IN LOAD" messages

I do restores on a daily basis. The restores are taken from DISK backups. I
am not using backup devices.
I am noticing all these errors in the log file:
Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
When I do the restore, I am using the gui (rt click on database, select
restore).
Sometimes I need to restore over an existing DB, other times I restore to a
new database.
Any ideas? I want to make sure I am doing the restores correctly and remove
these errorsIs it possible if I do not specify "Force over existing Database" that it can
cause this error?
"Kristen" wrote:
> I do restores on a daily basis. The restores are taken from DISK backups. I
> am not using backup devices.
> I am noticing all these errors in the log file:
> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
> When I do the restore, I am using the gui (rt click on database, select
> restore).
> Sometimes I need to restore over an existing DB, other times I restore to a
> new database.
> Any ideas? I want to make sure I am doing the restores correctly and remove
> these errors|||Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQL
and not the Gui.
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
> Is it possible if I do not specify "Force over existing Database" that it
> can
> cause this error?
> "Kristen" wrote:
>> I do restores on a daily basis. The restores are taken from DISK
>> backups. I
>> am not using backup devices.
>> I am noticing all these errors in the log file:
>> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
>> When I do the restore, I am using the gui (rt click on database, select
>> restore).
>> Sometimes I need to restore over an existing DB, other times I restore to
>> a
>> new database.
>> Any ideas? I want to make sure I am doing the restores correctly and
>> remove
>> these errors|||I tried doing it in TSQL......didn't work
RESTORE DATABASE test2
FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
WITH RECOVERY,
MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
Bypassing recovery for database 'test2' because it is marked IN LOAD.
Starting up database 'test2'.
Recovery is checkpointing database 'test2' (58)
"Immy" wrote:
> Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQL
> and not the Gui.
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
> > Is it possible if I do not specify "Force over existing Database" that it
> > can
> > cause this error?
> >
> > "Kristen" wrote:
> >
> >> I do restores on a daily basis. The restores are taken from DISK
> >> backups. I
> >> am not using backup devices.
> >> I am noticing all these errors in the log file:
> >> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
> >> When I do the restore, I am using the gui (rt click on database, select
> >> restore).
> >> Sometimes I need to restore over an existing DB, other times I restore to
> >> a
> >> new database.
> >> Any ideas? I want to make sure I am doing the restores correctly and
> >> remove
> >> these errors
>
>|||So - to clarify, you did a full backup of your database, then copy the
database to a new location and then restore it?
What happens if you restore the backup on the same server that the backup
was taken from?
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
>
> "Immy" wrote:
>> Try using the 'WITH RECOVERY' OPTION and issue the restore command via
>> TSQL
>> and not the Gui.
>> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
>> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
>> > Is it possible if I do not specify "Force over existing Database" that
>> > it
>> > can
>> > cause this error?
>> >
>> > "Kristen" wrote:
>> >
>> >> I do restores on a daily basis. The restores are taken from DISK
>> >> backups. I
>> >> am not using backup devices.
>> >> I am noticing all these errors in the log file:
>> >> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
>> >> When I do the restore, I am using the gui (rt click on database,
>> >> select
>> >> restore).
>> >> Sometimes I need to restore over an existing DB, other times I restore
>> >> to
>> >> a
>> >> new database.
>> >> Any ideas? I want to make sure I am doing the restores correctly and
>> >> remove
>> >> these errors
>>|||And obviously I mean in a different DB name and not over the existing one ;)
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
>
> "Immy" wrote:
>> Try using the 'WITH RECOVERY' OPTION and issue the restore command via
>> TSQL
>> and not the Gui.
>> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
>> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
>> > Is it possible if I do not specify "Force over existing Database" that
>> > it
>> > can
>> > cause this error?
>> >
>> > "Kristen" wrote:
>> >
>> >> I do restores on a daily basis. The restores are taken from DISK
>> >> backups. I
>> >> am not using backup devices.
>> >> I am noticing all these errors in the log file:
>> >> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
>> >> When I do the restore, I am using the gui (rt click on database,
>> >> select
>> >> restore).
>> >> Sometimes I need to restore over an existing DB, other times I restore
>> >> to
>> >> a
>> >> new database.
>> >> Any ideas? I want to make sure I am doing the restores correctly and
>> >> remove
>> >> these errors
>>|||"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
Why do you think these are "errors"? The sql server log file contains
messages, some of which may be errors but many of which are not. The
messages you see are standard messages that indicate a successful restore
(btw - I don't think you posted all the relevant messages since there should
be a "Database restored: Database: <dbname>, creation ..." message.|||I want to make sure the "IN LOAD" messages that I am getting will not create
any issues in the future. Do you know of any potential problems I could face
when getting this "IN LOAD" message
"Scott Morris" wrote:
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> >I tried doing it in TSQL......didn't work
> >
> > RESTORE DATABASE test2
> > FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> > WITH RECOVERY,
> > MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> > MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> >
> > Bypassing recovery for database 'test2' because it is marked IN LOAD.
> > Starting up database 'test2'.
> > Recovery is checkpointing database 'test2' (58)
> Why do you think these are "errors"? The sql server log file contains
> messages, some of which may be errors but many of which are not. The
> messages you see are standard messages that indicate a successful restore
> (btw - I don't think you posted all the relevant messages since there should
> be a "Database restored: Database: <dbname>, creation ..." message.
>
>|||For this test, I took a backup, then restored it to a new database. When I
did that I got the error.
I am only working with 1 server so I did restore the backup on the same
server that the backup was taken from.
#2 - Most of the time, I need to restore a backup (from another DB) to an
existing database. I was using the GUI for this also. I think that may be
why I am having these messages in the log.
Can you give me an idea for the #2 scenario above what my RESTORE DATABASE
options should be?
Thanks for your help with this.
"Immy" wrote:
> So - to clarify, you did a full backup of your database, then copy the
> database to a new location and then restore it?
> What happens if you restore the backup on the same server that the backup
> was taken from?
>
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> >I tried doing it in TSQL......didn't work
> >
> > RESTORE DATABASE test2
> > FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> > WITH RECOVERY,
> > MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> > MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> >
> > Bypassing recovery for database 'test2' because it is marked IN LOAD.
> > Starting up database 'test2'.
> > Recovery is checkpointing database 'test2' (58)
> >
> >
> > "Immy" wrote:
> >
> >> Try using the 'WITH RECOVERY' OPTION and issue the restore command via
> >> TSQL
> >> and not the Gui.
> >>
> >> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> >> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
> >> > Is it possible if I do not specify "Force over existing Database" that
> >> > it
> >> > can
> >> > cause this error?
> >> >
> >> > "Kristen" wrote:
> >> >
> >> >> I do restores on a daily basis. The restores are taken from DISK
> >> >> backups. I
> >> >> am not using backup devices.
> >> >> I am noticing all these errors in the log file:
> >> >> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
> >> >> When I do the restore, I am using the gui (rt click on database,
> >> >> select
> >> >> restore).
> >> >> Sometimes I need to restore over an existing DB, other times I restore
> >> >> to
> >> >> a
> >> >> new database.
> >> >> Any ideas? I want to make sure I am doing the restores correctly and
> >> >> remove
> >> >> these errors
> >>
> >>
> >>
>
>|||No I didn't post all the messages. The database did successfully restore. I
want to understand what I am doing wrong when restoring these databases so
the messages are not written to the log. Most of the time I am taking a
backup of 1 database and restoring it to another existing DB. Using the GUI
for the restore.
Any ideas?
"Scott Morris" wrote:
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> >I tried doing it in TSQL......didn't work
> >
> > RESTORE DATABASE test2
> > FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> > WITH RECOVERY,
> > MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> > MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> >
> > Bypassing recovery for database 'test2' because it is marked IN LOAD.
> > Starting up database 'test2'.
> > Recovery is checkpointing database 'test2' (58)
> Why do you think these are "errors"? The sql server log file contains
> messages, some of which may be errors but many of which are not. The
> messages you see are standard messages that indicate a successful restore
> (btw - I don't think you posted all the relevant messages since there should
> be a "Database restored: Database: <dbname>, creation ..." message.
>
>|||If I do RESTORE DATABASE test WITH RECOVERY
it doesn't actually do a restore from a backup...it just sets the RECOVERY
option correct?
"Immy" wrote:
> Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQL
> and not the Gui.
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
> > Is it possible if I do not specify "Force over existing Database" that it
> > can
> > cause this error?
> >
> > "Kristen" wrote:
> >
> >> I do restores on a daily basis. The restores are taken from DISK
> >> backups. I
> >> am not using backup devices.
> >> I am noticing all these errors in the log file:
> >> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
> >> When I do the restore, I am using the gui (rt click on database, select
> >> restore).
> >> Sometimes I need to restore over an existing DB, other times I restore to
> >> a
> >> new database.
> >> Any ideas? I want to make sure I am doing the restores correctly and
> >> remove
> >> these errors
>
>|||"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:D9C48AE9-91FC-4752-94CB-0428A569F826@.microsoft.com...
> No I didn't post all the messages. The database did successfully restore.
> I
> want to understand what I am doing wrong when restoring these databases so
> the messages are not written to the log. Most of the time I am taking a
> backup of 1 database and restoring it to another existing DB. Using the
> GUI
> for the restore.
> Any ideas?
There isn't anything wrong and you can't directly control these messages.
These messages are not errors. Again, not everything written to the log is
an error.

Marked "IN LOAD" messages

I do restores on a daily basis. The restores are taken from DISK backups.
I
am not using backup devices.
I am noticing all these errors in the log file:
Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
When I do the restore, I am using the gui (rt click on database, select
restore).
Sometimes I need to restore over an existing DB, other times I restore to a
new database.
Any ideas? I want to make sure I am doing the restores correctly and remove
these errorsIs it possible if I do not specify "Force over existing Database" that it ca
n
cause this error?
"Kristen" wrote:

> I do restores on a daily basis. The restores are taken from DISK backups.
I
> am not using backup devices.
> I am noticing all these errors in the log file:
> Bypassing recovery for database 'xxxxx' because it is marked IN LOAD.
> When I do the restore, I am using the gui (rt click on database, select
> restore).
> Sometimes I need to restore over an existing DB, other times I restore to
a
> new database.
> Any ideas? I want to make sure I am doing the restores correctly and remo
ve
> these errors|||Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQL
and not the Gui.
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...[vbcol=seagreen]
> Is it possible if I do not specify "Force over existing Database" that it
> can
> cause this error?
> "Kristen" wrote:
>|||I tried doing it in TSQL......didn't work
RESTORE DATABASE test2
FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
WITH RECOVERY,
MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
Bypassing recovery for database 'test2' because it is marked IN LOAD.
Starting up database 'test2'.
Recovery is checkpointing database 'test2' (58)
"Immy" wrote:

> Try using the 'WITH RECOVERY' OPTION and issue the restore command via TSQ
L
> and not the Gui.
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:9FE4EEAE-6332-4F67-BA23-6D1AA00878D3@.microsoft.com...
>
>|||So - to clarify, you did a full backup of your database, then copy the
database to a new location and then restore it?
What happens if you restore the backup on the same server that the backup
was taken from?
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...[vbcol=seagreen]
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
>
> "Immy" wrote:
>|||And obviously I mean in a different DB name and not over the existing one ;)
"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...[vbcol=seagreen]
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
>
> "Immy" wrote:
>|||"Kristen" <Kristen@.discussions.microsoft.com> wrote in message
news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>I tried doing it in TSQL......didn't work
> RESTORE DATABASE test2
> FROM DISK = 'E:\MSSQL\Backup\LVTS_Min_03122007.bak'
> WITH RECOVERY,
> MOVE 'LVTS_Min_Data' TO 'E:\MSSQL\Backup\test2_data.mdf',
> MOVE 'LVTS_Min_Log' TO 'E:\MSSQL\Backup\test2_log.ldf'
> Bypassing recovery for database 'test2' because it is marked IN LOAD.
> Starting up database 'test2'.
> Recovery is checkpointing database 'test2' (58)
Why do you think these are "errors"? The sql server log file contains
messages, some of which may be errors but many of which are not. The
messages you see are standard messages that indicate a successful restore
(btw - I don't think you posted all the relevant messages since there should
be a "Database restored: Database: <dbname>, creation ..." message.|||I want to make sure the "IN LOAD" messages that I am getting will not create
any issues in the future. Do you know of any potential problems I could fac
e
when getting this "IN LOAD" message
"Scott Morris" wrote:

> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> Why do you think these are "errors"? The sql server log file contains
> messages, some of which may be errors but many of which are not. The
> messages you see are standard messages that indicate a successful restore
> (btw - I don't think you posted all the relevant messages since there shou
ld
> be a "Database restored: Database: <dbname>, creation ..." message.
>
>|||For this test, I took a backup, then restored it to a new database. When I
did that I got the error.
I am only working with 1 server so I did restore the backup on the same
server that the backup was taken from.
#2 - Most of the time, I need to restore a backup (from another DB) to an
existing database. I was using the GUI for this also. I think that may be
why I am having these messages in the log.
Can you give me an idea for the #2 scenario above what my RESTORE DATABASE
options should be?
Thanks for your help with this.
"Immy" wrote:

> So - to clarify, you did a full backup of your database, then copy the
> database to a new location and then restore it?
> What happens if you restore the backup on the same server that the backup
> was taken from?
>
> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
>
>|||No I didn't post all the messages. The database did successfully restore.
I
want to understand what I am doing wrong when restoring these databases so
the messages are not written to the log. Most of the time I am taking a
backup of 1 database and restoring it to another existing DB. Using the GUI
for the restore.
Any ideas?
"Scott Morris" wrote:

> "Kristen" <Kristen@.discussions.microsoft.com> wrote in message
> news:5365DC0E-0F94-4109-A028-E775E00E8A10@.microsoft.com...
> Why do you think these are "errors"? The sql server log file contains
> messages, some of which may be errors but many of which are not. The
> messages you see are standard messages that indicate a successful restore
> (btw - I don't think you posted all the relevant messages since there shou
ld
> be a "Database restored: Database: <dbname>, creation ..." message.
>
>

Mark duplicate records in a Select statement ?

I have a requirement to mark duplicate records when I pull them from the database.

However, I only want to mark the 2nd, 3rd, 4th etc record - not the first one.

The code I have below creates a column called Dupes but marks all the duplicates - including the first one.

Is there a way to only mark the 2nd, 3rd, 4th etc record ?


SELECT *, cs.CallStatusDescription as CSRStatusDesc, cs2.CallStatusDescription as CustomerStatusDesc, (Select MAX(CallAttemptNumber)From CallResults cr Where cl.Id = cr.CallLogId) as CallAttemptNumber,

Dupes = (select count(id)
from CallLogs
where (CustomerHomePhone != '' AND cl.CustomerHomePhone = CustomerHomePhone)
OR (CustomerBusinessPhone != '' AND cl.CustomerBusinessPhone = CustomerBusinessPhone)
AND DealerId= 'hdsh'
AND CSRStatus IS NULL
and datediff(d, logdate, getdate()) <= 21),

FROM CallLogs cl
left Join CallStatus cs on cs.Id = cl.CSRstatus
left Join CallStatus cs2 on cs2.Id = cl.Customerstatus
Where SaleStage IN ('1', '2', '3', '4', '5', '6') And (LogProcessFlag = 1 Or LogProcessFlag = 0)
And DealerId='hdsh'
And Logdate Between '08/01/2007' And '08/31/2007'

Can't you just decrement the 'count' statement by 1 before assigning it to Dupes?

1Dupes = (SELECTcount(id)
2FROM CallLogs
3WHERE(CustomerHomePhone !=''AND cl.CustomerHomePhone = CustomerHomePhone)
4 OR (CustomerBusinessPhone !=''AND cl.CustomerBusinessPhone = CustomerBusinessPhone)
5AND DealerId='hdsh'
6 AND CSRStatusISNULL
7 ANDdatediff(d, logdate,getdate()) <= 21))- 1
That way it just accounts for itself by subtracting 1 from the total 
|||

The problem is that both records get the same Dupe number.

I need the 2nd "dupe" to be marked as 2, the 3rd "dupe" to be marked as 3 etc

Mark a textbox "not for data-csv export"

Is it possible to mark a textbox in a report to not be exported to csv. This
would be similar to the "Data Output" tab for textboxes - but for csv instead
of xml?Setting the DataElementOutput value affects all "data-centric" rendering
extensions. I.e. CSV and XML. You cannot control CSV specifically in this
case.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"DBA72" <DBA72@.discussions.microsoft.com> wrote in message
news:F6027B38-C0C4-4C89-B9B2-5CCD6A33987B@.microsoft.com...
> Is it possible to mark a textbox in a report to not be exported to csv.
> This
> would be similar to the "Data Output" tab for textboxes - but for csv
> instead
> of xml?sql

Mark a linie anyone

Is it possible to change the background color for a tablerow if you click on
a field, so that it is easier to see the data when there are many columns.
I tried this on the visibilty button on a field but it says tablerow2 is not
declared
=TableRow2.BackgroundColor.Value = "Silver";
----
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 38295 spam-mails
Betalende brugere får ikke denne besked i deres e-mails.
Hent en gratis SPAMfighter her.Event driven is provided just for hyperlinks and there is no such provision
for background color.
Amarnath
"CRM Master" wrote:
> Is it possible to change the background color for a tablerow if you click on
> a field, so that it is easier to see the data when there are many columns.
> I tried this on the visibilty button on a field but it says tablerow2 is not
> declared
> =TableRow2.BackgroundColor.Value = "Silver";
>
>
>
> ----
> Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
> Den har indtil videre sparet mig for at få 38295 spam-mails
> Betalende brugere får ikke denne besked i deres e-mails.
> Hent en gratis SPAMfighter her.
>
>

Margin rendering

When running a SSRS 2005 Report on local machines (running Windows XP) A certain Textbox Label is not wrapping and is sized with .25 inch blank spacing at the end of the text. When running thru a datadriven Subscription this label is wrapping to next line on the PDF file that is produced.

We went to the SSRS 2005 server( Windows server 2003) and opened the report and it shows this label wrapping and the text is not fitting in the label box. But on every client box that we open this report on it shows it not wrapping. Is there a setting on the Server that we need to set for this report to render correctly.

Hi Brad,

A couple questions for you:

1) Are all machines running the same version of SSRS?

2) Are you exporting to PDF in all cases?

3) Do the various servers on which the different reports run have differing DPI settings?

Many thanks,

Chris

Margin and Paper Orientation programmatically

Hello.

I have a report but by default it prints Portrait and 1.0inch Margin. I would like to programmatically set the values of my report to 0.2 inch margin and Landscape. I am using RDLC (Local Report).

Does anyone has an idea how to achieve this?

Jose

Pls try, Report ->properties ->layout.

Over here u cans et margins as well as width and height of the report.

|||

Report -> Properties -> Layout does not exists.

i don't think it has something to do with the report itself, but the PrintDoc related to the Report Control.

Based on my analysis, The Report Control MIGHT create a PrintDoc on the fly and set the Rendered Report to it. So, i guess we could try to trap that PrintDoc before is sent to Printer.

But, so far... i can't find the "way" to "meet up" with this PrintDoc chic.

Any other suggestion?

|||

Ok. I see what you mean now. Those Margins and Padding are related to the Control itself. For example, any other control inside the Reprt Control. It's like <Table> in HTML. You can set Margins and Paddings of its cells for other controls inside.

Well... i keep on looking a solution.... I trapped the Print Event but nothing about any hint to set Printing Margin and Orientation... Sad

|||

I found this solution but still is not what i am looking for. So far this solution only works with IMAGE output and it's really messy. So, i'll try to figure out what to do.

http://blogs.msdn.com/bryanke/articles/71491.aspx

Nobody can help please?

Mappings question in OLE DB Destination

Hi,

I have a situation where I want to map a column from a flat file to TWO columns in a table.

However, in the mappings tab, you can only select the "Input Column" once. Once a column has been used, it no longer appears in the drop down list.

I am wondering if there's a way to override this behavior, and if not, what is the best way to handle this type of situation?

I have added an EXECUTE SQL task to update the second column with the inserted column values, but I would like to know if the default mapping behavior can be changed, as it seems so limited.

Thanks

Add a derived column right before the destination and select the column that you want to use more than once and drag it to the expression box. Adjust the name of the new column accordingly.

Then in the OLE DB Destination you can select the column you just added.

Feel free to suggest new features over at http://connect.microsoft.com/sqlserver/feedback|||

Great, thanks

sql

Mappings in the packages

Hi all,

Is it possible to get information of the mappings availabe in the packages?, like the column mappings in the OLE Destination control, column mappings in the merge join control etc.,. I want the information of source and destination in the mappings(name of the DB, table). I want that to be in some file like excel file. Inform me is there a way to get it?

Thanks in advance,

Saravanan.W.S

Currently there is not way to export that kind of mapping metadata to Excel. Depending on your needs, however, you may find the SQL Server 2005 Business Intelligence Metadata Samples Toolkit useful. You can download it here ...

http://www.microsoft.com/downloads/details.aspx?FamilyID=11DAA4D1-196D-4F2A-B18F-891579C364F4&displaylang=en

Donald

mapping XML data to variable

I can’t figure out how to map xml data stored in a table to a variable in integration service.

For example:
I would like to use a “for each loop container” to iterate through a row set selected from database. Each row has three columns, an integer, a string and an xml data. In the variable mappings, I can map the integer column and the string column to a variable with type of int and a variable with type of string. But I am having trouble to map the xml data column to any variable. I tried using either a string variable or object. It always reports error like “variable mapping number X to variable XXX can’t apply”.

Any help?

This is a supported scenario. Ensure that:

The column is actually being loaded into the record set: Check the column mappings in the recordset dest The value being mapped to the variable is less than 4000 characters long: select max(datalength(xmlCol)) from XmlTable

mapping Windows credentials to access linked server

Hi all,
I have linked SQL Server "SRV2" to SQL Server "SRV1" through
sp_addlinkedserver.
In my scenario, Windows user "U1" has access to "SRV1" while Windows
user "U2" has access to "SRV2".
Whenever I access "SRV1" as "U1" and execute a distributed query which
involves "SRV2", I would like "U1" to be mapped to "U2" for accessing
"SRV2".
Does anyone know whether this is possible and how?
I know that I can pass-through "U1" credentials to "SRV2" with
delegation and the default mapping, or map "U1" to a SQL User "sqlU2"
that can access "SRV2".
However what I would like to do is to map Windows user "U1" to Windows
user "U2".
I am using SQL Server 2005 which comes with Visual Studio Beta2.
Thanks in advance for any help,
-GianlucaHi
As fas as I know you will have to create a new login in "SRV2". with the
same permissions.
"Gianluca Torta" <giatorta@.hotmail.com> wrote in message
news:1121206171.989233.19240@.f14g2000cwb.googlegroups.com...
> Hi all,
> I have linked SQL Server "SRV2" to SQL Server "SRV1" through
> sp_addlinkedserver.
> In my scenario, Windows user "U1" has access to "SRV1" while Windows
> user "U2" has access to "SRV2".
> Whenever I access "SRV1" as "U1" and execute a distributed query which
> involves "SRV2", I would like "U1" to be mapped to "U2" for accessing
> "SRV2".
> Does anyone know whether this is possible and how?
> I know that I can pass-through "U1" credentials to "SRV2" with
> delegation and the default mapping, or map "U1" to a SQL User "sqlU2"
> that can access "SRV2".
> However what I would like to do is to map Windows user "U1" to Windows
> user "U2".
> I am using SQL Server 2005 which comes with Visual Studio Beta2.
> Thanks in advance for any help,
> -Gianluca
>

Mapping Variables to Resultsets

Is there a problem mapping variables to resultsets with a bigint as datatype?
I've tried using int64, and others, but all fail except for object datatype.
I cant use object datatype because i wont be able to use it as a derived column.

Any ideas here?

Is this a bug in the current SSIS (bigint casting to variable)?
If i modified the table structure to int and the variable to int32, it works fine.|||Is this on Windows 2000, by any chance?|||It's on Windows XP.
Thanks.|||

Big integers are returned now as strings. So if you choose your variable as a string variable you should be able to get the result correctly. This will probably change. soon.

|||This no longer seems to be the case and only maps to "object." Why is this and when will it be fixed?|||I submitted a Connect bug on this some time ago (https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=260967), and they've indicated that it was on the work list for Katmai (SQL Server 2008). I just tested against the November CTP and selecting a bigint column and storing it in an Int64 variable works.

Mapping Variables to Resultsets

Is there a problem mapping variables to resultsets with a bigint as datatype?
I've tried using int64, and others, but all fail except for object datatype.
I cant use object datatype because i wont be able to use it as a derived column.

Any ideas here?

Is this a bug in the current SSIS (bigint casting to variable)?
If i modified the table structure to int and the variable to int32, it works fine.
|||Is this on Windows 2000, by any chance?|||It's on Windows XP.
Thanks.
|||

Big integers are returned now as strings. So if you choose your variable as a string variable you should be able to get the result correctly. This will probably change. soon.

|||This no longer seems to be the case and only maps to "object." Why is this and when will it be fixed?sql

Mapping User Defined Data Type to Base Data Type

Hi,

I am trying to map a user-defined datatype to it's base data type in SQL Server 2000/2005. Let's say I have created a udt named ssn which is actually a char datatype with length 9. I need a query that would map the udt with the base datatype and give the typename of both. I have been using the sys.types table but I still can't see the link. Any help would be appreciated.

Thanks

Here is an Information_Schema view that I created a long time ago in my databases. Most of it I actually copied from a sql 2000 system sproc. You should be able to use it to construct what you need:

SELECT TOP 100 PERCENT
*,
ColumnName + ' ' +
UsedDataType +
CASE WHEN UserDefinedDataType IS NULL THEN
CASE WHEN collationID IS NOT NULL THEN
'('+CAST(CharacterMaxLength AS VARCHAR(10))+')'
ELSE ''
END
ELSE
''
END
AS ColumnDefinition,
ColumnName + ' ' +
UPPER(basedatatype) +
CASE WHEN collationID IS NOT NULL THEN '('+CAST(CharacterMaxLength AS VARCHAR(10))+')' ELSE '' END
AS ColumnDefinition2,
UsedDataType +
CASE WHEN UserDefinedDataType IS NULL THEN
CASE WHEN collationID IS NOT NULL THEN
'('+CAST(CharacterMaxLength AS VARCHAR(10))+')'
ELSE ''
END
ELSE
''
END
AS DefinedDataType
FROM
(
SELECT
DB_NAME() AS DatabaseName,
CASE obj.xtype WHEN 'U' THEN 'TABLE' WHEN 'V' THEN 'VIEW' WHEN 'P' THEN 'PROCEDURE' END AS ObjectType,
USER_NAME(obj.uid) AS TableSchema,
obj.name AS TableName,
col.name AS ColumnName,
col.colid AS ColumnPosition,
com.text AS DefaultValue,
CASE col.isnullable WHEN 1 THEN 'YES' ELSE 'NO' end AS IsNullable,
spt_dtp.LOCAL_TYPE_NAME AS BaseDataType,
CASE WHEN typ.xusertype > 256 THEN typ.name ELSE UPPER(typ.name) END AS UsedDataType,
CONVERT(INT, OdbcPrec(col.xtype, col.length, col.xprec) + spt_dtp.charbin) AS CharacterMaxLength,
NULLIF(col.xprec, 0) AS NumericPrecision,
col.scale AS NumericScale,
CONVERT(SYSNAME, CASE WHEN typ.xusertype > 256 THEN typ.name ELSE NULL END) AS UserDefinedDataType,
OBJECT_NAME(cdefault) AS ColumnDefaultName ,
typ.CollationID
FROM
sysobjects obj,
master.dbo.spt_datatype_info spt_dtp,
systypes typ,
syscolumns col
LEFT OUTER JOIN syscomments com on col.cdefault = com.id AND com.colid = 1,
master.dbo.syscharsets a_cha
WHERE
obj.id = col.id AND
typ.xtype = spt_dtp.ss_dtype AND
(spt_dtp.ODBCVer is null or spt_dtp.ODBCVer = 2) AND
obj.xtype in ('U', 'V', 'P') AND
col.xusertype = typ.xusertype AND
(
spt_dtp.AUTO_INCREMENT IS NULL OR spt_dtp.AUTO_INCREMENT = 0) AND
a_cha.id = ISNULL(CONVERT(TINYINT, CollationPropertyFromID(col.collationid, 'sqlcharset')),
CONVERT(TINYINT, ServerProperty('sqlcharset'))
) and obj.type = 'u'

) a
ORDER BY
TableName, ColumnPosition ASC

Mapping UDF Parameters to Variables

As mentioned in a previous posting, I have an in-line table valued UDF with three input parameters. I can set this up as an OLEDB Datasource SQL Command Text with parameter markers (i.e. "?") and test it successfully in the Generic Query Builder. The parameter markers are correctly associated with the input parameters of the UDF and the parameters can be entered at execution time into a parameters table.

So near and yet so far. When I attempt to map the parameter markers with Package Variables there is an error message saying the the parameter details cannot be retrieved from the function. If the function was in a foriegn (e.g. Oracle) database I might accept this as just one of those things but this is a SQL 2005 database and compatability should be complete. Add to this that the Generic Query Builder has no problem with the same UDF and nor does Reporting Services and I have to assume that this is a bug plain and simple.

The only solution that I have seen suggested is to embed the SQL Command text in a Package Variable and change it at execution time but I regard this as a second rate solution.

Dick,

This doesn't help you, but I think there IS a bug with the OLEDB data source and passing variables. I have exactly the same issue with a simple query to a Microsoft FoxPro data source (which I've brought to this forum before and got no solution).

I went with the package variable solution - it's not as elegant but it works

Do you know where we should post bug reports for SQL 2005?

Rich

|||

Thanks Rich,

It's some consolation the hear from someone else about the problem. Foxpro is a "foriegn" application (albiet a Microsoft one). It's the fact that the problem occurs within SQL Server 2005 that is a bit of a surprise. Add to this the fact that Reporting Services seems to handle UDF parameters correctly (indicating that there is no reason why it shouldn't work) and it is a bit frustrating.

As you say contructing the entire SQL Command Text as a Package Variable is a work around but this is not really what was intended, Mapping Package Variables to parameter markers is more within the spirit of SSIS and much nicer. It seems to work with Stored Procedures for example.

My company has links with MS so I will try to find out on Monday how to officially report this.

Best regards,

Dick Campbell

Mapping two schema definitions to one column

Hi,
I have a xml data file that looks like this
<CT_DATASET>
<DATE-INTERVENTIONDATE>
<YEARS>0</YEARS>
<MONTHS>0</MONTHS>
<DAYS>-1</DAYS>
</DATE-INTERVENTIONDATE>
<DESCTEXT>Preoperative CT Diagnosis</DESCTEXT>
<NUMBER_OF_SLICES>58</NUMBER_OF_SLICES>
<DICOM_TAGS>
<TAGNR>00080014</TAGNR>
<TAGVALUE>1.2.840.113701.4.2.102</TAGVALUE>
</DICOM_TAGS>
<DICOM_TAGS>
<TAGNR>00080016</TAGNR>
<TAGVALUE>1.2.840.10008.5.1.4.1.1.4</TAGVALUE>
</DICOM_TAGS>
<DICOM_TAGS>
<TAGNR>00080018</TAGNR>
<TAGVALUE>1.2.840.113701.4.2.102.0.2187.8.1.0.7</TAGVALUE>
</DICOM_TAGS>
<DICOM_TAGS>
<TAGNR>00080070</TAGNR>
<TAGVALUE>Toshiba </TAGVALUE>
</DICOM_TAGS>
</CT_DATASET>
And I want to map the multiple tagnr and tagvalue to one column for the
patient.
My schema file looks liek this:
<xs:element name="CT_DATASET" sql:relation="CT_DATA"
sql:overflow-field="ADDITIONAL">
<xs:complexType>
<xs:sequence>
<xs:element ref="DATE-INTERVENTIONDATE" />
<xs:element ref="DESCTEXT" />
<xs:element ref="NUMBER_OF_SLICES" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="DICOM_TAGS" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NUMBER_OF_SLICES" type="xs:string" />
<xs:element name="DICOM_TAGS" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="TAGNR"/>
<xs:element ref="TAGVALUE"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATE-INTERVENTIONDATE" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="YEARS" />
<xs:element ref="MONTHS" />
<xs:element ref="DAYS" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DESCTEXT" type="xs:string"/>
<xs:element name="YEARS" type="xs:string" sql:field="years"/>
<xs:element name="MONTHS" type="xs:string" sql:field="months" />
<xs:element name="DAYS" type="xs:string" sql:field="days"/>
<xs:element name="TAGNR" sql:field="TAG_NO:"/>
<xs:element name="TAGVALUE" sql:field="TAG VALUE"/>
</xs:schema>
I get an error which says:
Data mapping to column 'TAG_NO' was already found in the data. Make
sure that no two schema definitions map to the same column.
Does anybody know a way around. Any help would be appreciated. Please
do help!!!Hello Prakruthi,
Are you trying to use this as a validation schema in an XML Schema collectio
n
or a XDR for mapping queries?

> I get an error which says:
> Data mapping to column 'TAG_NO' was already found in the data. Make
> sure that no two schema definitions map to the same column.
> Does anybody know a way around. Any help would be appreciated. Please
> do help!!!
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Hi Kent,
Im trying to use this as a validation schema. And as you can see from
the xml data , each patient has multiple dicom tags and numbers. I want
to be able to map all these numbers into a single column. Is this
possible?|||Hi Kent,
I forgot to mention that Tag Numbers and Tag values are two separate
columns. But each column should be able to have multiple values.
Regards,
Prakruthi|||Hello Prakruthi,
Part of problem is that the schema you posted isn't a valid XSD schema:
a. The sql namespace (aliased by sql:) isn't defined by your schema.
b. The schema has some other problems, so I rewrote it -- sans the SQL parts
since I'm not sure what these are or do in your processor.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="q
ualified">
<xs:element name="CT_DATASET">
<xs:complexType>
<xs:sequence>
<xs:element name="DATE-INTERVENTIONDATE">
<xs:complexType>
<xs:sequence>
<xs:element name="YEARS" type="xs:string"/>
<xs:element name="MONTHS" type="xs:string"/>
<xs:element name="DAYS" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DESCTEXT" type="xs:string"/>
<xs:element name="NUMBER_OF_SLICES" type="xs:string"/>
<xs:element ref="DICOM_TAGS" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DICOM_TAGS">
<xs:complexType>
<xs:sequence>
<xs:element ref="TAGNR"/>
<xs:element ref="TAGVALUE"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TAGNR" type="xs:string"/>
<xs:element name="TAGVALUE" type="xs:string"/>
</xs:schema>
I was able to catalog is into a SQL Sever 2005 XML Schema Collection succesf
ully.
Does any of that help?
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Dear Kent,
Thanks for reorganising my schema in the right manner. But I dont think
you understood what I meant to say. Even when I used your modified
schema I could not map the three tagnr and tagvalues associated with
one one single patient into the tagnr and tagvalue column.I get an
error that says
Data mapping to column 'TAG_NO' was already found in the data. Make
sure that no two schema definitions map to the same column.
Is it not possible to map three different values to one column of the
same row? I hope you can help me out again this time.
Regards,
Prakruthi|||Hello Prakruthi,
That's why I asked if you were using this an mapping schema or as a validati
on
schema. You said "validation," so I fixed it for that. However, I don't beli
eve
you can target more than one value into a column using a single mapping.
Sadly, I don't have the time to work on this today before going on the road
for the next couple of w. However, it looks like Michael is back online,
so he might be able to help more.:)

> Thanks for reorganising my schema in the right manner. But I dont
> think
> you understood what I meant to say. Even when I used your modified
> schema I could not map the three tagnr and tagvalues associated with
> one one single patient into the tagnr and tagvalue column.I get an
> error that says
> Data mapping to column 'TAG_NO' was already found in the data. Make
> sure that no two schema definitions map to the same column.
> Is it not possible to map three different values to one column of the
> same row? I hope you can help me out again this time.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Hi Kent,
I wanted to say im not using it as a validation schema. I apologise for
the typo error. I hope micheal would help me out with this issue.
Regards,
Prakruthi|||Hi Kent,
I wanted to say im not using it as a validation schema. I apologise for
the typo error. I hope micheal would help me out with this issue.
Regards,
Prakruthi|||I have forwarded it to our mapping schema experts and I hope they will get
back to you.
Ping me if that is not the case.
Michael
"Prakruthi" <prakruthi.rao@.gmail.com> wrote in message
news:1143210046.980577.250430@.e56g2000cwe.googlegroups.com...
> Hi Kent,
> I wanted to say im not using it as a validation schema. I apologise for
> the typo error. I hope micheal would help me out with this issue.
> Regards,
> Prakruthi
>

Mapping two schema definitions to one column

Hi,
I have a xml data file that looks like this
<CT_DATASET>
<DATE-INTERVENTIONDATE>
<YEARS>0</YEARS>
<MONTHS>0</MONTHS>
<DAYS>-1</DAYS>
</DATE-INTERVENTIONDATE>
<DESCTEXT>Preoperative CT Diagnosis</DESCTEXT>
<NUMBER_OF_SLICES>58</NUMBER_OF_SLICES>
<DICOM_TAGS>
<TAGNR>00080014</TAGNR>
<TAGVALUE>1.2.840.113701.4.2.102</TAGVALUE>
</DICOM_TAGS>
<DICOM_TAGS>
<TAGNR>00080016</TAGNR>
<TAGVALUE>1.2.840.10008.5.1.4.1.1.4</TAGVALUE>
</DICOM_TAGS>
<DICOM_TAGS>
<TAGNR>00080018</TAGNR>
<TAGVALUE>1.2.840.113701.4.2.102.0.2187.8.1.0.7< /TAGVALUE>
</DICOM_TAGS>
<DICOM_TAGS>
<TAGNR>00080070</TAGNR>
<TAGVALUE>Toshiba </TAGVALUE>
</DICOM_TAGS>
</CT_DATASET>
And I want to map the multiple tagnr and tagvalue to one column for the
patient.
My schema file looks liek this:
<xs:element name="CT_DATASET" sql:relation="CT_DATA"
sql:overflow-field="ADDITIONAL">
<xs:complexType>
<xs:sequence>
<xs:element ref="DATE-INTERVENTIONDATE" />
<xs:element ref="DESCTEXT" />
<xs:element ref="NUMBER_OF_SLICES" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="DICOM_TAGS" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NUMBER_OF_SLICES" type="xs:string" />
<xs:element name="DICOM_TAGS" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="TAGNR"/>
<xs:element ref="TAGVALUE"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATE-INTERVENTIONDATE" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="YEARS" />
<xs:element ref="MONTHS" />
<xs:element ref="DAYS" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DESCTEXT" type="xs:string"/>
<xs:element name="YEARS" type="xs:string" sql:field="years"/>
<xs:element name="MONTHS" type="xs:string" sql:field="months" />
<xs:element name="DAYS" type="xs:string" sql:field="days"/>
<xs:element name="TAGNR" sql:field="TAG_NO:"/>
<xs:element name="TAGVALUE" sql:field="TAG VALUE"/>
</xs:schema>
I get an error which says:
Data mapping to column 'TAG_NO' was already found in the data. Make
sure that no two schema definitions map to the same column.
Does anybody know a way around. Any help would be appreciated. Please
do help!!!
Hello Prakruthi,
Are you trying to use this as a validation schema in an XML Schema collection
or a XDR for mapping queries?

> I get an error which says:
> Data mapping to column 'TAG_NO' was already found in the data. Make
> sure that no two schema definitions map to the same column.
> Does anybody know a way around. Any help would be appreciated. Please
> do help!!!
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||Hi Kent,
Im trying to use this as a validation schema. And as you can see from
the xml data , each patient has multiple dicom tags and numbers. I want
to be able to map all these numbers into a single column. Is this
possible?
|||Hi Kent,
I forgot to mention that Tag Numbers and Tag values are two separate
columns. But each column should be able to have multiple values.
Regards,
Prakruthi
|||Hello Prakruthi,
Part of problem is that the schema you posted isn't a valid XSD schema:
a. The sql namespace (aliased by sql isn't defined by your schema.
b. The schema has some other problems, so I rewrote it -- sans the SQL parts
since I'm not sure what these are or do in your processor.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="CT_DATASET">
<xs:complexType>
<xs:sequence>
<xs:element name="DATE-INTERVENTIONDATE">
<xs:complexType>
<xs:sequence>
<xs:element name="YEARS" type="xs:string"/>
<xs:element name="MONTHS" type="xs:string"/>
<xs:element name="DAYS" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DESCTEXT" type="xs:string"/>
<xs:element name="NUMBER_OF_SLICES" type="xs:string"/>
<xs:element ref="DICOM_TAGS" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DICOM_TAGS">
<xs:complexType>
<xs:sequence>
<xs:element ref="TAGNR"/>
<xs:element ref="TAGVALUE"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TAGNR" type="xs:string"/>
<xs:element name="TAGVALUE" type="xs:string"/>
</xs:schema>
I was able to catalog is into a SQL Sever 2005 XML Schema Collection succesfully.
Does any of that help?
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||Dear Kent,
Thanks for reorganising my schema in the right manner. But I dont think
you understood what I meant to say. Even when I used your modified
schema I could not map the three tagnr and tagvalues associated with
one one single patient into the tagnr and tagvalue column.I get an
error that says
Data mapping to column 'TAG_NO' was already found in the data. Make
sure that no two schema definitions map to the same column.
Is it not possible to map three different values to one column of the
same row? I hope you can help me out again this time.
Regards,
Prakruthi
|||Hello Prakruthi,
That's why I asked if you were using this an mapping schema or as a validation
schema. You said "validation," so I fixed it for that. However, I don't believe
you can target more than one value into a column using a single mapping.
Sadly, I don't have the time to work on this today before going on the road
for the next couple of week. However, it looks like Michael is back online,
so he might be able to help more.

> Thanks for reorganising my schema in the right manner. But I dont
> think
> you understood what I meant to say. Even when I used your modified
> schema I could not map the three tagnr and tagvalues associated with
> one one single patient into the tagnr and tagvalue column.I get an
> error that says
> Data mapping to column 'TAG_NO' was already found in the data. Make
> sure that no two schema definitions map to the same column.
> Is it not possible to map three different values to one column of the
> same row? I hope you can help me out again this time.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||Hi Kent,
I wanted to say im not using it as a validation schema. I apologise for
the typo error. I hope micheal would help me out with this issue.
Regards,
Prakruthi
|||Hi Kent,
I wanted to say im not using it as a validation schema. I apologise for
the typo error. I hope micheal would help me out with this issue.
Regards,
Prakruthi
|||I have forwarded it to our mapping schema experts and I hope they will get
back to you.
Ping me if that is not the case.
Michael
"Prakruthi" <prakruthi.rao@.gmail.com> wrote in message
news:1143210046.980577.250430@.e56g2000cwe.googlegr oups.com...
> Hi Kent,
> I wanted to say im not using it as a validation schema. I apologise for
> the typo error. I hope micheal would help me out with this issue.
> Regards,
> Prakruthi
>