SQL 2000 dump declared value to file.

Get help on programming - C++, Java, Delphi, etc.
Post Reply
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

SQL 2000 dump declared value to file.

Post by SBSP »

I i have an SQL statment that is rounding a value some how.

I need to dump a declared value to a text file at the end of the statement.

So i can see what the result is.

the declaration is @INPUT_VALUE

how will i write (APPEND)
@INPUT_VALUE to file ?

Vice ?

Edit:

Man this is stupid all i want to see is @INPUT_VALUE value.

Can i not push that into an new table ?
viceroy
Registered User
Posts: 3565
Joined: 27 Mar 2006, 02:00
Location: I forget

Post by viceroy »

Not sure exactly what you want?

You could just print the value

PRINT @INPUT_VALUE

It will show on your query screen under messages.

Do you HAVE to have it outputed to file?

How are you outputing to file?
Image
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

Post by SBSP »

Thanks man.

No I just need to see the values.
It doesn't have to go to file.

Let me try


Edit.

Hi

No i dont think thats going to work.

I have a stored proc (Proc1) and with in that stored proc it executes another stored proc. (Proc2)

Stored proc gets run by using a local package.

I need to see the results of stored proc2
viceroy
Registered User
Posts: 3565
Joined: 27 Mar 2006, 02:00
Location: I forget

Post by viceroy »

Hmmm, okay,

Well I'd still say run the Proc 1 from Query Analyser and use the print command from within Proc 2

If the value is as expected while running from QA but different when run from a package, then there is an issue, possibly with conversions taking place?
Image
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

Post by SBSP »

Ok couldn't get that right.

Can i not pump it into a new database.

I have a backup database.

Called BAKDB with table Called HDDATA and Field HD031

How would i 'Insert Data' into the BAKDB ?

all i can find is

INSERT INTO table_name
VALUES (value1, value2,....)

Code: Select all

INSERT INTO BAKDB.HDDATA
VALUES (@INPUT_VALUE )
Will the above work ?
viceroy
Registered User
Posts: 3565
Joined: 27 Mar 2006, 02:00
Location: I forget

Post by viceroy »

insert into bakdb..hddata
(hd031)
select @input_value
Image
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

Post by SBSP »

Thanks I'm running it now.

It takes about 20mins to complete.
viceroy
Registered User
Posts: 3565
Joined: 27 Mar 2006, 02:00
Location: I forget

Post by viceroy »

cool.
Image
Post Reply