Monday, March 12, 2012
Issue with restoring master db
I am trying to restore my master database to a new server in sql 2000. I have started sql in single user mode from the command line and connected to enterprise manager and attempted to do the restore. I also tried query analyzer and used the restore database from disk ='file path of backup' used the move option with the correct file path and on both counts received the same error message...
Error: 9001, Severity: 21, State: 1.
Error: 3151, Severity: 21, State: 0.
Any ideas? The connection is then broken (which I would expect anyway as restoring master shuts down sql but, I checked and it has not restored the db)
Thanks!This article may be of some help:
http://www.dbarecovery.com/restoremasterdb.html|||lmao @. your sig ... rdjabarov ... nice one !!!|||That is mostly what I have done (did not need to do the rebuild part) When I try to do the restore it does not complete but generates the error messages I listed in my first posting. I have done this before and it worked but, for some reason it is not allowing me to do the restore but, is breaking the connection.
Any other suggestions?|||I did some more checking - could there be an issue with one server having a windows service pack 3 and the other server having windows service pack 4?
Monday, February 20, 2012
Issue charting data over last 24 hours...
I have a table which contains data regarding calls to the Help Desk, I want to chart this using a simple line chart in SSRS 2005 with the chart displaying the number of cases opened by the help desk each hour for the last 24 hours. Although our Help Desk provides 24/7 support, there are periods of an hour in which no calls are received. The issue I'm having is I want the chart to still display these hour periods of time even though there are no records created in the time span. I want the x-axis to display every hour for the last 24 hours.
Anyone have any suggestion on how I can accomplish this? The only idea I've come up with is creating a new table containing a list of every hour in a day and referencing this to build the x-axis...but it seems as though it should be easier than that?
Thanks in advance for any input or assistance.
>>The only idea I've come up with is creating a new table containing a list of every hour in a day and referencing this to build the x-axisI have to do the same thing a lot, except on the calendar level rather than the hour level.
Although maybe it *should* be easier, I don't know a better way to do it.
Because the calendar is a bit more dynamic, I don't store the data in a table but rather generate it on the fly. In your case, it's static (there are always 24 hours) so it makes some sense to just store the data in a table, in the form you need it --
However you *can* generate it on the fly pretty easily if you wish.
Pick some table that always has >= 24 rows for this task -- I'll use master.dbo.spt_values here --
Code Snippet
SELECT TOP 24 ROW_NUMBER() OVER (ORDER BY name) FROM dbo.spt_values
... put this in a table-valued udf, reference the udf in your query...
HTH,
>L<
isqlw and std out
than file. How can I do this ?
Hi GMG,
Thanks for your post.
From you descriptions, I understood your ISQLW command line will
automatically output to a file instead of screen.
However, ISQLW will launch Query Analyzer and osql is the command line for
SQL Server. Both QA and osql will defaultly output to screen instead of
files. Would you please show me more detailed steps about your scenario?
More detailed informaiton, I believe, will make us closer to the resolution.
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
|||I am automating a number of scripts to be run via ISQL, but I have found
particular ANSI characters are corrupted. When running ISQLW via the command
line everything is fine, but it outputs to file which is not ideal I would
the output summary to display to the DOS screen.
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:WjTmruQrFHA.3532@.TK2MSFTNGXA01.phx.gbl...
> Hi GMG,
> Thanks for your post.
> From you descriptions, I understood your ISQLW command line will
> automatically output to a file instead of screen.
> However, ISQLW will launch Query Analyzer and osql is the command line for
> SQL Server. Both QA and osql will defaultly output to screen instead of
> files. Would you please show me more detailed steps about your scenario?
> More detailed informaiton, I believe, will make us closer to the
resolution.
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
|||What exactly do you mean by "ANSI characters are corrupted"? Have you tried
using oSql instead? oSql replaces iSql in 2000.
Andrew J. Kelly SQL MVP
"GMG" <nospam@.nospam.com> wrote in message
news:%23rbzxafrFHA.2228@.TK2MSFTNGP10.phx.gbl...
>I am automating a number of scripts to be run via ISQL, but I have found
> particular ANSI characters are corrupted. When running ISQLW via the
> command
> line everything is fine, but it outputs to file which is not ideal I would
> the output summary to display to the DOS screen.
> "Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
> news:WjTmruQrFHA.3532@.TK2MSFTNGXA01.phx.gbl...
> resolution.
> rights.
>
|||Hi GMG,
Thanks for the follow up.
I am also a little bit confused with "ANSI characters are corrupted". I
understood it was some characters will not be displayed correctly. If I
have misunderstood your concern, please feel free to point it out.
I am afraid we may not have a better way doing this directly. If you want
to get the output from file, you could generate a batch and output the file
after execute the isqlw in your scenario. You could use DOS command type
like this: type [driver:][filepath][filename]
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
|||I am sorry I was not very clear in my explanation.
I was able to solve the issue by going to 'Client Network Utility' - 'DB
Library Options' tab and disabling 'Automatic ANSI to OEM conversion'.
The ANSI characters are now correct when using ISQL to run my scripts.
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:n%23tA9MesFHA.3604@.TK2MSFTNGXA01.phx.gbl...
> Hi GMG,
> Thanks for the follow up.
> I am also a little bit confused with "ANSI characters are corrupted". I
> understood it was some characters will not be displayed correctly. If I
> have misunderstood your concern, please feel free to point it out.
> I am afraid we may not have a better way doing this directly. If you want
> to get the output from file, you could generate a batch and output the
file
> after execute the isqlw in your scenario. You could use DOS command type
> like this: type [driver:][filepath][filename]
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
|||Hi GMG,
Thanks for the update and it's great to know it was resolved.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
ISQL: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near ' '
That's a space between the ticks.
It's all part of a longer script but seeing as the failure occurs on
line 1
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[config]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[config]
GO
That's three lines only. Does it matter that they're in Unicode?
Any ideas?
Kind regards,
Bruce M. Axtens
Software Engineer
Strapper TechnologiesI pasted that code into a .sql file and ran it through isql.exe and it executed without errors. What
version of SQL Server to you connect to?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"axtens" <Bruce.Axtens@.gmail.com> wrote in message
news:1162976105.388119.97910@.b28g2000cwb.googlegroups.com...
> G'day everyone
> That's a space between the ticks.
> It's all part of a longer script but seeing as the failure occurs on
> line 1
> if exists (select * from dbo.sysobjects where id => object_id(N'[dbo].[config]') and OBJECTPROPERTY(id, N'IsUserTable') => 1)
> drop table [dbo].[config]
> GO
> That's three lines only. Does it matter that they're in Unicode?
> Any ideas?
> Kind regards,
> Bruce M. Axtens
> Software Engineer
> Strapper Technologies
>|||Tibor,
Thanks for your reply. I found out from another group that the line
count is reset each time ISQL executes a "GO" statement, so the
offending line could have been anywhere in a 123 line file.
What I ended up doing was creating two scripts from the original: one
to do the "DROP"s and the other to do the "CREATE"s.
Thanks for your time.
Kind regards,
Bruce M. Axtens
Software Engineer
Strapper Technologies