I have quick question. Ihave a job which consists of 9 steps. 9th step is: Exec xp_cmdshell 'c:mssql.bat'. in this batch file I am stopping and starting SQL services using net stop and net start command. This job is running perfectly but it is not giving the job history when I right click the job and view job history I can't see anything where as if I check the checkbox for Show step details it showing first 8 steps information but it is not showing 9th step information. Even I checked the Sysjobhistory system table in MSDB it shows only 8 steps information. What is the reason....
New here:) and hoping someone might be able to shed a little light on a problem I am having.
I have a job scheduled, which needs to be periodically stopped and then restarted. After looking through various places I think the start method and stop method are the best bets?:rolleyes: But not really sure to be honest.
Can anyone give me some tips/pointers/opinions on what would be the best way to do this. (have tried to setup a job with the said method in each step - but it doesn't like my syntax.
Is there any way to schedule stop and start of NT services at a particular time daily.
For eg: If i have a service by name TemServer and if i need to stop that service each night at 9:00 and restart as soon as it stops.??
And Is there any way to start and stop the services of NT from workstation. Each and every time i am going to the server room for stopping the service and restarting.
how i can do it?Under Xp/2000, i write a application that stop/start this serices, butunder Win98, how i do it?Exists a method via SqlServer or a dos command to stop/start the MSDEprogram?Thanks a lotTomas--Questa è una firma automatica di MesNews.Sito: http://mesnews.no-ip.com
What is impact, if i stop and start Synchronization, for one subscription.
When i start, will it resync all tables by dropping and recreating at subscription.
On Publisher,  from Location Publiction,   right click on subscription,       select View Synchronization Status,  From here, stop and start
Profiler was run against a database looking for "long running" queries. I used the Duration column to filter out the queries that I didn't want. When reviewing the output, I noticed that for some queries the StartTime was equal to the EndTime even though the Duration was set higher. My question is, "What can account for this discrepancy and what inferences should I draw about the difference?" Does the difference represent a resouce being locked or some other type of blocking (Duration) and once the query was allowed to run, it completed quickly? TIA
======================================= If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy. -James Madison, fourth US president (1751-1836)
I want to create a package which start and stop the SQL server's services... i know i can achive this via NET COMMAND.... but i coudnt find in which task (SSIS) I can place that command?..
I also came across that I can achieve this using Execute Process task but for this I have to define executable file.... actually i dont want ne thing outside from my SSIS package
I want to tell to user about SQL Server Configuration Manager and wants to allow him "START / PAUSE / STOP" for SQL Server Express in system Tray. It is easy for the end user who don't know SQL Server.
A few service stop/start/restart questions on SQL Server 2005 SP2, whichI'll call SQLS.It looks as if there are *potentially* 6 ways to start/stop SQLSServices like the engine itself, integration services, reportingservice, Agent..-SQLS Configuration Manager-SQLS Surface Area Configuration (for Services and Connections)-Mgmt Studio Local (on server)-Mgmt Studio Remote (on client)-Windows Control Panel->Admin Tools->Services-Command Prompt (ala net start MSSQLSERVER)By policy, I am /not/ Administrator on the server. But I am SysAdminrole in SQLS. I have had various levels of success starting/stoppingservices in the ways listed above. In some I get Access denied, and inothers I get no msg and it simply doesn't work.Is there some special non-Admin OS group I need to be in to start/stopservices? Is this handled differently in the different interfaceslisted above?It seems like my best success for starting/stopping the engine and Agentis in /local/ Mgmt Studio, but /not/ remote Mgmt Studio - the optionsare greyed out on a remote client. Is this by design? Is it a SQLSbug?I'm sure I'm not the only SQLS DBA who does not have Admin rights on hisserver who wants to start/stop services. Generally speaking, how isthis intended to work?Any help appreciated.Allen JantzenA freshly minted DQLS DBA
Hi I have upgraded my local to sql server 2005, but still need to access the remote instance which is still at version 2008/8.0. Enterprise Manager has been removed (by the SQL server 2005 installation) Does anyone know how I can restart older version of SQL server instance (ie 2000/8.0) using SQL server Management Studio?
I don't have admin access on the server which the sql remote instance is hosted. Can get around it by asking the sys admin guy to do it for now but would prefer to continue to be able to do it myself. SQL Server Configuration Manager can only manage SQL server 2005 versions - a nice little caveat!
Is there a way to stop/start remote services using 'net stop/start'? - without having to write code.... I'll continue to search for a solution, but if someon can point me in the right direction, I'd be most greatful.
I'm getting this error message when I upgraded the SQL Server to install SSIS and other components.
===================================
The service did not respond to the start or control request in a timely fashion, you need administrator privileges to be able to start/stop this service. (SQLSAC)
------------------------------ Program Location:
at Microsoft.SqlSac.MainPanel.ServiceProgressBar.RefreshService()
For some reason the status lights in my Enterprise manager are no longer working. I am connected to the databases, but because the indicator lights are not working, I can`t get a quick visual status of my servers. Any way to get my lights back on?
I have a question about granting enough rights to allow a non admin user to start and stop a sql server service via the SQL Server Management Studio by right clicking on the server node.
I have changed the acl's of the SQL Server service security and gave the user rights to start and stop the service. This does allow them to connect remotly to the server using computer manager and they successifully start and stop the service. But, in SQL Server Management Studio the option still does not show up, unless he is a admin of the server.
Does anyone know what other security settings I need to address for the start and stop to show up when I right click on the server node?
Hello, I have a Question/doubt on SqlDependency.Start/SqlDependency.Stop.
After the implementation of my solution the question sounds "stupid" ... maybe is only the stress due to the fact that I'm going to deploy the application on Test.
Anyway.. I developed this application (windows application) that uses query Notification features to subscribe and get notification from Sql Server 2005 so it use the tipical pattern: SqlDependency.Start, SqlDependency_OnChange,SqlDependency.Stop.
This is application is installed on several client so actually I get have several notifications running on the Server.
When one of the client exit the application and call SqlDependency.Stop the service, queue and procedure are dropped.
Does the command drops all the query notification' service, queue and procedure running on the instance or only the one created by the specific user?
Carlos writes "I am trying to create a sp that would jump from one DB to another using the USE command. I built a string and then I tried to run EXECUTE(@SQLString) with no lock. This is the sample code I am using:
declare @DBName varchar(200) declare @SQlString varchar(300) set @DBName='model' set @SQlString = 'use '+@DBName execute(@SQlString)
Using ADO.NET Or regular queries on SQL Server, is there a good way ofdetermining if a Stored Proc will be returning a result set or if it isa non-query that does all I/O through parameters?Thanks.
Can anyone please direct me to an easy to understand Description, Article or Video tutorial that shows an example on how to programatically connect to an SQL database and retrieve data from a collumn using C# and VISUAL WEB DEVELOPER 2005 EXPRESS EDITION. Also, what namespace should be imported to do this? (From what I have gathered out of the help, it seem that System.Web.UI.WebControls is the one) I am trying to create a "news letter" web page. I have a basic form and when I hit "send" then the code in the background should access the database with all the recipient info, and retrieve all the E-mail addresses, Names, etc. and include it in each e-mail. ( I don't know if it is just me, but the help included with VISUAL WEB DEVELOPER 2005 EXPRESS EDITION is extremely difficult to understand - from a beginner point of view). Thanks! Regards Jan
Hi, I've written a SELECT statement that returns columns dependant on a bitwise parameter @Populate.SELECTCASE WHEN (1 & @Populate) = 1 THEN [Column1] ELSE Null END AS [Column1],CASE WHEN (2 & @Populate) = 2 THEN [Column2] ELSE Null END AS [Column2],CASE WHEN (4 & @Populate) = 4 THEN [Column3] ELSE Null END AS [Column3],CASE WHEN (8 & @Populate) = 8 THEN [Column4] ELSE Null END AS [Column4],etcIs this the most efficient way to acheive this since I am only seeing a small performance gain. It still returns all columns but depending on @Populate will leave some columns with Null values.Any help much appreciated, thanks.
Hi All, I am having problems getting values out of an sqldatasource. I have 2 on the page, i am using one to insert into a table and the other to get a couple of values from another table for the insert. the datasource i am trying to get the values from does a select with a querystring filter i need to grab a couple of fields out of it trhen do the insert on the other datasiource with a button click. The insert is fine, i just don't know how to get the values out of the first 'select source' Any pointers or suggestions most appreciated. Cheers
In VS2003 I have a user defaults table that I would call in the OnLoad - No Postback section to get the user defaults and then used some of the fields from that recordset as Parameters for other recordsets that would also load in that same section and might even issue a different Sql statement based on the field. In VS2005 (VB.NET), I can no longer figure out how to accomplish this. I can use the SQLDatasource Control which seems much improved but I cannot even find the generated code which I would use as a quick way to create my own datasources in the OnLoad event. Where is this code now stored and how can I accomplish my objectives in VB.NET 2005 with the current framework or programatically create data sources as necessary as I did before?
hi i am trying to gernerate some tables ( first with a script and then with a stored procedure),, in ms server management studio exrress 2005 using the followingcreate table ip( id int IDENTITY NOT NULL, ip varchar(15) NOT NULL, hostname varchar(128) NOT NULL, primary key(id)) ; i store this in a new query (assume :right click associates the query to the current database ?) and run it and nothing happens its been a while since i did sql but i think the sql is ok....how or more specifically where is the appropriate place to run this code thankssimo stored as a new query
I have a list box populated by a SqlDataSource with a basic statement of Select name where location = @location. Location is bound to a dropdownlist control. I want to have a checkbox for the Location dropdownlist and a checkbox for another dropdownlist (for the alphabet) that will select only those people with a last name of the letter selected. Changing the checkbox would change the sql statement. OK so there are two questions here: 1. How can I write a sql statement that would select only people whos last name begins with a certain letter. Would it use some sort of convert function to a string with only 1 letter? 2. How can I programatically change the sqlDataSource's 'select' statement. I need to switch between sorting by location and sorting by alphabetical last name. All of my previous experience has had me configuring the datasource in the asp.net code.
Hi SQ Gurus, Please help me with this issue that I am facing. I want to create a table programatically but want to pass its name as a variable. I would like to do something as follows: CREATE PROCEDURE BS_Create (@Name nvarchar(25)) AS CREATE TABLE [dbo].[@Name]( [ID] [int] IDENTITY (1, 1) NOT NULL , [Prod_Name] [nvarchar] (75) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] GO The table name is passed in as a parameter. No matter what I pass as a parameter, the table name is '@Name', which is not what I want. Instead, if the variable contains the value 'Product', I would like to see a table with the name 'Product' to be created.
OK, so I'm working on a project that requires the dynamic generation of SQL statements. Now in Visual Studio .NET I'm sure many of you have used that wonderful visual database tool that allows you to magically "verify sql syntax" at the click of a button. It takes a query that looks like this:
"SELECT A.AFFID, A.UserName, A.Pass, A.FirstName, A.LastName, A.Company, A.Street, A.City, A.State, A.ZIP, A.Country, A.phone, P.EMail, A.RecieveEMail, A.SSN, A.JoinDate, A.AffType, P.ProductId, P.BuyerId FROM Affiliates A, Purchases P WHERE (ProductId > 0) ORDER BY 1"
and transforms it into something that looks like this:
"SELECT A.AFFID, A.UserName, A.Pass, A.FirstName, A.LastName, A.Company, A.Street, A.City, A.State, A.ZIP, A.Country, A.phone, P.Email, A.RecieveEMail, A.SSN, A.JoinDate, A.AffType, P.ProductID, P.BuyerID FROM Affiliates A CROSS JOIN Purchases P WHERE (P.ProductID > 0) ORDER BY A.AFFID"
My question is: is there anything in the .NET platform that would allow me to achieve the same kind of result programatically (i.e. transform standard sql to tsql syntax and verify the syntax of the query at run time)?
I need some help with the following issue. I need vb.net code that will create a T-SQL script. For example given the orders table in northwind I would get the following with indexes, RI, ect. :CREATE TABLE [dbo].[Orders] ( [OrderID] [int] IDENTITY (1, 1) NOT NULL , [CustomerID] [nchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [EmployeeID] [int] NULL , [OrderDate] [datetime] NULL , [RequiredDate] [datetime] NULL , [ShippedDate] [datetime] NULL , [ShipVia] [int] NULL , [Freight] [money] NULL , [ShipName] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [ShipAddress] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [ShipCity] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [ShipRegion] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [ShipPostalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [ShipCountry] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY]GO ALTER TABLE [dbo].[Orders] WITH NOCHECK ADD CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED ( [OrderID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Orders] WITH NOCHECK ADD CONSTRAINT [DF_Orders_Freight] DEFAULT (0) FOR [Freight]GO CREATE INDEX [CustomerID] ON [dbo].[Orders]([CustomerID]) ON [PRIMARY]GO CREATE INDEX [CustomersOrders] ON [dbo].[Orders]([CustomerID]) ON [PRIMARY]GO CREATE INDEX [EmployeeID] ON [dbo].[Orders]([EmployeeID]) ON [PRIMARY]GO CREATE INDEX [EmployeesOrders] ON [dbo].[Orders]([EmployeeID]) ON [PRIMARY]GO CREATE INDEX [OrderDate] ON [dbo].[Orders]([OrderDate]) ON [PRIMARY]GO CREATE INDEX [ShippedDate] ON [dbo].[Orders]([ShippedDate]) ON [PRIMARY]GO CREATE INDEX [ShippersOrders] ON [dbo].[Orders]([ShipVia]) ON [PRIMARY]GO CREATE INDEX [ShipPostalCode] ON [dbo].[Orders]([ShipPostalCode]) ON [PRIMARY]GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Customers] FOREIGN KEY ( [CustomerID] ) REFERENCES [dbo].[Customers] ( [CustomerID] ), CONSTRAINT [FK_Orders_Employees] FOREIGN KEY ( [EmployeeID] ) REFERENCES [dbo].[Employees] ( [EmployeeID] ), CONSTRAINT [FK_Orders_Shippers] FOREIGN KEY ( [ShipVia] ) REFERENCES [dbo].[Shippers] ( [ShipperID] )GO