Showing posts with label runs. Show all posts
Showing posts with label runs. Show all posts

Tuesday, March 27, 2012

Error processing BACKUP DATABASE statement

Hello all!
I do database backup using SQL-script (BACKUP DATABASE to ...). This scripts
runs by osql utility.
How i can know - was backup successful or not.
I'm trying to use @.@.error variable, but it doesn't return error if device is
full or doesn't exists.
How can i do such error processing is SQL-script ?
Thanks, SlavaIf works, you get errors - example
-- I don't have disk n:
backup database northwind to disk='n:\notexisting.bak'
select @.@.error As 'Error No.'
-- Output in QA
Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'n:\notexisting.bak'. Device error or device
off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Error No.
--
3013
Check your script. Also, if you are using a scheduled job, you can define
workflow - what to do is a task fails, for example send a mail to a
operator.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Slava" <Slava@.discussions.microsoft.com> wrote in message
news:22375259-06DC-4C80-A66C-4136A1A897FB@.microsoft.com...
> Hello all!
> I do database backup using SQL-script (BACKUP DATABASE to ...). This
scripts
> runs by osql utility.
> How i can know - was backup successful or not.
> I'm trying to use @.@.error variable, but it doesn't return error if device
is
> full or doesn't exists.
> How can i do such error processing is SQL-script ?
> Thanks, Slava

Wednesday, March 21, 2012

Error on Mirroring job

When I use database mirroring, I get the following error when the mirroring monitor runs.

Incorrect syntax near '-'. [SQLSTATE 42000] (Error 102) Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. [SQLSTATE 42000] (Error 319). The step failed.

This is the stored procedure that mirroring creates automatically. It isn't a user sproc. Several other people have posted this error and it seems to be a Microsoft bug.

Any ideas.
Jeff

Search the MSDN Product Feedback Forum. If it is posted out there as a bug, it is being worked on. Posting it again out here won't get anything done.

Sunday, February 26, 2012

error message while retrieving table from database

well i have got a form which displays some result from the databasse, it runs fi9 in webmatrix, but when i try to run it from my main page and when i click on that button which should displays the aspx page, it gives me this error:

############################################################

Server Error in '/' Application.
------------------------

Login failed for user 'MUFADDAL\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'MUFADDAL\ASPNET'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException: Login failed for user 'MUFADDAL\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
Microsoft.Matrix.Framework.Web.UI.SqlDataSourceControl.PopulateDataSet(DataSet dataSet, String listName) +494
Microsoft.Matrix.Framework.Web.UI.SqlDataSourceControl.GetDataSource(String listName) +51
Microsoft.Matrix.Framework.Web.UI.DataBoundControl.ResolveDataSource() +95
Microsoft.Matrix.Framework.Web.UI.DataBoundControl.DataBind() +59
Microsoft.Matrix.Framework.Web.UI.MxDataGrid.DataBind() +10
Microsoft.Matrix.Framework.Web.UI.MxDataGrid.OnPreRender(EventArgs e) +62
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489

------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

############################################################

i have kept no passwords in my mssql server 2000 database

can anyone help me out with this problemWeb Matrix runs as a normal application, and so runs under your user credentials. When run in IIS, you are running under different credentials (generally the user ASPNET on your machine).

Your connection string likely is using integrated securtiy (that is, you are not passing a SQL username and password). You must:

Add the 'MUFADDAL\ASPNET' user as a user in SQL Server (easy if SQL is on the same machine as the Web server, more difficult otherwise) or you could use SQL security and pass a username and password.|||i did create a user and gave him all of the permissions.
but still it is not working

error message while creating table in the database

Hi

I created database using SQL server and runs under Cassini. The creation of database is ok but I have a problem when I am creating the table in database. Whenever I execute the code to create the tables, it shows the error message like 'Server not found' or just hang there. Does anybody know why it hang while I am creating the table? Is it because of the code or it's the time out error. Pls help as I am very new to this area.

MZAre you tying to create tables in SQL Server (Query Analyzer or Enterprise Manager), or in Web Matrix, or in your web application code, or...? If you can clarify where you are experiencing problems we should be able to help.

Terri

Wednesday, February 15, 2012

Error message

I am getting this error message over night. The server is
not busy during this time but a job that runs at 1 AM
seems to generate this error only when it runs at 1 AM.
When I rerun it at 7 AM when I come in to work it runs
fine. The error is:
Error: 1204, Severity: 19, State: 1
The SQL Server cannot obtain a LOCK resource at this time.
Rerun your statement when there are fewer active users or
ask the system administrator to check the SQL Server lock
and memory configuration.
What configuration settings are availiable for this? I
allow SQL to dynamically set its memory between 0 and 6656
MB with 8 gig availiable.
Please advise.Lots of questions:
Are you running SQL Ent Edition? (if not can not use more
than 2gb of ram)
What kind of job is it? Are you running maintenance
routines at the same time? Do you ahve any errors in the
SQL log at the same time? Event viewer errors?
Ray Higdon MCSE, MCDBA, CCNA
>--Original Message--
>I am getting this error message over night. The server is
>not busy during this time but a job that runs at 1 AM
>seems to generate this error only when it runs at 1 AM.
>When I rerun it at 7 AM when I come in to work it runs
>fine. The error is:
>Error: 1204, Severity: 19, State: 1
>The SQL Server cannot obtain a LOCK resource at this
time.
>Rerun your statement when there are fewer active users or
>ask the system administrator to check the SQL Server lock
>and memory configuration.
>What configuration settings are availiable for this? I
>allow SQL to dynamically set its memory between 0 and
6656
>MB with 8 gig availiable.
>Please advise.
>
>.
>

Error Message

I have a Maintenance Plan set to run every night that Optimizes the databases, runs an Integrity check and then backs them up. Each job is staggered to run 1 hour apart. It has been running fine for months and now I get the following intermittent error during the "Reorganize data and index pages" part:
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 1934: [Microsoft][ODBC SQL Server Driver][SQL Server]DBCC failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER, ARITHABORT'.

I know what database it is failing on but I run dbcc checkdb and find no errors. From what I have found on the web this error pertains to an index problem. The only indices on this database reside in the system tables. I have dropped the database and restored it but no help there. Any ideas?

Thanks
DonDo you have indexes on views or computed columns ? If so,
you will need to run dbcc dbreindex or indexdefrag. This occurs because sql server agent does not (by default) set arithabort and quoted_identifier on. So, you will need to create a job that sets these:

set arithabort on
set quoted_identifier on
dbcc checktable(tablename)|||I don't have any indexes on views or any user tables, just the default system tables with a fresh database. I'll look into the arithabort setting.
Thanks
Don|||Have you tried the dbcc commands ?