.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Unable to access VM network drive in SQL during backup generated by stored procedure

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Sql Server
 
I get the following error in a log file created in the osql command: Msg 3201, Level 16, State 1, Server KAC2KGS2, Procedure usp_Kaman_Full_SqlDB_Backup, Line 150Cannot open backup device 'x:\Servername_master_sqlbu_200703101930.bkf'.Device error or device off-line. See the SQL Server error log for moredetails.Msg 3013, Level 16, State 1, Server KAC2KGS2, Procedure usp_Kaman_Full_SqlDB_Backup, Line 150BACKUP DATABASE is terminating abnormally. The device is established in a CMD file right before the osql command is started that starts my stored procedure.  The CMD in this file is: for /f "tokens=15 delims=." %%i in ('ipconfig^|find "IP Address"^|find "192.168"') do set SUBNET=%%i :loopif exist x:\ net use x: /delnet use x: \\192.168.%SUBNET%.1\backup if not ERRORLEVEL 1 ( goto continue) else ( echo FAILED TO CONNECT TO BACKUP SERVER >> "%SystemDrive%\LogFiles\%Computername%.log" sleep 60 goto loop) :continue echo IP ADDRESS OBTAINED Echo delete old log file if it exists if exist %3\%computername%_kaman_full_sqldb_backup_old.log del /Q %3\%computername%_kaman_full_sqldb_backup_old.log Echo Rename log file to old.log rename %3\%computername%_kaman_full_sqldb_backup.log %computername%_kaman_full_sqldb_backup_old.log echo backup SQL Databases on server will start now osql -E -n -d %1 -i %2\kaman_full_sqldb_backup.sql -h-1 -o %3\%Co


View Complete Post


More Related Resource Links

Unable to select any stored procedure while creating TableAdapters in wizard

  

I'm using VS 2008 and SQL 2008.

I have created the tables and the stored procedures in SQL 2008.

In VS 2008, I created DataSet1.xsd in App_Code and created the connectionString in web.config file.

Then when I go into the DataSet1.xsd and try to add a TableAdapter, strange things happened.

First I chose the data connection, then selected "Use existing stored procedure", then there was nothing listed in the dropdownlists (in Select, Insert, Update, or Delete). 

I'm sure the connectionString is correct because if I choose "Use SQL statement" and type in a "select * from mytable1", the TableAdapter can be created without any problem.

Any suggestions?


can a Workflow access a stored procedure and pass the parameters from the list data to the stored pr

  
The reason that I would like to consider this functionailty is because my table architecture is complicated and I do not want to modify my master table to accept all of this data where some of the data should be normalized into sub tables.  Has anyone see evidence of the stored-procedure parm approach?  Is this best accomplished through VS 2010 or can I do it through SPD? Thanks

Slow backup via stored procedure that is called from vb.net

  

Ok I have a database that is 3.37 GB in size.  Gets backed up via a stored procedure in a vb.net production run.  It takes close to 3 minutes and seems like it should be faster. Below is the code that calls the procedure and the procedure itself.  Is the problem with one of these 2 or is the time normal given the DB size?

Vb code

Dim backupCmd As SqlCommand = New SqlCommand("BackupPltdataNewProc", sqlconn)
backupCmd.CommandTimeout = 240
backupCmd.CommandType = CommandType.StoredProcedure
sqlconn.Open()
Try
backupCmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
sqlconn.Close()

the procedure

USE [Pltdata]
GO
/****** Object:  StoredProcedure [dbo].[BackupPltDataNewProc]    Script Date: 09/23/2010 13:14:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:              <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[BackupPltDataNewProc]
AS
DECLARE @BackupFileName varchar(100)
SET @BackupFileName = 'F:\Backup

Slow backup via stored procedure that is called from vb.net

  

Ok I have a database that is 3.37 GB in size.  Gets backed up via a stored procedure in a vb.net production run.  It takes close to 3 minutes and seems like it should be faster. Below is the code that calls the procedure and the procedure itself.  Is the problem with one of these 2 or is the time normal given the DB size?

Vb code

Dim backupCmd As SqlCommand = New SqlCommand("BackupPltdataNewProc", sqlconn)
backupCmd.CommandTimeout = 240
backupCmd.CommandType = CommandType.StoredProcedure
sqlconn.Open()
Try
backupCmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
sqlconn.Close()

the procedure

USE [Pltdata]
GO
/****** Object:  StoredProcedure [dbo].[BackupPltDataNewProc]    Script Date: 09/23/2010 13:14:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:              <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[BackupPltDataNewProc]
AS
DECLARE @BackupFileName varchar(100)
SET @BackupFileName = 'F:\Backup

Service Broker Queue message activates stored Proc as SA but the stored proc is unable to access oth

  

I have a queue whose activation I defined as below

ALTER QUEUE SomeInitiatorQueue
WITH ACTIVATION
( STATUS = ON,
PROCEDURE_NAME = usp_SomeProc,
MAX_QUEUE_READERS = 30,
EXECUTE AS OWNER)

Now I am trying to access another database in usp_SomeProc as below

Select SomeColumn SomeOtherDb.dbo.SomeTable

Here I am getting this error "The server principal "sa" is not able to access the database "SomeOtherDb" under the current security context."

It never allows unless I grant all permissions on the database to all.

what is the solution?


unable to pass dynamic dates to stored procedure with pivot

  

hi All,

                  I am unable to date as dynamic parameter to stored procdure with pivot.i am getting

error 

Msg 8114, Level 16, State 1, Procedure Sample, Line 3

Error converting data type nvarchar to datetime.

Msg 473, Level 16, State 1, Procedure Sample, Line 3

The incorrect value "@date1" is supplied in the PIVOT operator.

below is my stored procdure

 

create

procedure Sample(@date1 datetime,@date2 datetime)

as

SELECT

Capturing the row table that has generated an error in a stored procedure

  

Hi.

I have implemented a stored procedure in SQL Server 2005. I need to capture the possible errors. I have written an Insert To ... Select statement, so I read a row block from a Table1 to insert it into a Table2. But I could have an error, f.e. a conversion error. I want to capture the row of the block that has generated the error for the insert. Is it possible? How?

Any helps for me, please? Many thanks


Access to network map drive blocked in .net 4.0 wpf application on win 7

  
I am developing in VS2010 a validation tool that needs to look for files on a network share. The files are pathed via a mapped drive. When the code

var

is executed, I get the follow exception.

Could not find a part of the path 'I:\active\production\09 Vrod deu\'.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 re

SQL Server 2005 Grant User Permission to Create Stored Procedure and Grant Execute Access to another

  

I'm trying to determine the minimal amount of access I can give my developers to be able to run create stored procedure scripts with an inclusion of the grant execute to the application user group.

We have been developing some interesting work arounds, but I think there must be an easier way to grant the access.

Grant Create Stored Procedure to user1 on a specific database

Grant Permission to Grant Execute permission for Stored Procedures on a specific Database to user1 for any user.

 


Backup only Stored Procedure

  

Hi,

Is there any way to only backup SPs,functions and views from a database backup.

 


Thanks and regards, Rishabh

WSS 3.0 Timer Error "6398" are getting generated 1 per minute.Unable to access Search Settings Page

  
Dear All
We are facing a terrible error which keeps getting generated exactly one per minute and i cant access Search Settings page as well.
I have already tried whats defined in the article below.
After that the errors stopped generating.
But after few hours they started generating again. Iam assuming its because the timer job didn't executed during that period.
We have two servers. One is MOSS and the other is Database Server with SSRS in Sharepoint integrated mode therefoew it is also a web front end server.
I have configured MOSS Server for everything i.e. as Index Server, Executing Search Queries etc. "Is this Ok? or can i use SSRS Web Front End Server as Dedicated server for indexing / All WFE Servers for indexing"
I am using SharePoint Farm administrator as search service account. Same user is used for all other services as well.
I have changed the "Indexed files path" but given full access and files are getting generated in it.

Send Email from SQL Server Express Using a CLR Stored Procedure

  
Problem
One of the nice things about SQL Server is the ability to send email using T-SQL. The downside is that this functionality does not exist in SQL Server Express. In this tip I will show you how to build a basic CLR stored procedure to send email messages from SQL Server Express, although this same technique could be used for any version of SQL Server.

Solution
If you have not yet built a CLR stored procedure, please refer to this tip for what needs to be done for the initial setup.

Inserting rows via stored procedure and under certain conditions

  

I'm using Dynamic Data with Entity Framework in VS2010.

Let's say my table has these fields:

MyTable
ID (PK)
PersonID (FK)
LocationID (FK)
TotalItemsSold

Hypothetical scenario (it's easier for me to explain this way, so just bear with me for now)... But let's say each row in the table represents "how many items were sold by such-and-such employee at such-and-such location," where location and person are foreign keys which are referencing other tables.  Basically, there should be no more than a ONE row which has a particular combination of Person and Location.  Makes sense?

So, when inserting new rows using my Dynamic Data app, the insert form displays editable fields for Person (dropdown), Location (dropdown), and Items Sold (textbox).  How do I prevent users from inserting another row into the table containing an already-existing combination of Person and Location?   How do I displaying useful feedback to them in the event that they DO attempt to do this?

I have several thoughts about this, but since I'm new to Dynamic Data, I'm not sure which way to go.  For example:

Option 1:  Use "cascading dropdowns" approach in the insert form and only pull in the "allowed" combinations of the two dropd

Creating A Stored Procedure Which Searches Team Names

  

Hi

I'm have on my web page a text search box which I want users to type in there favourite football team and this will display a gridview of the teams with the replica shirts I offer.

This is where I thought about creating a stored procedure to carry out this task.

I looked online for ideas but I not found anything as yet.

If anyone done anything similar to my request please let me know.



Sort by gridview SortExpression parameter via Stored Procedure

  

I have a gridview that calls data via a stored procedure.  I am unable to enable the gridview columns to be sortable. I need to set the parameter in the Stored Procedure, can someone help me with this?

Here is my gridview:

<asp:GridView ID="AllUsersGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="UserName"
                        GridLines="Vertical" Width="900px" DataSourceID="SqlDataSource1" AllowSorting="True"
                        SelectedRowStyle-Height="30px" CellPadding="4" BackColor="White">
                        <Columns>
                            <asp:TemplateField HeaderText="Full Name" SortExpression="lastname">
                                <ItemTemplate>
                                    <asp:Label ID="DisplayName" runat="server" Text='<%# Eval("firstname").ToString() & " " & Eval("lastname").ToString() %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="User Name" DataField="UserName" />
                            <

Stored procedure generator?

  

Hi, I am looking for a stored procedure generator with full source code(C#) compatible with Visual studio 2010. I want to create my custom stored procedure code. Please send some link. Regards, ap.


Create stored procedure from asp.net

  

Hi,

we are creating a custom report tool, which could be used for generate the report as per end user's needs. In that we are providing an option as user could create a query and procedure as well.

In sql server we can use "EXEC" function for execute dynamic query.

Could anyone help me for create the dynamic query in Oracle?

I just tried with "execute immediate", which would throws error as 

"insufficient privileges".

Please help me.

 

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend