Question

Basic package 101 - using evalution of data

Asked by: Laura2112

I am brand new to this. I would like a package to do the following. In the DataFlow task, I would like to evaluate if the table has the most recent indicator set for the month. If yes, I want to exit the entire package. If no, I want to update the table, run several procedures and then execute a package task at month end.  I think I need to add Failure and Success contraints but am unsure of where to evaluate them .
My query is doing the following: If I get a row back, I will do nothing. That means my current  month is set to 0 as it should be.  But I want to evaluate if @@ROWCOUNT > 0 THEN update the table, run the procs, run the package for the end of the month.

Once my SQL runs in the DataFlow task, what do I do then in the package?

DECLARE @DT DATETIME, @TimeKey INT
SET @Dt = Convert(DateTime,Convert(VarChar,GetDate(),101))
SET @TimeKey = (SELECT TimeKey FROM CommonDW.dbo.dimTime  
                WHERE  FullDateAlternateKey = @Dt)
 
SELECT @TimeKey
-- Test to be sure it is still the current month. MonthInd should be 0.
DROP TABLE #CurrentMonth
SELECT * INTO #CurrentMonth
FROM
(
  SELECT MonthStart, MonthEnd, MonthInd
  FROM tblMonth_Quarter M 
  WHERE @TimeKey BETWEEN  MinMonthKey AND MaxMonthKey AND MonthInd = -1
)t
 
-- if it is not the curent month any longer, I want to set the MonthInd to -1. 
 
IF @@ROWCOUNT = 0
BEGIN
--  Update the table 
UPDATE M
SET MonthInd = -1		
FROM tblMonth_Quarter M 
WHERE @TimeKey > (SELECT MAX(MaxMonthKey) FROM  
                  tblMonth_Quarter WHERE MonthInd = -1)	   
END

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-11-06 at 12:45:33ID23883198
Topics

SSIS

,

SQL Server 2005

Participating Experts
3
Points
500
Comments
78

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Set RowCount and extract rowcount position stored proced…
    Hi, Ive got a stored procedure that basically insert 40 records into a table. I limit the number of rows it can insert by doing the following. SET ROWCOUNT 40 INSERT INTO ChartEntries(ChartID,TrackID) SELECT @NewChartID, TrackID FROM Tracks WHERE Tracks.TrackType = 1 Or Tra...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: HoggZillaPosted on 2008-11-06 at 12:51:17ID: 22899407

You should put an Execute SQL Task in the Control Flow window and that is where you evaluate the indicator. Then, you connect the arrow from that to the next task. Right click on the arrow and set a constraint. Would you like an example?

 

by: HoggZillaPosted on 2008-11-06 at 12:57:02ID: 22899470

Here is an example of a precedence constraint. You will want to evaluate your indicator and populate a variable. I am also attaching my instructions on how to populate a variable. You will want to use the one designed to work with an Execute SQL Task.

 

by: HoggZillaPosted on 2008-11-06 at 13:00:57ID: 22899506

Then, if you pass your expression and you want to continue - add another Execute SQL Task to perform the update. Here is some great instructions for working with the Execute SQL Task.

http://www.sqlis.com/post/The-Execute-SQL-Task.aspx

 

by: Laura2112Posted on 2008-11-06 at 13:05:27ID: 22899549

Cool, let me play for a bit and I will be back it touch, thanks HoggZilla!

 

by: Laura2112Posted on 2008-11-06 at 13:12:23ID: 22899620

Holy Makrel! This is some good stuff, Steve!   Do you actually teach SSIS?

 

by: jbauer22Posted on 2008-11-06 at 13:50:47ID: 22899978

This is Steve's boss.  Steve, get back to work.

 

by: HoggZillaPosted on 2008-11-06 at 14:13:54ID: 22900175

Yep, that's my boss. He still thinks I work all day.

I love helping people with SSIS, for the points :-). Unless I get fired, then I might start soliciting.

Thanks for the compliment.

 

by: Laura2112Posted on 2008-11-06 at 14:19:11ID: 22900218

That is so funny!  Well, I just figured out how to get to the Variables.. Full stream ahead!  When I entered my logic into the SQL Statement, I got the error that The Declare cursor SQL construct or statement is not supported. So, I am not sure where to go now.

 

by: HoggZillaPosted on 2008-11-06 at 14:23:04ID: 22900251

I don't think a cursor is supported in the Execute SQL Task, so ... reading back up top to your original question. What is the minimal SQL Statement you need to run in order to return the indicator. But just to be clear, what is the SQL Statement you were trying to execute? Cant create a recordset in the SQL Task either.

 

by: Laura2112Posted on 2008-11-06 at 14:29:02ID: 22900306

I could do all of the above in a simple proc and just run the that proc from the Execute SQL Task.
Then my basic task is just 'Is it the first day of the month and do I need to run my procs and other packages? If no, end the package processing. If yes, pass my date variable to the procs and run.

 

by: HoggZillaPosted on 2008-11-06 at 14:38:29ID: 22900376

Exactly. So you create a variable, DAY_OF_MONTH, Int32 Data Type. You run an Execute SQL Task with the Result Set to Single Row. The following SQL or whatever you need.

SELECT DATEPART(dd,GETDATE())

On the Result Set tab map Column 0 to your variable and then you have the means for a precedence constraint.

@[User::DAY_OF_MONTH] == 1

That will solve that step. Next?

 

by: Laura2112Posted on 2008-11-06 at 14:57:57ID: 22900563

Ok, proc is done. I have it as my first SQL task. How do I default my variable to use the current date?
Variable Name = Today  Datetype = DateTime Value = current date. I clicked on todaysdate but I want that to be the default, like I would for GETDATE()

 

by: Laura2112Posted on 2008-11-06 at 15:09:46ID: 22900636

Found Expression Builder in your documentation :)

 

by: Laura2112Posted on 2008-11-06 at 15:31:03ID: 22900766

Ok, On the Result Set tab map Column 0 to your variable and then you have the means for a precedence constraint.
When I go to the Result Set, I do not see where there are columns. I see ResultName and Variable Name. I don't see how to get back to the variable I created in Expression Builder.

 

by: Laura2112Posted on 2008-11-06 at 15:52:55ID: 22900907

[Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_SingleRow". Can't get it to execute. This comes back though from my SQLStatementSource from my expression. 2008-11-06 18:47:27.619000000. As much as I hate to, I have to leave for the evening, 7:00 pm.. I hope you may be available tomorrow. This is fun!

 

by: HoggZillaPosted on 2008-11-06 at 16:22:51ID: 22901082

Variables:

You created the variable in the Variables window. You defined it's value by Expression. When you use that variable as part of a precedence constraint you have to type it in manually, no drowpdown or intelligent assist.

@[User::YourVariable]

We can work on the SQL Task Error tomorrow. Paste your SQL Statement here. Verify it does not return more than 1 row of data.

 

by: nmcdermaidPosted on 2008-11-06 at 17:02:29ID: 22901249

In your original script, all this:

DROP TABLE #CurrentMonth
SELECT * INTO #CurrentMonth
FROM
(
 SELECT MonthStart, MonthEnd, MonthInd
 FROM tblMonth_Quarter M
  WHERE @TimeKey BETWEEN  MinMonthKey AND MaxMonthKey AND MonthInd = -1
)t

-- if it is not the curent month any longer, I want to set the MonthInd to -1.

IF @@ROWCOUNT = 0
BEGIN

can be replaced with

IF EXISTS (  SELECT 1  FROM tblMonth_Quarter M
  WHERE @TimeKey BETWEEN  MinMonthKey AND MaxMonthKey AND MonthInd = -1
)
BEGIN

unless you aer using #CurrentMonth elsewhere

and just FYI it is not necessary to do this in a package, it can all be done in T-SQL.

Have fun anyway.

 

by: HoggZillaPosted on 2008-11-10 at 11:35:16ID: 22924700

Laura, how are you doing with your SSIS?

 

by: Laura2112Posted on 2008-11-10 at 12:01:19ID: 22925004

Hi Hoggzilla! Just getting back to it. Not far, to answer your question, I was out Friday. I have the first SQL Task executing. It updates tables if necessary.  I didn't figure out the variable though. What I want to do now is have the second SQL task look to see if it is the first day of the period by coding. if so, execute the three procs.

DECLARE @DT DATETIME, @MonthStart DATETIME, @MonthEnd DATETIME
SET @Dt = Convert(DateTime,Convert(VarChar,GetDate(),101))
SET @MonthStart =
(SELECT MAX(MonthStart) FROM tblMonth_Quarter M  WHERE MonthInd = -1)
SET @MonthEnd =
(SELECT MAX(MonthEnd) FROM tblMonth_Quarter M  WHERE MonthInd = -1)

IF @DT = @MonthEnd + 1
BEGIN
EXEC spPartD_DrugCard @MonthStart , @MonthEnd
EXEC spPartD_FirstOrder
EXEC spPartD_Unique_Bucket @MonthStart , @MonthEnd
END

Then go on to run other packages.

      GO

 

by: HoggZillaPosted on 2008-11-10 at 12:25:43ID: 22925212

>>DECLARE @DT DATETIME, @MonthStart DATETIME, @MonthEnd DATETIME
SET @Dt = Convert(DateTime,Convert(VarChar,GetDate(),101))
SET @MonthStart =
(SELECT MAX(MonthStart) FROM tblMonth_Quarter M  WHERE MonthInd = -1)
SET @MonthEnd =
(SELECT MAX(MonthEnd) FROM tblMonth_Quarter M  WHERE MonthInd = -1)

IF @DT = @MonthEnd + 1

What you will want to do is fill a variable with a Yes or No to continue. So in your execute SQL Task you would have something like this:

SELECT CASE WHEN @DT = @MonthEnd + 1 THEN 'YES' ELSE 'NO' END

Then in your result mapping, add a variable to receive this result. I have information about this in the doc you have. Let me know if you have trouble.

Then you create a Precedence Constraint between this Execute SQL Task and a Sequence Container which contains your Execute SQL Task or Tasks for DrugCard, FirstOrde and Unique_bucket sp's.

 

by: Laura2112Posted on 2008-11-10 at 12:46:46ID: 22925383

I created two variables one called Yes the other No. Both strings, values set at Yes and No.      
In my task editor, I have a single result set. When I go to ResultSet, I have two variable names User::Yes and User::No. Do I set each to 0 for the index under Result Name?

 

by: HoggZillaPosted on 2008-11-10 at 12:49:45ID: 22925406

You actually only need one variable, something like User::Answer. Then you will populate it with a Yes or No value. That variable is then the determining factor for your precedence cosntraint.

 

by: Laura2112Posted on 2008-11-10 at 12:50:26ID: 22925414

Shouldn't I be able to create just one variable that allows either yes or no? Can I leave it blank for the value?

 

by: Laura2112Posted on 2008-11-10 at 13:03:28ID: 22925509

I added the precedence contraint between the SQL Task and a sequesnce container. Not seeing where I get to the precedent Contraint editor like above, I have to go to a meeting but should be back relatively soon, hopefully less than 30 minutes

 

by: HoggZillaPosted on 2008-11-10 at 13:41:21ID: 22925847

Right click on the connecting arrow and select Edit. Or you can double click.

 

by: Laura2112Posted on 2008-11-10 at 13:57:34ID: 22926001

I am referencing a variable that I have since deleted. I changed the variablew name to Answer,  leaving the value blank. This is telling me that it failed to lock variable User::No

 

by: Laura2112Posted on 2008-11-10 at 14:05:14ID: 22926085

It was sucessful. Next?  It now has the blue line pointed to the sequence container.

 

by: HoggZillaPosted on 2008-11-10 at 14:41:48ID: 22926393

Have you verified the Answer variable is populated? And your constraint has the little Fn box next to it that indicates an Expression is part of the constraint?

 

by: Laura2112Posted on 2008-11-10 at 14:42:26ID: 22926404

I created the variables for MonthStart and MonthEnd to pass to the proc when the answer = "Yes". Do I put an SQL task inside of the Sequence Container?  How to I test that the variables are set for the code?

 

by: Laura2112Posted on 2008-11-10 at 14:45:04ID: 22926423

The expression validated sucessfully. The little fx is part of the precedent constraint.

 

by: HoggZillaPosted on 2008-11-10 at 15:01:33ID: 22926555

You don't have to use a sequence container, but you can. If you do, then yes, put the Execute SQL Task inside.

To check on variable values, add a breakpoint and when it breaks, go to the locals window. It will be available when the package breaks.

I choose the task to break on, right click and select edit breakpoints. On Post Execute.

 

by: Laura2112Posted on 2008-11-10 at 15:23:57ID: 22926695

I have to leave.  Not getting my "Yes" or the MonthStart or MonthEnd in locals, all of which I declared in
the Evaluated Current Date SQL Task and made variables of each. I may try to log on later. Thanks for everything so far!

 

by: Laura2112Posted on 2008-11-11 at 10:09:28ID: 22932966

You roaming around out there Hoggzilla?

 

by: Laura2112Posted on 2008-11-11 at 10:32:12ID: 22933185

Here is wher I am at. I am not seeng my variables in the local window. The 2nd Execute task processed. Even when I reversed the logic, I should have seen something.  My variables are @MonthStart, @MonthEnd and @Answer.

DECLARE @DT DATETIME, @MonthStart DATETIME,       @MonthEnd DATETIME
SET @Dt =       Convert(DateTime,Convert(VarChar,GetDate(),101))
SET @MonthStart = (SELECT MAX(MonthStart) FROM tblMonth_Quarter M  WHERE MonthInd = -1)
SET @MonthEnd = (SELECT MAX(MonthEnd) FROM tblMonth_Quarter M  WHERE MonthInd = -1)
      
SELECT @MonthStart MonthStart, @MonthEnd MonthEnd, CASE WHEN @DT > @MonthEnd + 1 THEN 'YES' ELSE 'NO' END Answer

I expect  to see     2008-09-28 00:00:00.000     2008-10-25 00:00:00.000      YES

 

by: HoggZillaPosted on 2008-11-11 at 11:29:02ID: 22933392

Roaming? LOL!!!

Do you have the variables defined in the "official" variables window for SSIS?

Menu, SSIS, Variables

 

by: Laura2112Posted on 2008-11-11 at 11:59:06ID: 22933619

I do :)

 

by: HoggZillaPosted on 2008-11-11 at 12:09:48ID: 22933733

You are not seeing the breakpoint (locals) window because of the error. What does the Output window display when the task turns RED?

 

by: Laura2112Posted on 2008-11-11 at 12:22:38ID: 22933868

I got it to work since that last screen shot. It did not like the names NewResultName for all of the variables. Imaging that. Now the result Names are named accordingly.

 

by: HoggZillaPosted on 2008-11-11 at 12:30:10ID: 22933941

Ok, so to get it to break you have to execute the entire package, not just the task. If you don't want to run the first step, remove the constraint and disable it. Right Click, Disable. The break will look like this.

 

by: Laura2112Posted on 2008-11-11 at 12:34:12ID: 22933982

Still nothing in locals. It went to green pretty fast.

 

by: Laura2112Posted on 2008-11-11 at 12:36:10ID: 22934001

see attached. Should the next task be set up in any way,? for now I just dragged a Dataflow taks over so I had something at the other end of the constraint.

 

by: HoggZillaPosted on 2008-11-11 at 12:40:34ID: 22934047

Screen shot the Breakpoint setup. And are you running the entire package, using the Green Start arrow up top?

 

by: Laura2112Posted on 2008-11-11 at 12:46:16ID: 22934113

I disabled the first SQL task. Once it is out of Debug, I right in the SQL Task, and click Execute Task

 

by: HoggZillaPosted on 2008-11-11 at 12:55:59ID: 22934215

You have to run the entire package to instantiate breaks. The Execute Task option wont trigger the break.

 

by: Laura2112Posted on 2008-11-11 at 13:18:54ID: 22934420

SWEET! !  I hate to leave and go to the dentist but I have to. Where are you located? We have different hours. I am in Florida. Yes, it's gorgeous! Thanks for everything so far! Quick question, since I am going to execute three procs, should I stay in the Control Flow or go to Data Flow for the DataFlow task?  How does SSIS know to continue the processing over there?  What are the guidelines when to use each, other than Control Flow can only process a task at a time?

 

by: HoggZillaPosted on 2008-11-11 at 13:22:53ID: 22934464

I am in ........... Florida! I know, the weather is absolutely awesome! Lakeland, Florida to be exact.

Control flow is what you will need, just using an Execute SQL Task to execute.

 

by: Laura2112Posted on 2008-11-12 at 08:32:54ID: 22941293

Hi Hoggzilla,
Me still. I am passing the variables to the proc now. I set a breakpoint to break when the container receives the OnPreExecute event. Is that the wrong choice for the breakpoint?
My SQLStatement is exec spPartD_DrugCard @MonthStart, @MonthEnd.

 

by: Laura2112Posted on 2008-11-12 at 08:39:28ID: 22941373

Also, how do I take the time off of  User::MonthStart      {9/28/2008 12:00:00 AM}      DateTime

 

by: HoggZillaPosted on 2008-11-12 at 08:55:05ID: 22941594

In the Execute SQL Task you need to define the input parameters. It would look someting like this in your script.

In the Parameters tab you need to setup the mapping for this question marks. The first one is 0, the second is 1.

You need to set BypassPrepare to True since you have parameters.

As for taking the time off the datetime, couple ways. Probably best to select the values into the variables without time. Of course you also need to change the variable data type to String. You could also create two new variables, and define them by expressions. MonthStartNoTime, MonthEndNoTime. Evaluate as expression = True, define the expression to drop the time. Here is a SQL statement to select the value as a String value without time.


convert(char(12),@vDateVariable,110)

DECLARE @MonthStart as datetime;
DECLARE @MonthEnd as datetime;
 
SET @MonthStart = ?;
SET @MonthEnd = ?;
 
Exec spPartD_DrugCard @MonthStart, @MonthEnd
                                              
1:
2:
3:
4:
5:
6:
7:

Select allOpen in new window

 

by: Laura2112Posted on 2008-11-12 at 09:35:14ID: 22942071

Thanks. I already have the dates set up as variables, do I still have to declare new ones? They populate in the local window after the Evaluate current Date SQLTask. I'd have thought I could just pass those??

 

by: Laura2112Posted on 2008-11-12 at 09:50:16ID: 22942211

Not sure where I set it up as 0 and 1

 

by: HoggZillaPosted on 2008-11-12 at 09:57:46ID: 22942272

Parameter Name. The first ? is 0, the second is 1. Each type of OleDb has their own way of doing it. For SQL Server, zero based indexes.

 

by: Laura2112Posted on 2008-11-12 at 10:09:32ID: 22942388

Not working. Getting tired of this yet??
in SQLTask -
DECLARE @MonthStart as datetime;
DECLARE @MonthEnd as datetime;
SET @MonthStart = 0;
SET @MonthEnd = 1;
exec spPartD_DrugCard  
convert(char(12),@MonthStart,110), convert(char(12),@MonthEnd,110)

 

by: HoggZillaPosted on 2008-11-12 at 10:22:40ID: 22942518

in SQLTask -
DECLARE @MonthStart as datetime;
DECLARE @MonthEnd as datetime;
SET @MonthStart = ?;
SET @MonthEnd = ?;

DECLARE @MonthStartNoTime as varchar(12);
DECLARE @MonthEndNoTime as varchar(12);
SET @MonthStartNoTime = convert(char(12),@MonthStart,110);
SET @MonthEndNoTime = convert(char(12),@MonthEnd,110);

exec spPartD_DrugCard  @MonthStartNoTime, @MonthEndNoTime

I'm earning my points on this one.:-)

 

by: Laura2112Posted on 2008-11-12 at 10:28:14ID: 22942575

You are not kidding about that! Am I allowed to award more than the 500??
I get the error 'Faild to lock variable 0 for read access with error... variable cannnot be found

 

by: HoggZillaPosted on 2008-11-12 at 11:41:19ID: 22943309

Send me a screen shot of the Parameter Mapping page. Something aint right.

500 is max :-) Thanks though. Maybe I can help on your next question.

My sign reads: Will Work For Points!

Subtitle: Which have no value whatsoever anywhere in the world but I don't care.

 

by: Laura2112Posted on 2008-11-12 at 11:49:15ID: 22943391

I am close now, but am not seeing the last column Parmaeter... with the -1. What does the -1 mean anyway?

 

by: HoggZillaPosted on 2008-11-12 at 11:52:04ID: 22943425

It is a little something extra you get with SP2. -1 is the default. I don't use it. :-)

 

by: HoggZillaPosted on 2008-11-12 at 11:53:32ID: 22943440

Where are you in Florida? Company? Position?

 

by: Laura2112Posted on 2008-11-12 at 12:10:23ID: 22943604

Port St. Lucie. Medco Health Solutions (Liberty Medical) Business Systems Analyst III. Programming 15 + years. Use to be a mainframe programmer until I took this position almost 6 years ago. Would very much like to become SQL Server 2005 BI certified. Very few Datawarehouse positions here tho. You?

 

by: HoggZillaPosted on 2008-11-12 at 12:16:05ID: 22943661

Marriott Vacation Club, Sr Manger, Finance and Accounting Development. Primarily SQL Server now, still some Oracle. VB.net, and whatever else.

Go Rays!!!

 

by: Laura2112Posted on 2008-11-12 at 12:18:05ID: 22943676

Still not seeing my variables or parameters to be sure that the dates are being fed to the proc spPartD_DrugCard.I set the breakpoint to OnPreExecute event. Suggestion?

 

by: HoggZillaPosted on 2008-11-12 at 12:23:53ID: 22943744

In your picture the precedence constraint prevented the execution of your next task with the break. As far as seeing the variable values, only the variables defined in the Variables Window are available in the locals window. So your "declared" variables in the SQL Task will not show up.

If you want to validate the variable values, use the Post Execute break

 

by: Laura2112Posted on 2008-11-12 at 12:23:57ID: 22943745

How long playing with SSIS?  Do you do much with SSAS?

 

by: Laura2112Posted on 2008-11-12 at 12:31:47ID: 22943826

Hmmm. I have no break points any longer. When I looked at he success, the next proc is validated.
But nothing is happening.

 

by: HoggZillaPosted on 2008-11-12 at 12:51:42ID: 22944036

Save the package with a .txt extension and post it here. Let me look.

 

by: Laura2112Posted on 2008-11-12 at 13:09:19ID: 22944220

Oh , *********, I think I lost it!! I do not see it in my Solution Explorer any more! Help! Can I convert this back to a dtsx file?

 

by: Laura2112Posted on 2008-11-12 at 13:18:43ID: 22944316

I'm cool, I do have it :)

 

by: HoggZillaPosted on 2008-11-12 at 13:36:08ID: 22944499

I have it as well. I will look at it tonight.

 

by: Laura2112Posted on 2008-11-12 at 14:25:56ID: 22945026

You're the BEST Expert ever! TY

 

by: HoggZillaPosted on 2008-11-12 at 14:28:22ID: 22945050

Those kinds of compliments will get you everywhere and anything! :-)

 

by: Laura2112Posted on 2008-11-12 at 14:30:01ID: 22945070

SSIS classes, please!  Do you tutor?

 

by: Laura2112Posted on 2008-11-13 at 09:18:00ID: 22951953

Hi'ya Hoggzilla!  Any luck with why the SQLTask isn't getting kicked off when my constraint = yes?

 

by: HoggZillaPosted on 2008-11-13 at 09:27:36ID: 22952064

Yes, you need to change your Evaluate Operatin to "Expression and Constraint". You currently have it set to Expression only and that means it evalutes before the Answer variable is populated.

 

by: HoggZillaPosted on 2008-11-13 at 09:29:14ID: 22952090

I think it is safe for you to close this question and open a new one. You can select the Precedence Constraint as the answer for this one and open a new question for more help which I will be more than happy to continue. Thanks!

 

by: Laura2112Posted on 2008-11-13 at 11:27:27ID: 31514112

HoggZilla was amazing in his patience and perseverence in assisting me with this. Thank you so much!!!

 

by: HoggZillaPosted on 2008-11-13 at 12:30:52ID: 22954171

Please let me know if I can assist. That did resolve your issue, correct? What's next?

 

by: Laura2112Posted on 2008-11-13 at 13:12:03ID: 22954617

Hi Hoggzilla, I have anotehr open question there now.  

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...