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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Error while exeucting XP_CmdShell (SQL 2005)

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server


I am trying to execute the following lines of code in Query and i am getting an error

Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection

 DECLARE @AlertResultWordRepositoryPath AS NVARCHAR (1000)                    
 DECLARE @LetterFileNameAlert AS NVARCHAR (255)                      
 DECLARE @LetterFileNameResult AS NVARCHAR (255)
DECLARE @bcpcommandWord AS NVARCHAR (500)

SET @AlertResultWordRepositoryPath = dbo.EY_fnGetLookupValue (251)                       
 SET @LetterFileNameAlert           = dbo.EY_fnGetLookupValue (106)                       
 SET @LetterFileNameR

View Complete Post

More Related Resource Links

Error 2908 while installing sql server 2005 management objects collection on Win 7

I have SQL Server native client 2005 installed on Win 7 64-bit machine. While installing SQL Server XMO 2005 it gives error 2908 and aborts installation. Any suggestion on the error?

Msg 15121, Level 16, State 10, XP_Cmdshell - A call to 'CreateProcessAsUser' failed with error cod

I have the XP_cmdshell issues for the past two days in SQL2005 SP2 environment. There is a domain account with sysadmin privilege. I have created a proxy account and gave the execute privilege for xp_cmdshell. If i try to run the following commmand EXEC master..xp_cmdshell 'dir *.txt' Msg 15121, Level 16, State 10, Procedure xp_cmdshell, Line 1 An error occurred during the execution of xp_cmdshell. A call to 'CreateProcessAsUser' failed with error code: '1314'. But if i give sysadmin priv and then i try to execute. It worked. I cant give sysadmin priv so i m using a proxy account. Whether any one have solution for it.

sql 2005 sp2 memory error FAIL_VIRTUAL_RESERVE

We're running SQL Server 2005 SP (9.00.4035.00) 32 bit on Windows Server 2008 SP2 Enterprise.   The server has 8gb of RAM and is only used for SQL Server.  Since Windows 2008 SP2 was installed on 8/23/2009, once every week or so the server has become unresponsive.  Early in in the course of the problem I notice the following error in the SQL Server error log:  Failed Virtual Allocate Bytes: FAIL_VIRTUAL_RESERVE 1048576 That's followed by the output of DBCC MEMORYSTATUS, which I'll include at the end of this post. After that, things work normally for several hours, except for some occurences of Downgrading backup log buffers from 1024K to 64K That appear in the SQL Server error log when our transaction log backups occur.  Some time after that, we begin to receive Event ID: 701 There is insufficient system memory to run this query. In the event logs of our server. At that point, the server becomes unresponsive.  Restarting the SQL Server Service resolves the issue. Is anyone else experiencing this? It's only been happening 1 time per week (not consistently the same time) and has only occurred since Windows Server 2008 SP2 was installed.  I don't know if that's related, but it's the only real change to that server.  Workload has been consistent on that server for months. Can someone please help? Thanks. Here's the DBCC output. Memory Manager     VM Reserved =

Getting the Error: 0xC001000E at : The connection "" is not found. SQL 2005

After doing some looking I noticed this was included in the SP3 for SQL 2005. We have had this service pack installed for a while now but we are still randomly getting this error. Some packages will run fine for a long time and then all of the sudden start giving this error even though the package was successful. Any ideas? Thanks, Donnie

SQL Server 2005 x64: Intermittent "Error: 18456, Severity: 14, State: 10."

Hi, We are experiencing intermittent authentication errors "Error: 18456, Severity: 14, State: 10" on a customer's production server. This is a new server that has just been rolled out in the past several months. Rebooting the server appears to make the problem go away. We are using SQL authentication from a separate server that is running IIS. The application always uses the same username and password to connect. Server info: select @@versionMicrosoft SQL Server 2005 - 9.00.2047.00 (X64) Apr 14 2006 01:11:53 Copyright (c) 1988-2005 Microsoft CorporationStandard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 1) select @@versionSP1 Sample error from SQL Server errorlog: Date  7/7/2006 10:53:24 AMLog  SQL Server (Archive #2 - 7/7/2006 12:20:00 PM)Source  LogonMessageError: 18456, Severity: 14, State: 10. MSDN (http://msdn2.microsoft.com/en-us/library/ms366351.aspx) lists various states for this error message but 10 is not included, and it says "Other error states exist and signify an unexpected internal processing error." Note: This was not a case of a transient error that occurs only when SQL Server is starting up - these errors occurred at a variety of times, two months after the server was last rebooted / SQL Server last restarted. Thanks for any help you can provide. Regards,-Frank.

"None of the selected features can be installed" error on SQL 2005 Cluster

Hey All, I installed SQL 2005 on a cluster.  Everything on the primary node works fine.  However, as the documentation suggests, the SQL Management Studio (and other tools) are not installed on the standby node by default.  However, when I go to try and install on the 2nd node I get the following error: TITLE: Microsoft SQL Server Setup------------------------------ None of the selected features can be installed or upgraded. Setup cannot proceed since no effective change is being made to the machine. To continue, click Back and then select features to install. To exit SQL Server Setup, click Cancel. For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=setup.rll&EvtID=SQLSetup90&EvtType=28108 ------------------------------The link is referencing something about requiring a complex SA password.   I can verify that the directory structure on node 1 where the management studio and client tools exist does not exist on node 2.   I'm at wits end here, I've tried uninstalling/reinstalling/everything. Anyone have any ideas? thanks!

Best practice for user defined error messages in SQL Server 2005/2008 --Need help

My requirement is to setup a standard practice for our team in handling DB erros and also  user defined messages. We are handling exceptions using Raiseerror method with in Try and Catch blocks.  For user defined message, we are using Sp_addmessage to add our application specific error/warning messages with error codess>80000.  Ex: 80001 | Company name already exists. please check. Here is the sample code ********************************************************************* CREATE PROCEDURE [dbo].[usp_CompanyProfile_insert]  -- Add the parameters for the stored procedure here  (@company_name VARCHAR(50),  @company_code VARCHAR(3),  @user_id INT  ) AS BEGIN  -- SET NOCOUNT ON added to prevent extra result sets from  -- interfering with SELECT statements.  SET NOCOUNT ON;  BEGIN TRY -- Begin Try Block      -- Validate company name   IF EXISTS (SELECT company_id FROM companyprofile WHERE company_name = @company_name)    RAISERROR(90021, 16, 1)      INSERT INTO companyprofile (company_name,       company_code,       createdby)   VALUES(@company_name,     @company_code,     @user_id)    END TRY  -- End Try Block &

2005 Install Error - SQLBROWSERACCOUNT

Hello experts - I am trying an ATTENDED install of SQL Server 2005 Enterprise edition, on Windows 2003 sp2, nd receive the following: TITLE: Microsoft SQL Server 2005 Setup ------------------------------   SQL Server Setup has determined that the following account properties are not specified:  'SQLBROWSERACCOUNT' . The properties specify the startup account for the services that are installed. To proceed, refer to the template.ini and set the properties to valid account names. If you are specifying a windows user account, you must also specify the password for the account.   For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=setup.rll&EvtID=28006&EvtType=sqlca%5csqlguica.cpp%40SetUnattendedSvcAccountProp%40SetUnattendedSvcAccountProp%40x6d66   ------------------------------ BUTTONS:   OK ------------------------------ If you click ok, it terminates the install.  My understanding is termplate.ini is for silent, unattended installs.  What's going oin? Dianne

Error with Visual Web Developer 2008 Express and MS SQL 2005 Express in Vista

I have created a database in SQL 2005 Express and am trying to connect to it in  Visual Web Developer 2008 Express. When I try to connect to a database and click on the Test Connection button, I get that the test connection succeded. However, when I click on OK, I get the following message:     Unable to add data connection.     Could not load file or assembly     Microsoft.SqlServer.Management.Sdk.Sfc, Version=,     Culture=Neutral, PublicKeyToken='89845dcd8080cc91', or one of its     dependencies. The system cannot find the file specified. I have turned on the IIS 7.0 functionality and am still recieving this error message. Please help. Thanks.

getting MOF error trying to install either SQL 2005 Developer version or SQL 2008 R2 Developer versi

I have tried so many times but failed to install SQL 2005 Developer version on my XP machine. Got the 29513 error. I then switched to SQL 2008 R2 Developer version and got the MOF syntax error. I'm new SQL Server and need some help fixing this problem. I'm not sure what version of the SQL 2005 version it is. I downloaded it from MSDN Subcriber Download page. Any help to fix this problem would be appreciated. Got a project that needs to use Sql Server ASAP.

SQL server 2005 Installation STOP ERROR!

I have tried installing SQL Server Enterprise Edition on a Virtual server running windows server 03 but it keeps on giving me a STOP error! Please I need some help!

error in insert hebrew data into sql server 2005

Hello, am trying to insert data in hebrew language into sql server 2005 but it appears like this ???????????? can i know how i can fix the problem plz???? thank u

Error with Maintenance Plans - SQL 2005

Hi everyone.I have a problem with SQL 2005 with Cluster.  There is no issues with installation process and the cluster works fine. Normally I install SQL and apply Service Pack. So I do this, installing Service Pack 3 in both nodes (two nodes)After this, I create some databaese and restore backup from other SQL 2005 Server and also I import the logins to access SQLBut when I try access Maintenance Palns appears the following messageFailed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)Additional Information:    an exception occurred while executing a Transact-SQL statement or batch (Microsoft.SqlServer.ConnectionInfo) Invalid column name 'from_msx'Invalid column name 'has_targets') Microsoft Sql Server, Error:207)What I do. Remove client components, Integration and Notification Services in both nodes, reinstall and apply Service Pack. Now I can create a new plan. but in the saving step appears the following messageSaving maitenance plan failed.Additional information:Failed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)An exception occurred while executing a Transact-SQL statement or batch (Microsoft.SqlServer.ConnectionInfo) Invalid colum name 'ms_job_id' (Microsoft Sql Server, Error:207)I found some information in Internet, about a script that fixes this, but in Service Pack 2. I thinking in remove SQL , reinstall and test without SP. And

Deploy Reports Error (VS2008) to 2005 ReportServer Db...

Hi, i'm trying to deploy a report made in Visual Studio 2008 to a ReportServer Data Base 2005, but a get this error...   Error 2 The report definition is not valid.  Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2007/01/reportdefinition' which cannot be upgraded.    Is it posible to use a SQL 2005 DB with Rdl's reports 2008   thanks

Unable to install SQL Server 2005 Express: The error is (-2146885628) Cannot find object or propert

I am installing 2 instances of SQL Server 2005 Express for 2 different accounting packages on Windows XP SP3.  I have the first installed, after much use of the forums.  The version of setup.exe was 2005.90.2047.0. I am not able to install the second, for Microsoft Office Accounting 2009, setup.exe version 2005.90.3042.0.  The error I am getting in Summary.txt is: Error String    : The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually." The error is  (-2146885628) Cannot find object or property. Error Number    : 29503 The errorlog file for MSSQL.2 has a lengthier description: 2009-09-05 23:00:32.13 Server      Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)     Feb  9 2007 22:47:07     Copyright (c) 1988-2005 Microsoft Corporation     Express Edition on Windows NT 5.1 (Build 2600: Service Pack 3) 2009-09-05 23:00:32.31 Server      (c) 2005 Microsoft Corporation. 2009-09-05 23:00:32.31 Server      All rights reserved. 2009-09-05 23:00:32.32 Server      Server process ID is 5516. 2009-09-05 23:00:32.32 Server      Authentication mode is MIXED. 2009-09-05 23:00:32.35 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\LOG\ERRORLOG'. 2009-09-05 23:00:32.38 Server      Regi

Administrative Commands via XP_CmdShell in SQL Server 2005

SQL Server 2005: Microsoft SQL Server Enterprise Edition (64-bit) Microsoft Windows NT 5.2 (3790) SQL Version 9.00.3175.00   I have 2 identical servers... one for DEV and one for TEST. On the DEV server, I can use xp_cmsdhell to execute "administrative commands" such as NET SHARE and AT. On the identically configured TEST server, I can not. Those command return the "System error 5 has occurred. Access is denied" error. I CAN run other commands via xp_cmdshell (DIR, NET USE, etc.). This is true regardless of the account I connect as.   The SQL Server service accounts in both instances are domain accounts belonging to the local admin group.   I "know" that I ran across this when setting up the DEV server and am "fairly sure" I found a reference to a known problem with 2005's xp_cmdshell and administrative commands. But for the life of me I can not now find any such reference, nor can I find any differences between the DEV and TEST servers in the area of users, groups, policies, or anything else security-related. (99.9% of the internet searches I do end up being about either enabling xp_cmdshell -- done -- or setting up an xp_cmdshell proxy account -- not needed).   Any input is greatly appreciated.   Thanks! -dave

SQL Server 2005 X64 Linked Server error

We use Windows 2003 Server (64) on AMD64 and SQL Server 2005 Developer Edition x64 + SP1  Problem: I can not execute any sql on a linked server using the native Provider (SQLCLNI) Example (create a linked server on the same machine, other database (msdb) and try to execute any simple select using OPENQUERY  sp_addlinkedserver @server='ls',@srvproduct='SQLNCLI',@provider='SQLNCLI' ,@provstr='Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=msdb;Data Source=localhost;'  Select * from OPENQUERY(ls,'Select * from Sysobjects')  Msg 7356, Level 16, State 1, Line 1 The OLE DB provider "SQLNCLI" for linked server "ls" supplied inconsistent metadata for a column. The column "name" (compile-time ordinal 1) of object "Select * from Sysobjects" was reported to have a "Incomplete schema-error logic." of 0 at compile time and 0 at run time.
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