Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 23rd, 2003, 04:28 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting a DTS Global Variable

Scenario, I am exporting a number of text files via a DTS package. What I want to do after the export of the text files has completed, is to then is to update a log table with the exported rows via an execute SQL Task e.g.

INSERT INTO tblLog (TF1, TF2, TF3)
VALUES (@tf1, @tf2, @tf3)

e.g.
Date Run, File1, File2, File3
2003-10-23, 1343, 3254, 8734
…

So I have created three global variable that I want to assign the @@rowcount as each text file exports

This is where I am stuck. I have declared three global variables @TF1 …. And I am trying to do the following, after the text file has exported

SET @tf1 = @@rowcount –error here is that it is saying must declare variable @tf1

Can you not assign a value to a GV once it has been set??


Bonus points if someone can give me an answer before Jeff

Thanks







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to declare the global variable in global.asax? calyn_gately ASP.NET 3.5 Basics 0 August 6th, 2008 08:06 PM
comapring global variable value to local variable amhicraig XSLT 6 December 5th, 2007 12:16 PM
DTS package Global Var's frank.svs SQL Server DTS 0 July 16th, 2007 06:18 AM
Setting Global Parameters in the SimpleAxisServer nigel.sim J2EE 0 October 8th, 2005 06:46 PM
Setting NLS_TIMESTAMP_FORMAT global parameter pankaj_daga Oracle 0 May 24th, 2004 07:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.