Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transform task gives 'Invalid pointer' error

Status
Not open for further replies.

ton12

Programmer
Mar 9, 2005
58
GB
The script below writes to a file when all the
values of 'column2' = 'TEST'.

If it's true, no problem, the file is created otherwise
I get 'Invalid pointer' error :

---------------------------------------------------
IF (SELECT COUNT(*) FROM TABLEA where substring
(column2,1,4) = 'TEST')
=
(SELECT COUNT(*) FROM TABLEA )

BEGIN
SELECT * from TABLEA
END
--------------------------------------------------

Any suggestions?
Ton
 
Can you do this instead
IF EXISTS (SELECT * FROM TABLEA where rtrim(column2) not like 'TEST%')
BEGIN
SELECT * from TABLEA
END

if you have shorter data for example 'tes' the substring will fail and return an error, if you are using varchar data you don't even need substring you can use ='TEST' since space will be trimmed
also use 'value%' instead of substring it will perform faster

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Thanks for your suggestion but it is still
giving 'Invalid pointer' error message if no
rows is found.

In some cases, there will be no rows found and
this is fine but how should I tell DTS to see
it as normal.

Any feedback.

Thanks.
Ton.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top