I have a stored procedure which activates a task when ever that sp is called.
and this procedure gets out of the loop.
the task get started running.
Is there any way in Sql server that the same stored procedures should wait until the Task finishes and return a code either 1 or 0 for success or faliure of the task.
I have a execute SQL task in which i have a delete statement with global params.
delete from <tname> where (strval=?) and (year=?)
both are varchar type variables.
my strval column gets a value something like "DecData1.0". But when i ran my DTS package it is ignoring this SQL statement. Might because of the special char '.' in "DecData1.0".
How to handle such situation.
I also tried by putting a single quote. delete from <tname> where (strval='?') and (year=?) But it is giving an error.
I am setting up a role to allow certain users to create and maintain Shared Schedules in SSRS 2005. The tasks I have authorized are: View reports View folders Manage all subscriptions View data sources Consume reports
What else do I need to grant? Right now the user cannot see the Site Settings link in order to get the the manage schedules.
We have created DTS jobs which copies data from one server to another and truncates the destination before copying the data from source. when we run the job manually it runs fine, but when schedule its failing with the below errors.
DTSRun: Loading...DTSRun: Executing...DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1DTSRun OnStart: Copy Data from CustomerMaster to [OUTBOUND].[dbo].[CustomerMaster] StepDTSRun OnError: Copy Data from CustomerMaster to [OUTBOUND].[dbo].[CustomerMaster] Step, Error = -2147008507 (80074005) Error string: Unspecified error Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts.hlp Help context: 1100Error Detail Records:Error: -2147008507 (80074005); Provider Error: 0 (0) Error string: Unspecified error Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts.hlp Help context: 1100Error: -2147467259 (80004005); Provider Error: 0 (0) Error string: Timeout expired Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0DTSRun OnFinish: Copy Data from CustomerMaster to [OUTBOUND].[dbo].[CustomerMaster] StepDTSRun: Package execution complete. please suggest to over come this problem.
I want to schedule the task using contro panel schedule task item.
I want to run two package in sequence. If the execution of one gets over then other should start.
I have configured the execution detail in BAT file.
I know how to schedule the task. But can anyone please suggest me how to schedule the task in sqeuence i.e. execution of BAT file in sequenece (one after other).
I've been running SQL Server for 5 years now and have not seen the following.
We have a scheduled night run task where we do various maintenance functions as well as print out the issued insurance policies for the day. All indications are that the run completed except that I did not get an email notification of success or failure.
When I went to enterprise manager, under jobs the night run seems to be stuck in the mode of "Performing completion actions". I cannot get it our of this mode back to "Not running". Trying to stop the task has no effect.
Any ideas/suggestions??
Thanks in advance.
Cheers, Mike Byrd Information Systems Manager Texas Windstorm Insurance Association Austin, Texas
Hi All, I am using SQL Server 6.5 for our database server. We will run couple schedule tasks in the SQL Server everyday. One of the task that will call a BATCH file in C:. In this batch file, it will copy some files, and zip then. Then It iwll launch the Internet Explorer, and run a ASP program. In the ASP program, it will send out a E-Mail and then close the browser. It works fine until this Monday. The "Schedule Task" runs on time, and do the "copy" & "zip". But it will not launch the IE, stuck on there. I check the IE that is launched but it runs in the background. The ASP program is not running too. I used the "notepad" instead of the IE. The result is that the batch file runs, and the "Schedule Task" will finish. But the "notepad" didn't launch. If I just "double click" the batch file, it runs fine. So the problem is between the SQL server "Schedule Task" and the WINDOWS NT, I guess. Has any one has a clue, please tell me. Thanks.
I am having a problem with the scheduled task I am running. There had been an error message 5702 which says "The SQL Server is terminating this process". I don't understand what this means. And if I try to force the job to run, it says that the SQLExecutive service is not running on the particular server. And this prevents the task from being run. But when I try to check for the said service, it is running. I don't know what is happening here. Please help me.
Is Vista get rid of the task scheduling? We can schedule a task easily through the Scheduled Task under control panel, but I cannot find similar stuff in Vista.
Can anyone tell me if schedule a task is still available in Vista? If yes, where can I do that?
I am trying to copy what is happing in "Schedule Task" on Windows and put into database design below. It's a denormalisation though.
What is the better way to handle this schenario such as DAILY, WEEKLY AND MONTHLY TASK? I did try put into normalisation by adding extra table called ScheduleDetail which holds DAYS and MONTHLY but it's more complicated.
I am running an application on mssql 6.5, sp 4 on NT 4.0.
We routinely chnage paswords for the sa login. One loophole for users to learn the sa password is in scheduler tasks underr EM when a task is added to run under cmdexec, the password is written in text under the -P paramater.
1) Is there any way to encrypt the password there or does any one have a stored procedure or function to do s?
1) Which executible, if any, runs the scheduled tasks under EM? Is this part of EM or is there any specific executible that runs the scheduled tasks?
Any information oyu can provide or suggestions you cna make will be appreciated.
I have a website called Project. It has 2 database files. one is ASPNETDB.mdf and another one is project.mdf.
The last time I edited my website was this afternoon. nothing wrong. Then tonight, when I try to work on the project again, I found out that I couldn't access the project.mdf database file. The error message occurs when I try to expand the project.mdf:
Cannot open user default database. Login failed. Login failed for user 'DefaultAndy'
I believe Default is the name of my computer and Andy is the name for my windows account. I use Windows authentication for that database file.
This is the funny thing. If I rename my project folder under the My DocumentsVisual Studio 2005WebsiteProject to something else, I will be able to open the project.mdf file.
Does anybody have any idea what is going on??
I really appreciate and thank you soooo much for your time !
I have installed SQL Server 7.0 SP2 on a couple of servers and have been trying to get the DTS package to run. Unfortunately when I try to create a new DTS package, I get the foll DTS Designer error:
"Could not create Component Categories Manager"
I've tried using the DTS Import/Export wizard only to keep getting a Dr Watson error....What am I doing wrong??
Actually we have already backed up the Very large database(1.1 TB). We are trying to migrate the backup file to other server . But the copy is running really slow because of slow network banwidth. What are best options to transfer terabyte file from one server to other. Thanks in advance
Guys, I really need help with this one. I am populating the data warehouse and have to deal with some bad sourse databases. In one table they have 28 columns, used as flags. Each column represents a particular facility. Each record can have 0 to many facilities selected, so this table could have NULL or 'Y' in one or many of those columns. That's a terrible DB design. They should have build a 1-to-many table relationship, but instead, they put everything in one table. And the other funny thing is that those 28 columns are literally named Column1, Column2 ... Column28, and then the actual facility names are HARDCODED in their application codes !!! So, the table might look like this: Col1 Col2 Col3 Col4 Col5 .... Col28 -------------------------------------------------- NULL Y NULL NULL Y NULL Y NULL NULL NULL NULL NULL NULL Y NULL NULL NULL Y ........... NULL Y NULL NULL Y Y
My task is to get for each record the first 4 not NULL facility NAMES. I have a script that does that, but this script is very primitive and is huge ! I kind of do 4 runs through this file. First run I get the record ID for each record, and populate the first of the 4 facility names. I am just using CASE statement and check each field if it's NOT NULL then enter the actual hardcoded name. I put all this into a #temp table. The second run I join the main table with this #temp table, again getting the record ID and the first populated Facility Column 1, and then create a Second Facility field, by using the CASE statement again, going through each field, checking for NOT NULL AND NOT being the same as the First Facility name... And so on... Like I said, this is working, but I was just wondering is there is a simpler way of doing this.
Any help or suggestion will be greatly appreciated.
We run a site through asp.net (programmed in visual studio.net) and the site's beginning to get a lot of problems (as the site grows)
Here is the latest error message. I was wondering if someone could help me troubleshoot this.
Server Error in '/' Application. --------------------------------------------------------------------------------
Transaction (Process ID 145) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. 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: Transaction (Process ID 145) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
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: Transaction (Process ID 145) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.] System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +44 System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +5 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 Saltwaterfishing.Components.DB.RankResults.SearchAllSites(String query, Int32 currentPage, Int32 pageSize) in ***************ComponentsDBRankResults.cs:43 ***************.Controls.RankResultsGrid.BindDataGrid() in ***************\ControlsRankResultsGrid.ascx.cs:82 ***************.Controls.RankResultsGrid.ShowResults() in ***************ControlsRankResultsGrid.ascx.cs:68 ***************.Main.ShowPage() in ***************\saltwaterfishingmain.aspx.cs:75 ***************.Main.Page_Load(Object sender, EventArgs e) in ***************\main.aspx.cs:43 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +731
I am facing a query problem.i have 2 tables called emp-table and report-table.report table for listing report of employees. following are criterias..
1 I want list all reports from report-table 2 But no report should have empstatus 5 3 reports need not necessary to have emp-table reference.ie emp-id reference in emp_table. briefly saying i want all reports from report table,in which no one have empstatus 5
i need urgent help sorting out my SQl please.... i have 6 tables Student class lectures student_results attendance
my case study says " the system should be able to record attendance of student to any class. the system shoul also be able to automatically send out a warning to any student that misses any two lectures for the first time."
can anyone help me solve this problem on SQL (oracle) please...
Hi, I am trying to Implement Multi parameter... If i give NULL it works fine but if i give '7,4' I get this error message
Msg 102, Level 15, State 1, Line 18
Incorrect syntax near '17'.
This is my sproc
Code Block ALTER Procedure [dbo].[usp_GetOrdersByOrderDate] @ClientId nvarchar(max)= NULL, @StartDate datetime, @EndDate datetime AS Declare @SQLTEXT as nvarchar(max) if @ClientId is null Begin Select o.[OrderId], o.[OrderDate], o.[CreatedByUserId], c.LoginId, o.[Quantity], o.[RequiredDeliveryDate], cp.PlanId, cp.ClientPlanId, cp.ClientId FROM [Order] o Inner Join ClientPlan cp on o.PlanId = cp.PlanId and o.CreatedByUserId = cp.UserId Inner Join ClientUser c on o.CreatedByUserId = c.UserId WHERE --cp.ClientId = @ClientId --AND o.OrderDate BETWEEN @StartDate AND @EndDate ORDER BY o.OrderId DESC END ELSE BEGIN SELECT @SQLTEXT = 'Select o.[OrderId], o.[OrderDate], o.[CreatedByUserId], c.LoginId, o.[Quantity], o.[RequiredDeliveryDate], cp.PlanId, cp.ClientPlanId, cp.ClientId FROM [Order] o Inner Join ClientPlan cp on o.PlanId = cp.PlanId and o.CreatedByUserId = cp.UserId Inner Join ClientUser c on o.CreatedByUserId = c.UserId WHERE cp.ClientId in (' + @ClientId + ') AND o.OrderDate BETWEEN ' + Convert(varchar, @StartDate) + ' AND ' + convert(varchar, @EndDate) + ' ORDER BY o.OrderId DESC' execute (@SQLTEXT) END
Hi, I am using this stored procedure to populate a report... if the particular report value is NULL i am getting this error
Cannot read the next data row for the data sest PlanEligiReqattri. Invalid lenght parameter passed to the right function...
This is my stored procedure
Code Block ALTER Procedure [dbo].[rpt_PlanEligiReqAttriApplied] @PlanId int AS BEGIN Declare @List varchar(255) Set @List =' ' Select @List = @List + ', ' + PERA.Name
From PlanEligibilityReqAttriApplied PERAA Inner Join PlanEligibilityReqAttributes PERA on PERAA.PlanEligibilityReqId = PERA.PlanEligibilityReqId Where PlanId = @PlanId select Right(@List, Len(@List) - 2) --set @List = Right(@List, Len(@List) - 1) End
I want to have a page break between the first set and the second set. The last subreport of the first set, Subreport6A, has a pagebreak at end = true, so it should break. The problem is that when I export to Excel I am getting one sheet for the 12 subreports.
Hi i am trying to transfer the contents of a dbf file to sql server 2005 and this is my error message 'C:Documents and SettingsKarenMy DocumentsVisual Studio 2005WebSitesASC1pdfclientAS.DBF' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. This is my code If (FlAS.PostedFile.FileName.ToLower.EndsWith(".dbf")) Then FlAS.PostedFile.SaveAs(location) Try 'Connection string to a dbase file Dim dbfConnectionString As String = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source ={0};Extended Properties= dBase IV", location)
'create connection to the DBF file Using connection As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection(dbfConnectionString) Dim command As Data.OleDb.OleDbCommand = New Data.OleDb.OleDbCommand("Select * from AS.DBF", connection) connection.Open()
'Create a dbDatareader to the dbf file Using dr As Data.Common.DbDataReader = command.ExecuteReader() Dim sqlConnectionString As String = System.Configuration.ConfigurationManager.AppSettings(APPSETTINGS_CONNECTION) Dim myConnection As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings(APPSETTINGS_CONNECTION)) Dim query As String = "Truncate table ASDBF" myConnection.Open() Dim cmd As New SqlCommand(query, myConnection) cmd.CommandType = CommandType.Text cmd.ExecuteScalar() myConnection.Close()
'bulk copy of sql server Using BulkCopy As SqlBulkCopy = New SqlBulkCopy(sqlConnectionString) BulkCopy.DestinationTableName = "ASDBF" BulkCopy.WriteToServer(dr) End Using End Using connection.Close() End Using
Hi, I am trying to insert the Source name and clientId to a table called clientSource...
The User will send in some Dbf File.... So in a particular file called PlanDbf.. I have the following fields PlanNumber, Name, SRC1Name, SRC2Name, SRC3Name.... SRC20Name 170234 Constructions Employee Deferral Employer Discretionary Employer Matching....
And in another table called SourceDBF i have the following fields with data PlanNumber PARTID SOURCE_NUM etc... 170234 123456789 1 170234 123456789 3 170234 451231334 1 So how do i match the Source_NUM with SRCnames when i insert it into the table.. INSERT INTO Statement..ClientSource(@ClientId, SourceName)SELECT s.SOURCE_NUM FROM SourceDBF .. but i am stuck.. any help will be appreciated. Regards Karen
Msg 2503, Level 16, State 1 Table Corrupt: Page Linkage is not consistent; check the following pages: (Current page#=298065; page pointing to this page =286585; previous page# indicated in this page=283321).
Can somebody urgently help? Any help will be appreciated.
Hi everybody! I create my database by restore from server’s backup. Every object there is owned by dbo77 user. I want to execute stored procedure in following way: exec sp1 and not – exec dbo77.sp1, when I connect with the same user. I create new Login – dbo77 in Securities folder of my server (LOCAL). And when I connect by this user to that database, I still can’t use syntax: exec sp1. An error says that my login dbo77 does not have an associated user name. When I try to mark that database in dbo77 ->property->Database_Access it writes an error that dbo77 already exists. How can I make this db work with syntax exec sp1, if I login with same login name as the owner of sp1?
Seek expert’s advice on database mirroring in high safety mode when safety is full if for some reason communication between principal and mirror is broken for say 2 days then principal will keep working but in disconnected mode. When communication link will establish again then principal can see the mirror server 1. Will establish the mirroring automatically? 2. Then will it synchronise the mirror databases automatically? 3. If it will synchronise databases automatically then principal will process transaction or wait till principal-mirror will be in synchronised state which again depends on number of transaction need to redo on mirror?
Hi all!I am in need of writing a few stored procedures.The first one is to create a stored procedure to recover a databasefrom backup and the second one is to create a stored procedure toexecute a transaction log backup (even though I know this can be donethrough a maintainence plan). Any help would be greatly appreciated.I know the commands to recover and backup -- but I dont know how toformulate them into a stored procedureThanks in advance!