dbTalk Databases Forums  

DTS "Invalid Pointer" error (using table vars?)

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS "Invalid Pointer" error (using table vars?) in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mike Austin
 
Posts: n/a

Default DTS "Invalid Pointer" error (using table vars?) - 08-23-2005 , 11:28 AM






I'm running two transformation tasks in my DTS package that are using table
variables. Basically, I am using two table variables to pre-filter my data
before the final query (which cuts the execution time by 2/3). This works
fine from Query Analyzer. However, when I put this code in a transformation
task, I receive an "Invalid pointer" error. No additional information is
provided.

Here is the code:

DECLARE @Types TABLE (
id smallint,
typecode smallint,
name varchar(300),
sequence smallint,
description text
)

INSERT INTO @Types (id, typecode, name, sequence, description)
SELECT t.id, t.typecode, t.name, t.sequence, t.description
FROM dbo.types t
WHERE t.typecode = 34

DECLARE @Questionaire TABLE (
id int,
questionaire_type_id int,
project_id int,
member_id int,
date_updated datetime
)

INSERT INTO @Questionaire (id, questionaire_type_id, project_id, member_id,
date_updated)
SELECT q.id, q.questionaire_type_id, q.project_id, q.member_id,
CAST(CONVERT(char(8), q.date_updated, 112) AS DateTime) AS date_updated
FROM dbo.questionaire q
WHERE q.questionaire_type_id = 1

SELECT p.id AS ProjectID, p.company_id AS CompanyID, p.project_lead_id AS
MemberID,
pbc.typecode_id AS SID, pbc.initial_estimate AS Rate,
q.date_updated AS CreationDate, q.id,
q.questionaire_type_id, t.name
FROM dbo.project_budget_costs pbc
INNER JOIN dbo.projects p ON (pbc.project_id = p.id)
INNER JOIN @Questionaire q ON (p.id = q.project_id AND p.project_lead_id =
q.member_id)
INNER JOIN @Types t ON (pbc.typecode = t.typecode)

TIA,

Mike

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.