T-SQL (SS2K8) :: Query To Predict Future Job Schedules From MSDB Tables

May 8, 2014

I want to query my msdb job and jobschedule related tables to generate a list of runtimes for each of these jobs for the next day or any future date. This query should output JobID, Run_Date(YYYYMMDD), and Run_Time(HHMMSS).

If I have 3 jobs with...

Job#1 scheduled to run once every 4 hours between 6 AM and 10 PM
Job# 2 scheduled to run every 15 minutes between 11 AM and 1 PM
Job# 3 scheduled to run every minute between 4 PM and 4:15 PM

my output should look as below ....

View 1 Replies


ADVERTISEMENT

T-SQL (SS2K8) :: Query To Compare Data In 2 Tables

Sep 17, 2015

Table 1 has "Gender" field with "Male" and "Female" in it, table 2 has "Gender" field with "M" and "F" in it. a query to compare data and list the differences.

View 4 Replies View Related

Query DateTime DataType For Current Or Future Events

Oct 12, 2006

I have a sql server express 2005 database with a table named Events with a column named Date (datetime datatype).  I want a query that will display all rows that are either current or future but not past.  I suspect there is a simple way of doing this.  As a Newbie searching archived threads this is what I have come up with so far.  I determine the number of days from present:SELECT DATEDIFF(day, Date, GETDATE()) AS NumberOfDays FROM EventsThis yields number of days from present with positive numbers in the past and negative numbers in the future.  Thus setting a WHERE clause to <= 0 would limit my results to present or future events.  Something like this:SELECT * FROM EventsWhere DATEDIFF(day, Date, GETDATE()) AS NumberOfDays <= 0The error message states: "Incorrect syntax near the keyword 'AS'"This feels like a clumsy way to approach this problem, but I have to start where I am.Any suggestions on how to proceed will be greatly appreciated.

View 2 Replies View Related

T-SQL (SS2K8) :: Select Query To Pull Required Data From 3 Tables

Mar 19, 2014

I have three tables EmpIDs,EmpRoles and LatestRoles. I need to write a select Query to get roles of all employees present in EmpIDs table by referring EmpRoles and LatestRoles.

Where I stuck : The condition is first look into table EmpRoles and if it has more than one entry for a particular Employee ID than only need to get the Role from LatestRoles other wise consider the role from EmpRoles .

Example:

Create Table #EmpIDs (
EmplID int
)
Create Table #EmpRoles (
EMPID int,

[Code] ....

Employee ID 2 is having two roles defined in EmpRoles so for EmpID 2 need to fetch Role from LatestRoles table and for remaining ID's need to fetch from EmpRoles .

My Final Output of select query should be like below.

EmpID Role
1 Role1
2 Role2
3 Role1

View 5 Replies View Related

T-SQL (SS2K8) :: Union Of Two Tables Returned Back To Main Query

Aug 18, 2014

Currently I have a standard query with a join to several tables. There are two additional tables MAS_CTB and MAS_STB. I would like to do a union between those two tables to get FIELDVALUE which will exist in either the CTB table or the STB table and then have that value be returned with the results of the original query.

I can of course write a UNION from the main query to the CTB and then to the STB table, however it's about 80 dummy fields I would have to replicate in the union which is why I was wondering if there was a more simple way.

Main Query:
SELECT Field1, Field2...Field80
From Table1
Join Table2

Union Portion:
Select FieldValue <------
From MAS_CTB
UNION
Select FieldValue <-----Return to main query above
From MAS_STB

View 3 Replies View Related

T-SQL (SS2K8) :: MASTER And MSDB - Defrag Using Standard Alter Index Command?

Oct 10, 2014

On a 2008r2 server, I ran the frag utility against master and msdb and noticed they were severely fragmented.

Is it ok to defrag them using the standard Alter Index command?

View 7 Replies View Related

Predict Query Gives 'DMPluginWrapper; Object Reference Not Set To An Instance Of An Object' Error

Mar 17, 2008



Hi,

I am trying to develop a custom algorithm. I have implemented and tested training methods, however I fail at prediction phase. When I try to run a prediction query against a model created with my algorithm I get:


Executing the query ...
Obtained object of type: Microsoft.AnalysisServices.AdomdClient.AdomdDataReader
COM error: COM error: DMPluginWrapper; Object reference not set to an instance of an object..
Execution complete


I know this is not very descriptive, but I have seen that algorith doesn't even executes my Predict(..) function (I can test this by logging to a text file)
So the problem is this, when I run prediction query DMPluginWrapper gives exception -I think- even before calling my custom method.

As I said it is not a very descriptive message but I hope I have hit a general issue.

Thanks...

View 3 Replies View Related

T-SQL (SS2K8) :: Measuring Volume Of Data Created Temporarily To Replace Usage Of Physical Tables In Query

Sep 12, 2014

How I can measure the volume of data created temporarily to replace usage of physical tables in an SQL query.

View 1 Replies View Related

DTS Tables In MSDB

Apr 3, 2003

Hello,

Can anyone tell me what tables are used to store DTS defs? When you create a DTS job, where does it get saved?

Thanks!

View 1 Replies View Related

DTS MSDB SYSTEM TABLES

Nov 30, 2000

Is there any way to get the DTS Wizard to see the system tables (sysjobs, sysjobschedules, etc..) in the MSDB or Master database?

View 2 Replies View Related

Transact SQL :: Determine When Database Was Backed Up Without Using MSDB Tables?

Apr 22, 2015

I was wondering if there was another method to determine when a database was last backed up without using the backup history tables in msdb? whether using DBCC DBINFO, DBCC PAGE on a specific database page...etc.

Also, when restoring a database, is there a trace flag you can use to force restore details to be written to the error log?

View 4 Replies View Related

How To Predict?

Mar 30, 2007

I have a question.The question is to predict what to do next.



I have a table with three columns.

CustomerID ServiceContent ServicesID

140105100001 Service1 1

140105100001 Service2 1

140105100001 Service3 1

140105100001 Service1 2

140105100001 Service5 2

... ... ...





I want to use SQL Server 2005 Data Mining to predict what services that one customer will accept next.





Thanks

View 4 Replies View Related

Service Broker Is Disabled In MSDB Or MSDB Failed To Start

Nov 21, 2005

Whenever I start my SQL Express 2005 database, I get the following in the logs :

View 10 Replies View Related

Predict Product With Sex And Age Of Customer.

Sep 17, 2006

i have table:

customer(customerid, age,sex....)

orderdata(orderid, customerid,day)

orderdetails(orderid, productid, quantity)

products(productid, productname,...)

now, i want to show some product for customer when i now him age and sex.

e.ct: if he is a man and age =20 i show product : ball, pull, sport close....... if man is a woman , i show lips, babara, t_shirt, skirt....

if man is a chirdren, i will show joy, story for chidren....

how i create my mining model. and how i query for result in DTS

View 1 Replies View Related

Predict Probability In Decision Trees

Dec 13, 2006

Hello,

I installed the bike buyer example and i am learning the DMX language. Now i wrote the following query (using MS decision trees):

SELECT
T.[Last Name],
[Bike Buyer],
PredictProbability(Predict([Bike Buyer])) AS [Probability]
From
[v Target Mail]
PREDICTION JOIN
OPENQUERY
(....... And so on..)

Now the result is surprising to me. In the resulttabel all the probabilities are equal.

Bike Buyer Probability
1 0.99994590500919611
0 0.99994590500919611
0 0.99994590500919611
0 0.99994590500919611
0 0.99994590500919611
1 0.99994590500919611

and so on.

Now i am wondering what predictProbability means. I thought that PredictProbability meant the probability that the prediction is correct. Now all the probabilities are the same and the input is different. Can somebody tell me what PredictProbability means or am I using it wrong?

Thanx in advance,

Joris Valkonet

View 6 Replies View Related

Using Quotation Marks In A Msdb.dbo.sp_send_dbmail Query

Oct 31, 2007

Hi There,

I'm having a little trouble with a large query I have written to be sent as an email.

I want to send it as a csv so I've added commas in between each value in the query.

This is causing an error though, I think the ' that surround the commas are closing the query early. Is there any way around this? like encapsulating the query?

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'ggsgn'
,@recipients = 'sgsdm'

,@subject = 'Nsgdday'
,@attach_query_result_as_file = 1
,@body_format = 'text'
,@query ='
use sdgsgdgs
select
a1.c#,',', client,',', fr,',', tpe,',', dateReq as DateRequested,',', ... '

View 1 Replies View Related

Data Mining Problem: Is That Possible To Predict Many Many Columns?

Mar 22, 2007

Hello,

Can someone please assist?
I have no problem using the provided Algorithms (NaiveBayes, Decision Tree, etc) from SQL Server 2005 Data Mining. For example: If I want to predict whether the customers want to buy bike from the following data, then I use Age, Salary, Gender as input/attribute/feature selection and BuyBike column as "Predict" column.

Table
Age Salary Gender BuyBike
------------------------------------

However, say that I have 10,000 types of bikes to predict. How to do that?
Age Salary Gender BuyBike1 BuyBike2 BuyBike3 ...... BuyBike10000
------------------------------------------------------------------------------------

Are there any online resources discussing this issue? I am desperately try to solve this problem. Please assist!



Mary

View 5 Replies View Related

Predict Products ( Data Mining 2000)

Oct 6, 2006

i want to make a web page and when somebody come in. i want show for him which products that everyone often buy at that time ( month or summer ).

how i do in data mining to predict that products ?

more: i want know how much percent of product is like by buyer

or i want show products with desc % of the like of people

View 4 Replies View Related

How To: Set Up &&amp; Interpret A Model To Predict Even Dollar Transactions

Feb 12, 2007

Generally, what would be a good start to model and make predictions based on the following.

Even Dollar Transactions €“ Including transactions that end in $0 or $50 with a Total Transaction Amount between $400 and $5000.

I have a table called Transaction with a BillingAmount column.

I've gone through the SQL Server 2005 Data Mining Tutorial (which uses a discrete prediction BikeBuyer yes or no) and read a lot of Data Mining with SQL Server 2005. Neither of these give good, complete, methodical examples of selecting inputs and targets and making predictions; especially for continuous columns.

I think I'm generally struggling with the concepts of selecting (continuous?) predictable attributes and calculating predictions based on the results. Are there any examples of a scenario similar to the above that I can reference? or just some advise.

View 6 Replies View Related

Need Help With Schedules

Sep 22, 2005

I'm having a problem figuring out how to show multiple event times in one string. The data I'm using is:


Code:

idloc_idtrny_dowtrny_time
17923:00:00 PM
18926:00:00 PM
19929:00:00 PM
201026:00:00 PM
211029:00:00 PM
221136:00:00 PM
231139:00:00 PM
23946:00:00 PM




If the Loc_ID and trny_dow is the same for mutiple rows, I need to concatenate the trny_time of those recoreds into a string and not return the individual times.

I can't figure out how to return the final recordset as:


Code:

loc_idtrny_dowtrny_time
923:00 PM & 6:00 PM & 9:00 PM
1026:00 PM & 9:00 PM
1136:00 PM & 9:00 PM
946:00 PM



Any help is much appreciated!

- Dan

View 1 Replies View Related

Sql Job Schedules

Jan 25, 2007

Could anyone tell me how to create a scheduled job in sql server 2005, I have a bunch of queries thaty i want to run on a table and i want to automate it, does anyone know of any tutorials on the internet or any helpful links

Thanks

View 1 Replies View Related

DTS Package Schedules

Apr 5, 1999

Whenever I set a schedule on any given package, it executes OK, but I'm not able to bring back those settings for review. Instead, it always starts with the blank schedule form. Any hints?
** Thanx in advance **
P.S. I log in NT as an Administrator.

View 1 Replies View Related

Multiple Job Schedules.

May 12, 2004

I just created a job with more than one schedule. Specifically, one schedule for the 2nd Sunday and the other for the 4th Sunday. Has anyone ever created multiple schedules for a job?

Sidney Ives
Database Administrator
Sentara Healthcare

View 3 Replies View Related

DTS Permissions And Schedules

Jul 6, 2006

I have set up a DTS to import data from an Access database to a server which is running SQL. It works alright if I execute the DTS, but if I set it to run as a scheduled task, it tells me that the path to the access db is not valid, and that I should make sure the path name is spelled correctly and that I am connected to the server on which the file resides... so obviously it's not a spelling issue (since when I execute it, it works), but a security issue. Anyone have any ideas?

Thanks a lot,
Tex

View 9 Replies View Related

Report On Job Schedules

Aug 27, 2007

I am looking for a script that will show me the job schedule for the jobs on a given server, in plain english. It would look something like this:

Job Name Schedule
Job 1 M,Tu,W,Th,F 3:10 pm
Job 2 1st Day Month 6:00 am
Job 3 Daily 4:15 pm

I have looked at the job schedule table and have decipher some of it, but not all. Can anyone point me in the right direction?

Thank you!!

Jim Youmans
St. Louis, Missouri, USA

View 4 Replies View Related

The Future

Jul 8, 2004

I have another question I'm just looking for some opinions on this. I created a database through sql (sql engine, access 2000 client side) now this database has Hyperlinks in it which lead to the employee's documents which on in acrobat pdf. Does anyone for see an problems that might occur wth that???

Thanks again

View 10 Replies View Related

Changing Schedules For A Job Outside SQL Server

Aug 31, 2006

Below is the script of a Job called "eFIMS_SendEmail" that I wish torun. The intention is that every day of the week the job will executea SPROC at timed intervals. For example, the SundayRun schedule willrun once every 1 hours from 00:30:00 to 23:59:59However, the clients have stated that they want an interface to this toenable them easily to change the start time and frequency interval foreach day. It's an easy matter for me to paint them a form from withinthe target application to enable the user to enter the start time andinterval for each day. I can then pass these as parameters to a SPROC.How can I use these values to change the schedules for the job? Forexample, if wanted to change SundayRun from once every 1 hours to onceevery 30 mins? I know I could do it the hard way, by using stringmanipulation (e.g. find string 'SundayRun', then look for the nextoccurrence of @active_start_time, @freq_subday_type,@freq_subday_interval etc. and do some replacement) but this seemssomewhat tricky.Many thanksEdward-- Script generated on 8/31/2006 9:27 AM-- By: sa-- Server: BISMARKBEGIN TRANSACTIONDECLARE @JobID BINARY(16)DECLARE @ReturnCode INTSELECT @ReturnCode = 0IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name =N'[Uncategorized (Local)]') < 1EXECUTE msdb.dbo.sp_add_category @name = N'[Uncategorized (Local)]'-- Delete the job with the same name (if it exists)SELECT @JobID = job_idFROM msdb.dbo.sysjobsWHERE (name = N'eFIMS_SendEmail')IF (@JobID IS NOT NULL)BEGIN-- Check if the job is a multi-server jobIF (EXISTS (SELECT *FROM msdb.dbo.sysjobserversWHERE (job_id = @JobID) AND (server_id <0)))BEGIN-- There is, so abort the scriptRAISERROR (N'Unable to import job ''eFIMS_SendEmail'' since thereis already a multi-server job with this name.', 16, 1)GOTO QuitWithRollbackENDELSE-- Delete the [local] jobEXECUTE msdb.dbo.sp_delete_job @job_name = N'eFIMS_SendEmail'SELECT @JobID = NULLENDBEGIN-- Add the jobEXECUTE @ReturnCode = msdb.dbo.sp_add_job @job_id = @JobID OUTPUT ,@job_name = N'eFIMS_SendEmail', @owner_login_name = N'sa', @description= N'No description available.', @category_name = N'[Uncategorized(Local)]', @enabled = 0, @notify_level_email = 0, @notify_level_page =0, @notify_level_netsend = 0, @notify_level_eventlog = 2,@delete_level= 0IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollback-- Add the job stepsEXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @JobID,@step_id = 1, @step_name = N'SendEmail', @command = N'EXECstpSendEmailConfirmation', @database_name = N'194-eFIMS', @server =N'', @database_user_name = N'', @subsystem = N'TSQL',@cmdexec_success_code = 0, @flags = 4, @retry_attempts = 0,@retry_interval = 1, @output_file_name = N'', @on_success_step_id = 0,@on_success_action = 1, @on_fail_step_id = 0, @on_fail_action = 2IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_update_job @job_id = @JobID,@start_step_id = 1IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollback-- Add the job schedulesEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'SundayRun', @enabled = 1, @freq_type = 8, @active_start_date= 20060831, @active_start_time = 3000, @freq_interval = 1,@freq_subday_type = 8, @freq_subday_interval = 1,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'MondayRun', @enabled = 1, @freq_type = 8, @active_start_date= 20060831, @active_start_time = 3000, @freq_interval = 2,@freq_subday_type = 4, @freq_subday_interval = 30,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'TuesdayRun', @enabled = 1, @freq_type = 8, @active_start_date= 20060831, @active_start_time = 4000, @freq_interval = 4,@freq_subday_type = 4, @freq_subday_interval = 40,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'WednesdayRun', @enabled = 1, @freq_type = 8,@active_start_date = 20060830, @active_start_time = 3000,@freq_interval = 8, @freq_subday_type = 4, @freq_subday_interval = 30,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'ThursdayRun', @enabled = 1, @freq_type = 8,@active_start_date = 20060831, @active_start_time = 3500,@freq_interval = 16, @freq_subday_type = 4, @freq_subday_interval = 35,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'FridayRun', @enabled = 1, @freq_type = 8, @active_start_date= 20060831, @active_start_time = 3000, @freq_interval = 32,@freq_subday_type = 4, @freq_subday_interval = 30,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackEXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID,@name = N'SaturdayRun', @enabled = 1, @freq_type = 8,@active_start_date = 20060831, @active_start_time = 0, @freq_interval =64, @freq_subday_type = 8, @freq_subday_interval = 1,@freq_relative_interval = 0, @freq_recurrence_factor = 1,@active_end_date = 99991231, @active_end_time = 235959IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollback-- Add the Target ServersEXECUTE @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @JobID,@server_name = N'(local)'IF (@@ERROR <0 OR @ReturnCode <0) GOTO QuitWithRollbackENDCOMMIT TRANSACTIONGOTO EndSaveQuitWithRollback:IF (@@TRANCOUNT 0) ROLLBACK TRANSACTIONEndSave:

View 1 Replies View Related

T-SQL (SS2K8) :: How To Merge Two Tables

May 27, 2014

I've One table that contains all current appointments booked as below.

RNappt_idclinic_idderived_location_idprovider_idappt_date_timeappt_date_endtime
1102186011435/27/14 8:305/27/14 9:00 AM
2102196011435/27/14 9:305/27/14 10:00 AM
3102206011435/27/14 10:305/27/14 11:00 AM
4102216011435/27/14 14:005/27/14 2:30 PM
5102226011435/27/14 16:005/27/14 4:30 PM
6102236011435/27/14 16:305/27/14 5:00 PM

for Same Clinic,location and Provider there's a schedule data for same day 24 hours

having every five mintues as below:

clinic_idderived_location_idprovider_idstart_timeendtimeunblock
601143 8:01 8:040
6011438:05 8:100
601143
60114313:0113:041
601143
60114313:5514:001
601143 1
60114317:5518:000
60114323:550:001

for rows having no start and endtime assume it as regular intervals.

So i need to show available appointment with duration one hour with the available schedule which is for every five minutes

Like My first appointment for today starts at 8:30 but 8- 8:30 is unblock so there could be an appointment but as this chunk is less than 60 so need to create it

For Schedule table below is what i've to create for temporary basis as this will be available in nightly load in a table.

DECLARE @num int=5
,@LASTtime TIME =CAST('23:55' as TIME)
,@Time TIME =CAST('00:00' as TIME)
,@Timeprev TIME =CAST('00:00' as TIME)
WHILE ( @Time<>@LASTtime)
BEGIN

[code]....

View 8 Replies View Related

T-SQL (SS2K8) :: Search All Tables

Dec 19, 2014

I need to search all tables in my user database to find a value. I don't know what the column name is.

I know of one table that contains the value, but I need to look through all the tables and all there columns to see if I can find if this value exists in more than one place. It is an int value - 394789.

View 5 Replies View Related

T-SQL (SS2K8) :: Joining On 3 Tables

May 19, 2015

I am having trouble with joining 3 tables.1 table is the primary call it jobs, second is material, third is called labor...job will have all jobs, SOMETIMES the job will have material, sometimes job will have ONLY labor, BUT most of the time it will have job, material and labor...

Column
job Labor Material
1 2 3
2 - 2
3 3 -
4 5 6

View 2 Replies View Related

T-SQL (SS2K8) :: Joining Two Tables

Jul 24, 2015

I've having difficulty joining two tables and getting the results I want. What I'm trying to accomplish is an Health Savings Account (HSA) upload file to go to our Insurance vendor. Here's a summary

Table1: PS_AL_CHK_DED

Description: This table stores all deductions in an employee's paycheck. I'm specifically looking for a field in that table called AL_DEDCD where it equals "H". This is the deduction from the employee's paycheck.

EXAMPLE:

> EMPLID...........CHECK_DT...........AL_DEDCD.............AL_AMOUNT
123456............6/30/2015..............H.............................100.00
123456............6/30/2015..............R..............................75.00
987654............6/30/2015..............H..............................50.00
987654............6/30/2015..............A..............................85.00
456123............6/30/2015..............H..............................200.00
456123............6/30/2015..............L...............................25.00


Table2: PS_AL_CHK_MEMO:

Description: This table stores the employer contribution based on their deduction. For example, we match 50% of their contribution. It is possible for the employee to have a deduction (stored in the ps_al_chk_ded table) but it is not possible for them to have an employer contribution (stored in ps_al_chk_memo) without a deduction (stored in the ps_al_chk_ded).

EXAMPLE:

>EMPLID..........................CHECK_DT........................MEMO_CD...................AL_AMOUNT
123456..............................6/30/2015........................H..................................50.00
123456..............................6/30/2015........................XX................................10.00
987654..............................6/30/2015........................H..................................25.00
987654..............................6/30/2015........................ZZ................................20.00
456123..............................6/30/2015........................MM. ............................40.00
456123..............................6/30/2015........................NN................................5.00

What I want in my output is a combination of these tables that looks at the employee in the ps_al_chk_ded table, takes only the records where al_dedcd = H and returns the corresponding employer contribution (memo_cd =H in al_chk_memo). So you almost have to join the two tables on all three of those fields and I can't get it to work. Here is what I would like the data to look like:

>> EMPLID...........CHECK_DT...........AL_DEDCD.............AL_AMOUNT(1)...............AL_AMOUNT(2)
123456............6/30/2015..............H.............................100.00.............................50.00
987654............6/30/2015..............H..............................50.00..............................25.00
456123............6/30/2015..............H..............................200.00............................0.00

This didn't seem like it was too complicated but no matter how I do it, I can never get the appropriate amount from the employer contribution. I attached a screenshot that shows my queries and result set. In the screenshot, it returned the employee deduction just fine but then returns 48.25 for the employer contribution. However, the MEMO_CD in that specific record is equal to T. In this case, it should return 0.00 for the employer contribution. If I try and add something like d.al_dedcd = c.memo_cd on the join, I barely get any results. The key is matching on those fields and then returning 0.00 when there is no record of MEMO_CD = H in the al_chk_memo table for the deduction in ps_al_chk_memo.

View 9 Replies View Related

Future With SSIS

Jun 29, 2006

Hi,
 
We have a NT service built via Visual Basic 6 which fires dts processes on demand according some criteria. Well, on the whole and basically only for the following rule:
-dts process is executed when our service recognize a concrete plain file leaved in a folder. It€™s generally generated for a mainframe JCL along with a activator file (.nul file, empty). Each application own a folder and each folder have lots of files as the aforementioned ones. Scheduler for that is an ASP application that lives within a intranet. It also is a monitor and logger
 
In that schema, keeping on mind that eight out of ten are ETL processes, critical ones and on daily-basis, our question is, how to handle on with this stuff using by sql25k and its powerful SSIS?? Migrating such dts packages to SSIS packages is a piece of cake (now no before; thanks Jamie, Michael and other guys for your awesome help) because of its tipology. However our main concern is what the hell to use. Centralized dtsx package running all day long as a service, listening and checking for files? .Net windows application either vb or c#? aspx solution? Set of .vbs interlinked among them?
 
This is a old post/goal. In spite of we have not defined any deadline for that, what the heck as time goes by  is more urgent for us. A restriction: we can€™t to programme nothing from our sql25k production cluster physically. Any stuff will be done on workstations.

In terms of cost, no problem at all. We are interested in hear thoughts and point of view about which is the most effective way

Thanks in advance,

View 3 Replies View Related

SQL 2012 :: Transaction Logs On Set Schedules?

Mar 28, 2014

I am doing some general housekeeping for a couple of our SQL boxes in the Development environment. All the databases are set to Simple recovery mode. No need in anything else for these boxes. I have a database on all the boxes named "DatabaseMaintenance" Keeps things like all the sprocs for any type of database maintenance, etc....

I would like to schedule a single sproc that is located in the DatabaseMaintenance database to shrink the Transaction logs on a set schedule. They sometimes grow quite large while testing and developing. The thing that I cannot seem to get around, is when using the ShrinkFile command, one must use the Log Name. If this code is in a sproc that is located in the DatabaseMaintenance database, it will fail when attempting to call out to a different database. Because the Log does not exist on the database that the sproc is located.

How can I get around this small dilemma? There are only about 10 databases per box. To a point we really do not care what happens to them. They are on a Full backup schedule daily, just to keep the objects. As I stated previously, the logs will still grow huge at times while pumping data.

Is there a way to create a piece of code that will run against each database on the server, and be stored in a single database? Other than the system databases of course.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved