How To Know When A Job Has Finished. For Experts I Think.,

Apr 29, 2004

I have this on my page


Dim backUpDB2 As SqlClient.SqlCommand


backUpDB2 = New SqlClient.SqlCommand


backUpDB2.CommandType = CommandType.StoredProcedure


backUpDB2.CommandText = "msdb.dbo.SP_RESUMENFAC"


backUpDB2.Connection = SqlConnection1


backUpDB2.ExecuteNonQuery()








The SP has this





CREATE PROCEDURE .[SP_RESUMENFAC] AS





EXEC sp_start_job @job_name = 'TransferirDatos(FACT) '





GO





WHen I execute the page after the SP it fills some datagrid but the data is not updated bacuase the job takes 1 minute or more to finish.





Is there anyway to prevent to show the old data? or to detect when the job has finished?





Thanks

View 6 Replies


ADVERTISEMENT

Jobs That Have Not Finished

Feb 28, 2000

I am trying to create a SQL Job which will report on another job which hasn't finished within its normal completion time. I schedule the new job late enough after the first job that the first should have finished by then.

I would like to have just queried msdb..sysjobhistory.run_status. However, this seems to only report on job STEP status - and after the step is finished! It is always showing run status = 1 (Complete).

Does anyone know the base meta-data table and column I could query? Enterprise Manager shows the current status as running and I want to know where it gets that.

If it is still running, I will raise an error to notify our support group, etc.

PS: My job steps include a combination of DTSRun commands and TSQL commands. I don't think the flavour of commands should matter...

Thanks.

View 2 Replies View Related

How To Access Back-end Of Finished SQL App

Sep 12, 2004

Hi,

I'm a MS Access developer who needs to help someone migrate/convert from a 'finished' SQL application to Access. How do I gain access to the SQL backend so I can examine/export the raw data? For example, in Access, I would hold down the Shift key while opening the program and it would give me editing rights to the database.

Please be very specific because I have zero experience with SQL.

Thanks,
David

View 7 Replies View Related

How Can You Tell If A File Has Finished Downloadin

May 3, 2006

Currently we have a process where 4 files are ftp'd down to our server. We have DTS package which tests for the existence of these files and once these exist, the DTS package loads the data from these files into a SQL database. Sometimes, however, though the files exist they haven't finished being downloaded so that when the DTS package tries to process them the package is saying the files are empty (though they're not).

Thanks for any help.

View 6 Replies View Related

Errors But Finished With Success

Oct 23, 2006

My ssis package errors out because one of the database connection failed. I successfully logged error but also indicated that package finished successfully. My confusion is if a sheduling software schedules this package, what would be return code sent by dtexe... . would it be success or failure? In this scnerio i want it to return failure so that appropriate team can be contacted.

thanks,

kushpaw

View 1 Replies View Related

Data Flow Finished But Progress Still Going On??

Apr 23, 2008

I have a SSIS package which process 12699 files in a folder. After about 20 minutes it looks like the loading is finished (the record count of database table doesn't change any more) and I believe it's finished, but if I check the Progress tab, it's still showing the file name being processed and still moving. So my first question is: is it still loading files or it's just that the progress message is behind?
Then I click on stop debugging, after a while it stopped but then it's frozen, nothing responds no matter what I click. I haven't saved the package yet so I don't want to close it out. Should I just wait? And what is the problem?

Thanks a lot for your help in advance!!

p.s. I'm exploring SSIS and will convert our current DTS packages to SSIS so you'll see me post more and more questions down the road.

View 7 Replies View Related

SQL Server 2012 :: Check To See If Job Has Finished Before Job Starts?

Jun 23, 2015

I have a job I want to run everyday but before this job starts and I want to check and see if another job has completed before I start this job. i would like to do this in the job steps in SSMS. step 1 is job 'xxxxxxx' running if no go to step 2 if yes exit

View 3 Replies View Related

Missing Data Set When Trying To View For A Finished Report

Mar 6, 2008



Hi All,
I have a solution which is synchronised with visualsourcesafe. Now there are some reports present in the solution, I am able to view the preview of the reports but when I am going to view the dataset definition It is not able to retain its defintion and its becoming blank but this happens to only datasets which were developed from cube and its able to retain dataset which are developed from Database.

Any help would be of great use.

Thanks in advance
Regards

View 1 Replies View Related

How To Programmatically Find Out Whether Snapshot Agent Has Finished?

Oct 15, 2007

Hi,

I want to generate a new snapshot using stored procedures. I want to wait for the snapshot files to be created and then execute a stored procedure. What's the best way to determine that the snapshot has completed successfully? I thought of doing something like:

exec msdb.dbo.sp_help_job
@job_name = @job_name
@job_aspect = 'job',
@execution_status = 1

however I can't put the results of that proc into a temp table because I get this error:
Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 72
An INSERT EXEC statement cannot be nested.

Any ideas? I'd like a T-SQL solution.

Thanks,
Mark.

View 3 Replies View Related

Is There A Way To Know If Execution Of Activated Stored Proc Is Already Finished?

Oct 19, 2006

Hi everyone! Good day!

I'm not really sure if my question should fall on Service Broker or T-SQL, but I hope someone helps me with this... After activating the stored procedure assigned to the queue, is there any way for me to find out if the stored procedure is already finished executing?

I have successfully sent messages to my queue but I have no way to know if all the processing is already done.

Thanks so much!

View 4 Replies View Related

DTS Experts - Help

Feb 12, 2001

Hi,

I've taken up maintaining new server where there were
50+ DTS packages scheduled. How do I document those tasks?
I know the methods of copy to file as dts and cOM objects.
Is there a way to copy it in readable format like VB or Sql?

Thanks

Sam

View 1 Replies View Related

Need Help From Experts

Apr 26, 2004

[FONT=Garamond][COLOR=RoyalBlue][SIZE=2]

Hi guys,

Scenario:
We are currently running an Accounting software in Visual Foxpro 8. All are freetables. We are migrating the whole VFP database to sql server 2000 to provide better service to our users. The leagacy VFP system currently running on the production server. Our intension is to migrate the whole system concurrently without intervening/down the system. We found a feasible way to import data from VFP8 with the help or OLEDB VFP.Now I am the one who needs to take care of the Data Synchronization between VFP and Sql Server. I am quite new to DBA routines. I don't have fair idea to synchronize between VFP and SQL Server 2000. If anybody can suggest which replication methodology can I follow to replicate between VFP and SQL SERVER 2000 or even do some DTS routine to achive this. I hope so there should be way to do it in SQL SERVER 2000 :confused: :confused: .

Please guide me to do this....

View 2 Replies View Related

Where Are The SQL Experts At? Help Please.

Apr 16, 2008

I have the following query. I have two problems with this. For each Region I should only have a CustomerNumber listed once with their SOExtChargeAmount summed. I have some showing up more than once.

The second problem is that after my UNION ALL I need to sum 'AllOthers' as one row of data. I can't figure this out. Any help would be absolutely awesome. Thanks.


SELECT
Region, Location, WarehouseCode, CustomerNumber, CustomerName, MonthLessEleven, MonthLessTen, MonthLessNine, MonthLessEight, MonthLessSeven,
MonthLessSix, MonthLessFive, MonthLessFour, MonthLessThree, MonthLessTwo, MonthLessOne, CurrentMonth, CurrentYearTotal, LastYearYTD,
LastYearTotal, CustRank

FROM
(
SELECT

casewhen substring(gla.Account,5,3) = '936' then 'North Region'
when substring(gla.Account,5,3) = '908' then 'East Region' ELSE 'Unknown'END AS Region,

case
when substring(gla.Account,5,3)='900' then 'ALE'
when substring(gla.Account,5,3)='902' then 'ATO'
when substring(gla.Account,5,3)='904' then 'BOW'
when substring(gla.Account,5,3)='906' then 'BRY'
when substring(gla.Account,5,3)='908' then 'BPT'
when substring(gla.Account,5,3)='910' then 'BYD'
when substring(gla.Account,5,3)='912' then 'BUF'
when substring(gla.Account,5,3)='914' then 'CLE'
when substring(gla.Account,5,3)='916' then 'GRN'
when substring(gla.Account,5,3)='920' then 'DXN'
when substring(gla.Account,5,3)='924' then 'CTH'
when substring(gla.Account,5,3)='926' then 'ELC'
when substring(gla.Account,5,3)='928' then 'FTL'
when substring(gla.Account,5,3)='930' then 'FTW'
when substring(gla.Account,5,3)='932' then 'I35'
when substring(gla.Account,5,3) IN ('936','000') then 'GAI'
when substring(gla.Account,5,3)='939' then 'STW'
when substring(gla.Account,5,3)='940' then 'GRE'
when substring(gla.Account,5,3)='942' then 'HEN'
when substring(gla.Account,5,3)='944' then 'FTS'
when substring(gla.Account,5,3)='948' then 'JAC'
when substring(gla.Account,5,3)='952' then 'JEN'
when substring(gla.Account,5,3)='956' then 'KIL'
when substring(gla.Account,5,3)='957' then 'MCA'
when substring(gla.Account,5,3)='958' then 'MIN'
when substring(gla.Account,5,3)='960' then 'NOC'
when substring(gla.Account,5,3)='962' then 'ODE'
when substring(gla.Account,5,3)='964' then 'BTP'
when substring(gla.Account,5,3)='966' then 'RA'
when substring(gla.Account,5,3)='968' then 'RIF'
when substring(gla.Account,5,3)='970' then 'SWD'
when substring(gla.Account,5,3)='971' then '3PS'
when substring(gla.Account,5,3)='972' then 'ROC'
when substring(gla.Account,5,3)='976' then 'SJO'
when substring(gla.Account,5,3)='978' then 'SMB'
when substring(gla.Account,5,3)='980' then 'STO'
when substring(gla.Account,5,3)='982' then 'TOL'
when substring(gla.Account,5,3)='984' then 'VEL'
when substring(gla.Account,5,3)='985' then 'CFP'
when substring(gla.Account,5,3)='986' then 'CLM'
when substring(gla.Account,5,3)='988' then 'WHI'
when substring(gla.Account,5,3)='992' then 'WRA'
when substring(gla.Account,5,3)='995' then 'ADM' ELSE 'Unknown'END AS Location,

ihh.WarehouseCode,ihh.CustomerNumber, cm.CustomerName,

SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 11 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessEleven,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 10 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessTen,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 9 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessNine,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 8 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessEight,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 7 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessSeven,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 6 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessSix,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 5 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessFive,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 4 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessFour,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 3 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessThree,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 2 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessTwo,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 1 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessOne,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 0 THEN ihd.SOExtChargeAmount ELSE 0 END) AS CurrentMonth,
SUM(CASE WHEN DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 0 THEN ihd.SOExtChargeAmount ELSE 0 END) AS CurrentYearTotal,
SUM(CASE WHEN DATEADD([year], - 1, getdate()) > ihh.SOTransDate AND DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 1 THEN ihd.SOExtChargeAmount ELSE 0 END) AS LastYearYTD,
SUM(CASE WHEN DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 1 THEN ihd.SOExtChargeAmount ELSE 0 END) LastYearTotal,

ROW_NUMBER() OVER(PARTITION BY
casewhen substring(gla.Account,5,3) = '936' then 'North Region'
when substring(gla.Account,5,3) = '908' then 'East Region' ELSE ' 'END
ORDER BY
casewhen substring(gla.Account,5,3) = '936' then 'North Region'
when substring(gla.Account,5,3) = '908' then 'East Region' ELSE ' 'END,
SUM(CASE WHEN DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 0 THEN ihd.SOExtChargeAmount ELSE 0 END) desc) AS CustRank


FROMMAS_BIF_AR1_CustomerMaster AS cm INNER JOIN
MAS_BIF_ARN_InvHistoryHeader AS ihh ON cm.CustomerNumber = ihh.CustomerNumber INNER JOIN
MAS_BIF_ARO_InvHistoryDetail AS ihd ON ihh.InvoiceNumber = ihd.InvoiceNumber INNER JOIN
MAS_BIF_GL_Account AS gla ON ihd.SOGLSalesAcct = gla.AccountKey


GROUP BYihh.CustomerNumber, cm.CustomerName, gla.Account, ihh.WarehouseCode
) X

WHERECustRank < 20


union all

SELECT
Region, Location, WarehouseCode, 'AllOthers', CustomerName, MonthLessEleven, MonthLessTen, MonthLessNine, MonthLessEight, MonthLessSeven,
MonthLessSix, MonthLessFive, MonthLessFour, MonthLessThree, MonthLessTwo, MonthLessOne, CurrentMonth, CurrentYearTotal, LastYearYTD,
LastYearTotal, 20

FROM
(
SELECT

casewhen substring(gla.Account,5,3) = '936' then 'North Region'
when substring(gla.Account,5,3) = '908' then 'East Region' ELSE 'Unknown'END AS Region,

case
when substring(gla.Account,5,3)='900' then 'ALE'
when substring(gla.Account,5,3)='902' then 'ATO'
when substring(gla.Account,5,3)='904' then 'BOW'
when substring(gla.Account,5,3)='906' then 'BRY'
when substring(gla.Account,5,3)='908' then 'BPT'
when substring(gla.Account,5,3)='910' then 'BYD'
when substring(gla.Account,5,3)='912' then 'BUF'
when substring(gla.Account,5,3)='914' then 'CLE'
when substring(gla.Account,5,3)='916' then 'GRN'
when substring(gla.Account,5,3)='920' then 'DXN'
when substring(gla.Account,5,3)='924' then 'CTH'
when substring(gla.Account,5,3)='926' then 'ELC'
when substring(gla.Account,5,3)='928' then 'FTL'
when substring(gla.Account,5,3)='930' then 'FTW'
when substring(gla.Account,5,3)='932' then 'I35'
when substring(gla.Account,5,3) IN ('936','000') then 'GAI'
when substring(gla.Account,5,3)='939' then 'STW'
when substring(gla.Account,5,3)='940' then 'GRE'
when substring(gla.Account,5,3)='942' then 'HEN'
when substring(gla.Account,5,3)='944' then 'FTS'
when substring(gla.Account,5,3)='948' then 'JAC'
when substring(gla.Account,5,3)='952' then 'JEN'
when substring(gla.Account,5,3)='956' then 'KIL'
when substring(gla.Account,5,3)='957' then 'MCA'
when substring(gla.Account,5,3)='958' then 'MIN'
when substring(gla.Account,5,3)='960' then 'NOC'
when substring(gla.Account,5,3)='962' then 'ODE'
when substring(gla.Account,5,3)='964' then 'BTP'
when substring(gla.Account,5,3)='966' then 'RA'
when substring(gla.Account,5,3)='968' then 'RIF'
when substring(gla.Account,5,3)='970' then 'SWD'
when substring(gla.Account,5,3)='971' then '3PS'
when substring(gla.Account,5,3)='972' then 'ROC'
when substring(gla.Account,5,3)='976' then 'SJO'
when substring(gla.Account,5,3)='978' then 'SMB'
when substring(gla.Account,5,3)='980' then 'STO'
when substring(gla.Account,5,3)='982' then 'TOL'
when substring(gla.Account,5,3)='984' then 'VEL'
when substring(gla.Account,5,3)='985' then 'CFP'
when substring(gla.Account,5,3)='986' then 'CLM'
when substring(gla.Account,5,3)='988' then 'WHI'
when substring(gla.Account,5,3)='992' then 'WRA'
when substring(gla.Account,5,3)='995' then 'ADM' ELSE 'Unknown'END AS Location,

ihh.WarehouseCode,ihh.CustomerNumber, cm.CustomerName,

SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 11 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessEleven,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 10 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessTen,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 9 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessNine,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 8 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessEight,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 7 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessSeven,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 6 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessSix,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 5 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessFive,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 4 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessFour,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 3 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessThree,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 2 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessTwo,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 1 THEN ihd.SOExtChargeAmount ELSE 0 END) AS MonthLessOne,
SUM(CASE WHEN DATEDIFF([MONTH], ihh.SOTransDate, getdate()) = 0 THEN ihd.SOExtChargeAmount ELSE 0 END) AS CurrentMonth,
SUM(CASE WHEN DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 0 THEN ihd.SOExtChargeAmount ELSE 0 END) AS CurrentYearTotal,
SUM(CASE WHEN DATEADD([year], - 1, getdate()) > ihh.SOTransDate AND DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 1 THEN ihd.SOExtChargeAmount ELSE 0 END) AS LastYearYTD,
SUM(CASE WHEN DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 1 THEN ihd.SOExtChargeAmount ELSE 0 END) LastYearTotal,

ROW_NUMBER() OVER(PARTITION BY
casewhen substring(gla.Account,5,3) = '936' then 'North Region'
when substring(gla.Account,5,3) = '908' then 'East Region' ELSE ' 'END
ORDER BY
casewhen substring(gla.Account,5,3) = '936' then 'North Region'
when substring(gla.Account,5,3) = '908' then 'East Region' ELSE ' 'END,
SUM(CASE WHEN DATEDIFF([YEAR], ihh.SOTransDate, getdate()) = 0 THEN ihd.SOExtChargeAmount ELSE 0 END) desc) AS CustRank


FROMMAS_BIF_AR1_CustomerMaster AS cm INNER JOIN
MAS_BIF_ARN_InvHistoryHeader AS ihh ON cm.CustomerNumber = ihh.CustomerNumber INNER JOIN
MAS_BIF_ARO_InvHistoryDetail AS ihd ON ihh.InvoiceNumber = ihd.InvoiceNumber INNER JOIN
MAS_BIF_GL_Account AS gla ON ihd.SOGLSalesAcct = gla.AccountKey

GROUP BYihh.CustomerNumber, cm.CustomerName, gla.Account, ihh.WarehouseCode
) X

WHERECustRank > 19

View 8 Replies View Related

EXPERTS HELP

Jul 24, 2007

How can I download a report model from report server into a folder programmatically?

View 3 Replies View Related

Qs. For The Experts Here...Help!

Mar 15, 2007

We are doing a community wide project where we need to extract phone numbers and emails from over 1000s local non-profit and gov. webpages. Any suggestion on the best tool outthere that could help us automate this somewhat?

View 1 Replies View Related

EXPERTS HELP

Jun 19, 2007

ANYONE, FAMILIAR WITH THIS.....





REPORT MODEL> ADD NEW ITEM>AUTO GENERATE>CLOSE SOLUTION>OPEN SOLUTION>OPEN MODEL>VIEW DESIGNER



"THE PROCESS COMPLETED SUCCESSFULLY"



YET A WARNING MESSAGE OF ERROR...

View 7 Replies View Related

SQL Server 2012 :: Don't Start One Statement Until The Previous Is Finished

Mar 3, 2015

I am working with a stored procedure that needs to roll up a week number column once a week - columns are numbered 1-10, 1 being this week, 2 being last week and so forth

Once a week the 10th column is deleted, the 9th becomes 10, the 8th becomes the 9th and so forth and the 1st is calculated the week numbers are getting all screwed up - and we think it's because one statement starts before the one before it completes the statements go like this:

delete theTable where week_num=10;
update theTable set weeknum=10 where weeknum=9;
update theTable set weeknum=9 where weeknum=8;
and so forth

is that the reason? is there any way not to start one statement until the one before it finishes?

View 2 Replies View Related

Execute Script Component After 2 Sequence Finished With Sucess

Jun 28, 2007

Dear Friends,

In the control flow, I have more than one sequence containers, and I have a script component that I want to be executed only when of 2 last sequence finished with sucess... these 2 sequences does not have any relation with each other...

Regards!

View 6 Replies View Related

Help From Experts With A SQL Statement

Jun 17, 2003

Hello all I am trying to write a SQL Statement that will return the fields specified in the Select. However, in some occassion there is no data located in the PS_LEDGER_BUDG C table. I would like to return a zero if possible. When there is no data located in PS_LEDGER_BUDG certain data does not show up. Here is the SQL Statement:

SELECT
A.BUSINESS_UNIT,
A.JOURNAL_ID,
A.JOURNAL_DATE,
B.DEPTID,
B.ACCOUNT,
B.PROJECT_ID,
B.TOTAL_EST_AMOUNT,
C.POSTED_TOTAL_AMT,
B.LEGIS_REF_NBR,
A.OPRID,
B.BUDGET_PERIOD,
A.ACCOUNTING_PERIOD
FROM PS_BUD_JRNL_HEADER A, PS_BUD_JRNL_LN B,
PS_LEDGER_BUDG C
WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT
AND A.JOURNAL_ID = B.JOURNAL_ID
AND A.JOURNAL_DATE = B.JOURNAL_DATE
AND A.UNPOST_SEQ = B.UNPOST_SEQ
AND A.BUSINESS_UNIT = C.BUSINESS_UNIT
AND B.ACCOUNT = C.ACCOUNT
AND B.DEPTID = C.DEPTID
AND B.BUDGET_PERIOD = C.BUDGET_PERIOD
AND B.PROJECT_ID = C.PROJECT_ID
AND C.FISCAL_YEAR = 9999
AND A.JRNL_HDR_STATUS = 'V'
AND A.OPRID = 'ENRI'

I would greatly appreciate any suggestions. Thank you in advance.

David.

View 3 Replies View Related

For You Crystal Experts

Feb 2, 2007

I just started using Crystal, and I have to say, its a pain in the arse.

Can I just run a simple SQL query and get the results I want, without having to use Crystal Syntax?

Here is the query I want to use:


Code:

select * from esmpvald, esmprmtr
where esmpvald.permit_id = esmprmtr.permit_id and
esmprmtr.issue_date >= ('01/01/06') and
esmprmtr.issue_date <= ('12/31/06') and
esmprmtr.permit_id in (select esmvardd.permit_id
from esmvardd, esmudfvr
where esmvardd.var_fld_id = esmudfvr.var_fld_id and
esmvardd.permit_id in
(select esmvardd.permit_id from esmvardd, esmudfvr where esmvardd.var_fld_id = esmudfvr.var_fld_id and
(esmvardd.var_fld_value = 'a') and
(esmudfvr.var_fld_name = 'Commercial Type')) and 1=1)



I will be looping through the "esmvardd.var_fld_value = 'a'" part, going a through f, but for now, I just want to start with the 'a'.

I could do this manually, and throw it in a Word doc, but I'm trying learn this thing. Ideas?

View 1 Replies View Related

Inner Join Experts Out There??

Jul 20, 2005

The scenario:two tablesCustomerTable---------------CustomerIDOrderIDCustomerNameCustomerEmailCustomerPhoneOrderTable---------------OrderIDProductIDProductNameProductCostThis database was handed to me and I was asked to solve a problem - it lookslike an inner join solution would apply, but I'm not 100% sure.There are 14 products total (numbers 1 through 14).I'm looking to get a list of all the customers who have ordered product #1,UNLESS they've ordered product #14 in which case I don't want to know aboutthat customer at all.Any help would be greatly appreciated! I'll watch the newsgroup for theanswer - hopefully your response can help someone else too. However, if youprefer to email me directly, you can send it to me at bunchah at yahoo dotcom.Thanks in advance!(if it'll help, I'll buy the person offering the correct solution a beer -pending age verification of course) ;)-Al

View 11 Replies View Related

T-SQL Experts Please Correct Me !

Feb 27, 2008

Here is the original script
select count(*) FROM (select * from aecprda where
AECPRDA.sales_cat_cd in ('02','10') and
(create_dt > '2008-02-17 18:10:22.000' or price_chg_dt > '2008-02-17 18:10:22.000')
) AS AECPRDA_1
left join (zfmt z inner join muzealbums on z.muzenbr=muzealbums.muzenbr) on AECPRDA_1.product_id = z.vendorcode
and z.Vendorname = N'Alliance'
LEFT OUTER JOIN AECMCAT aecmcat_c3
ON AECPRDA_1.mcat_cd3 = aecmcat_c3.Mcat_cd

I want to add a condition [(substring(AECPRDA_1.upc_1,1,11) = substring(z.upc,1,11) or
(AECPRDA_1.product_id = z.vendorcode))] instead of [AECPRDA_1.product_id = z.vendorcode] TO THE ABOVE STATEMENT.
It is a secondary match condition

1. If aecprda_1.upc_1 doesn€™t find a match on zfmt.upc then
2. Match on aecprda_1. product_id = zfmt. Vendorcode
3. I also want to add a condition if there is a product match on both 1 & 2 , then take only the first one and don€™t take the second one.

Something looks like below statement but needs one more condition mentioned at item 3 to be added.

select count(*) FROM (select * from aecprda where
AECPRDA.sales_cat_cd in ('02','10') and
(create_dt > '2007-10-22 00:00:00.000' or price_chg_dt > '2007-10-22 00:00:00.000')
) AS AECPRDA_1
left join (zfmt z inner join muzealbums on z.muzenbr=muzealbums.muzenbr) on (substring(AECPRDA_1.upc_1,1,11) = substring(z.upc,1,11) or
(AECPRDA_1.product_id = z.vendorcode))
and z.Vendorname = N'Alliance'
LEFT OUTER JOIN AECMCAT aecmcat_c3
ON AECPRDA_1.mcat_cd3 = aecmcat_c3.Mcat_cd --- I ran this query executing takes hour eventhough appropriate indices were added.

Any help is greatly appreciated.

View 7 Replies View Related

ADVISE.....Experts ! Please

May 15, 2008

I am an Application Developer.
I know just this about T-SQL :
Insert, UPDATE, delete aRecord.
JOIN tables.
Create a Hierarchy column.
execute MERGE Statement. [in order to create IDENTICAL tables .]

Create a Master-detail TABLE . [PrimaryKey-Foreig-Key]

WHAT ELSE SHOULD I KNOW widly speaking about T-SQL ??

What are ESSENTIAL things you should know to Be a BIT of an EXPERT ???



Please be STRAIGHT and SIMPLE.



THANKs a LOT.




View 8 Replies View Related

I Couldn't Access The Secondary Database After I Finished Shipping Configuration

Apr 19, 2006

Dear All

Please I need an urgent help

After i finished all Transaction Log Shipping Configuration.

I tried to use the database in the secondary database but i couldn't access it

i saw it in SQL Managment Studio as (Restoring......)

i tired to make a database snapshot from it , i had a message

Msg 1822, Level 16, State 1, Line 1

The database must be online to have a database snapshot.

Please urgently

View 1 Replies View Related

C:Program FilesMicrosoft SQL Server90Setup Bootstrapsetup.exe Finished And Returned: 1627

Nov 14, 2006

Hello,

We are running Windows Server 2003 SP 1 and trying to upgrade SQL 2000 SP 4 to SQL 2005 using the command line.

The process finishes in under ten minutes. Summary.txt file we have this information:

Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGFilesSQLSetup_<ServerName>_SQL.log
Last Action : ValidateUpgrade
Error String : The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
Error Number : 2259

In the log file named SQLSetup_ServerName_Core.log I found the following:

Error: Action "LaunchLocalBootstrapAction" threw an exception during execution. Error information reported during run:
"C:Program FilesMicrosoft SQL Server90Setup Bootstrapsetup.exe" finished and returned: 1627
Aborting queue processing as nested installer has completed
Message pump returning: 1627


After receiving this info, I can navigate to the setup.bat for the SQL 2005 upgrade and complete the upgrade without error. We are planning on 500 of these, so manual updates is a very ugly concept.

I'd appreciate any and all ideas on where to go from here.

Most Sincerely.

View 7 Replies View Related

SQL Server 2014 :: SSIS Packages Are Reporting Complete Before Finished Loading

Apr 26, 2015

We've recently upgraded to SQL Server 2014, and are now using SSIS integrated with Visual Studio. We have a SSIS project which contains about 20 packages which are nested in Sequence Containers and executed concurrently. These packages have been set up as project references.

The problem is that when I press the start button to run the packages, they all light up green reporting completion before the data has finished loading into the SQL database. If I press the stop button without waiting a sufficient length of time, then not all of the data gets loaded. i.e. a certain number of rows will be missing from some of the SQL tables.

If I click through to the individual package items and check the data flow progress while running, some of the data flows appear to hang at a certain number of rows without ever reaching completion. The number of rows indicated in the data flow is incorrect - i.e. it will count up to ~150,000 and stay there indefinitely in the running state, when in actual fact there are ~500,000 rows to load.

To clarify, the main package will show all items green and display the "Finished: Success" message in the log window, however when I drill through to certain packages in the set, they'll be stuck in the yellow running state, with no way of knowing whether they've actually completed or not.

My current workaround is to just wait a certain length of time before pressing the stop button. This bug doesn't seem to inhibit rows being loaded - it just incorrectly identifies the point when the load finishes, causing people to terminate the load prematurely.

This issue only occurs if I run the project from the main package container. If I execute the child packages individually, they correctly report the number of rows being loaded and light up green once complete.

View 2 Replies View Related

Performance Experts Click Here

Jul 28, 1999

Scenario..

Table 1 = Product (one row per productID, also has second key, KEY2)
Table 2 = Usage (many rows per KEY2)

I have a view that aggregates Usage GROUP BY Key2 - Usage_VIEW

I create a view over Product and Usave_view joining on KEY2 - Final_VIEW

When I query Product with a where Product = 'x'
the time is under 1 second return.
I then take the Key2 value returned and query my Usage_View
the time is under 1 second to return.

BUT, if I query My Final_VIEW with where product = 'x'
I can take a coffee break.

Question? Does the aggregate of Usage get performed before limiting to the matching rows in Product?

Can I use "Force Order" hint to make the first table limit the search on table 2? If so, please give syntax on FORCE ORDER. I can't seem to figure it out.

View 2 Replies View Related

Microsoft Corporation Needs SQL Experts

Sep 6, 2006

Hi,

I am a Microsoft Recruiter, and we are hiring SQL Premier Field Engineers in DC, AZ, CA, CO, and MA. Is there a place on the site where I can post these roles? If you know anyone who may be interested, please have them to contact me. I would be happy to send a job description.

Thank you.

View 4 Replies View Related

Calling All SQL And Informix Experts!

Jan 15, 2004

Our Informix server is struggling with all the reports we run and so we are thinking of making a dedicated server for reporting.

SQL is an obvious choice because we have it already for our retail system.

However, the challenge is how to download the data we need each night. DTS works a treat but it is the volume of data that is the problem.

We are a retail operation and we need to download the transactions from our Informix server into SQL. This data gets into Informix from the EPOS system in our stores.

What we don't want to do is download everynight the entire back history of transactions. We could do this by using the date of the transactions but we discovered it wont work.

The problem is that if a store doesn't post their transactions e.g. because of a system failure then these will get missed.

What we need to do is record which transactions are downloaded into SQL and then compare this against what is on the Informix server and then download the difference each night.

We thought of adding a flag onto the Informix server but we are not able to make any modifications to it.

I think we could log the downloaded transactions in a SQL table and then use this as a record of what has been downloaded. We could then run a query that compares this to what is on the Informix server.

With the right indexes I think this could work really well. Any thoughts? Incidently the two servers are separated by a 512Kbps wan link......

View 1 Replies View Related

One For The SQL Experts - Dare I Say TRICKY SQL!

Feb 7, 2006

Guys,Hopefully someone can help.We have a monitoring program that has threads which start and stopmonitoring at various times. There are two tables:THREADLIFECYCLEunique_idstart_time (always populated)end_time (not populated until the thread ends)MONITORRESULTSunique_idtime_of_measurementvalueWhat I am trying to do is find the average value for each of thenumbers of running threads. To explain further, threads will start,stop independently and overlap each other.I want an output that says:When 1 thread was running: average value was xWhen 3 threads were running: average value was yDue to the start and stop nature there could be 1 thread running at thebeginning of the test, mid way through, a number of occassions, etc.Also, the number of threads does not necessarily ramp sequantially -the number running at any time could be like this sequence: 1, 5, 10,7, 12, 4, 2ANY help would be much appreciated - it really has stumped me but lookslike it should be so simple .... But aren't they always the hard ones;-(ThanksGraham

View 22 Replies View Related

Need Experts On Vb.net CLR Intergration Problem

Feb 5, 2007

Hi all I have the following CLR stored procedure :



Partial Public Class StoredProcedures

<Microsoft.SqlServer.Server.SqlProcedure()> _

Public Shared Sub sssGetActiveRepositoryByTitle( _

ByVal title As String)

' Add your code here

Using conn As New SqlConnection("context connection=true")

Dim objCommand As New SqlCommand()

Dim TitleParam As New SqlParameter("@Title", SqlDbType.VarChar, 100)

TitleParam.Value = title

objCommand.Connection = conn

conn.Open()

'build the delete command

objCommand.CommandText = _

"select * from sstRepository where IsActive = 1 and Title =" & TitleParam.Value.ToString

SqlContext.Pipe.ExecuteAndSend(objCommand)

conn.Close()

End Using

End Sub



Now I have a windows service in my data layer that needs to access this stored procedure and convert it into a dataaset to pass to the client application :

Imports System.Data.SqlClient

Imports NBS.SURVEYSDATABASEservice.DBMS

Public Class clsClient

' it inherits the stored procedures from the DBMS class which is the name

'of the CLR dll

Inherits StoredProcedures

Public Function GetClientByVirtualPath(ByVal pstrVirtualPath As String) As DataSet

Try

Dim i As SqlDataReader

'parameters are stored in an array (zero based) for use in the base class

Dim parmArrSqlParms(0) As SqlClient.SqlParameter

' Dim fff As Int32

i = sdsGetClientByVirtualPath(pstrVirtualPath)

' Return MyBase.RunProcedure("dbo.sdsGetClientByVirtualPath", parmArrSqlParms)



Catch ex As Exception

'log the error

'cLogger.LogMessage("ACME", "SampleApplication", Logger.EntryTypes.RunError, System.Environment.MachineName, "clsDemoClass.SelectAllCompanies", ex.Message)

'raise the error to the caller for handling

Throw ex

End Try

End Function



I've tried a bunch of different things to no avail the error I keep getting trying to access the sqlpipe resulsts is " this expressions does not return any values"



any ideas ? I am basically converting around TSQL 50 stored procs into managed CLR code and the CLR funtions are created but I am really having problems accessing the resuluts on the client end .



Help please !

View 1 Replies View Related

Getting A SQL Database Error...any Ideas SQL Experts?

Jun 26, 2007

 I am trying to insert a value into a field in a database named ASPNETDB.MDF.  The table name is "profiles_BasicProperties" and the field name is "UserID".  I get an error when I attempt to do this.  See the code I am using to try to do this below...and then the error that I get which is further down in this post.  Note...both the code and the database are on my laptop.  I can connect to the database just fine using Server Explorer in MS VS 2005.  Thanks in advance for any help anybody can offer...
 Here is the code I am using:
<%@ Page Language="VB" MasterPageFile="~/Master02.master" Title="Create Your Free Account" Debug="true"%><%@ Import Namespace="System.Data.SqlClient" %><%@ Import Namespace="System.Web.Configuration" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_Main" Runat="Server">
<script runat="server">        Sub CreateUserWizard_CreatedUser(ByVal sender As Object, ByVal e As EventArgs)                Dim CWZ As CreateUserWizard        CWZ = CType(Me.LoginView1.FindControl("CreateUserWizard"), Wizard)
        CreateUserProfile(CWZ.UserName)
    Private Sub CreateUserProfile(ByVal UserName As String)            Dim conString As String = WebConfigurationManager.ConnectionStrings("Main").ConnectionString        Dim con As New SqlConnection(conString)        Dim cmd As New SqlCommand("INSERT profiles_BasicProperties (UserName) VALUES (@UserID)", con)        cmd.Parameters.AddWithValue("@UserID", UserName)        Using con            con.Open()            cmd.ExecuteNonQuery()        End Using            End Sub
</script>
 ...and here is the error and stack trace (the offending Line 49 is in bold):
 Server Error in '/Site_Dev' Application.--------------------------------------------------------------------------------
An attempt to attach an auto-named database for file ~App_DataASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. 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: An attempt to attach an auto-named database for file ~App_DataASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Source Error:
Line 47:         cmd.Parameters.AddWithValue("@UserID", UserName)Line 48:         Using conLine 49:             con.Open()Line 50:             cmd.ExecuteNonQuery()Line 51:         End Using 
Source File: C:UsersmdcraggDocumentsWebsiteSite_DevUser_Create.aspx    Line: 49
Stack Trace:
[SqlException (0x80131904): An attempt to attach an auto-named database for file ~App_DataASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +736211   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1959   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +237   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +374   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +192   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105   System.Data.SqlClient.SqlConnection.Open() +111   ASP.user_create_aspx.CreateUserProfile(String UserName) in C:UsersMatthewDocumentsGroup 02 - PoliticoreSite_DevUser_Create.aspx:49   ASP.user_create_aspx.CreateUserWizard_CreatedUser(Object sender, EventArgs e) in C:UsersMatthewDocumentsGroup 02 - PoliticoreSite_DevUser_Create.aspx:30   System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e) +105   System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +341   System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453   System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149   System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
 
--------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:2.0.50727.312; ASP.NET Version:2.0.50727.312

View 1 Replies View Related

Database Design Question For Experts

May 15, 2005

Hi,
I have 2 design related questions.
Q1: We are developing a huge .NET e-commerce web application with a number of modules - Shopping, 'For Sell' , 'For Rent', News, Jobs, Community, Matchmaking etc. These modules will store data into SQL server 2000 database server. 'For Sell' module will be used for all user ADs for selling items(addupdatesearch), similarly 'For Rent' module will be for Rentals ADs. The site will be open for 20+ different countries initially and will store unlimited ADs (eg. 200,000 For Sell ADs), Shopping Catalog (100,000 items).
We have some tables shared by all modules: module, module_category, module_subcategory, country, users, user_group etc. Some tables are module specific: forsell, forsell_attributes, forsell_att_values, shopping, shopping_review etc. The big design question that our team is facing is whether to make one single huge database and create all associated tables for all modules in it VS create separate database for each modules and have a central database for common tables.
Q2: Will it be better to create a single web application or different web application for each module?
Please give us your expert inputsuggestions ips that will guide our team to the right direction.
Thanks
Jennifer

View 5 Replies View Related







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