Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Monday, March 19, 2012

DTS and SP issue

I have a DTS that export a CSV file, and the sql is a store procedure(SP).
The DTS work fine if the SP is a single select statement. However, if there
are insert statements within the SP, the DTS failed to execute. How can i
solve this problem?
If I change the SP to sql function, it works. Unfortunately, I have a update
statement to be execute so that i can't change SP to sql function.
Thanks in advance!
MartinHi
I amn not quire sure what you are trying to do, but here are a few things
you may want to try!
Remove temporary tables and use derived tables or functions.
Use a CASE statement instead of updating the table.
SET NOCOUNT ON at the start of the procedure.
Split the job into several steps to do the pre-processing first
John
"Atenza" wrote:

> I have a DTS that export a CSV file, and the sql is a store procedure(SP).
> The DTS work fine if the SP is a single select statement. However, if ther
e
> are insert statements within the SP, the DTS failed to execute. How can i
> solve this problem?
> If I change the SP to sql function, it works. Unfortunately, I have a upda
te
> statement to be execute so that i can't change SP to sql function.
> Thanks in advance!
> Martin
>
>|||oh, it works now! Thank you so so much!!!!! Thank you for your support!!!
Martin
"John Bell" <JohnBell@.discussions.microsoft.com> wrote in message
news:FA99D8E2-72F3-45C5-B40C-C3F2F648CD0E@.microsoft.com...
> Hi
> I amn not quire sure what you are trying to do, but here are a few things
> you may want to try!
> Remove temporary tables and use derived tables or functions.
> Use a CASE statement instead of updating the table.
> SET NOCOUNT ON at the start of the procedure.
> Split the job into several steps to do the pre-processing first
> John
> "Atenza" wrote:
>
procedure(SP).
there
i
update|||Hi
For the record, which option(s) made it work?
John|||SET NOCOUNT ON at the start of the procedure. Thx again!
Martin
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:1113546952.977706.271200@.l41g2000cwc.googlegroups.com...
> Hi
> For the record, which option(s) made it work?
> John
>

Friday, March 9, 2012

DTS + .net code

Hi,
My web application take data from excel sheet and store in the
database using dts. it is working fine when i run directly dts package
on sql server 2000 but i call sp ( exec master..xp_cmdshell 'dtsrun /S
/N /E ' ) from dot net code then it gives error
"A severe error occurred on the current command. The results, if any,
should be discarded "
*** Sent via Developersdex http://www.codecomments.com ***Have you tried running the command using Query Analyzer? If that works, try
adding 'no_output' to the statement executed by the application:
exec master..xp_cmdshell 'dtsrun /S /N MyPackage /E', no_output
Hope this helps.
Dan Guzman
SQL Server MVP
"Pooja Sharma" <pooja.sharma@.siliconbiztech.com> wrote in message
news:%23zgue0RSHHA.1364@.TK2MSFTNGP06.phx.gbl...
> Hi,
> My web application take data from excel sheet and store in the
> database using dts. it is working fine when i run directly dts package
> on sql server 2000 but i call sp ( exec master..xp_cmdshell 'dtsrun /S
> /N /E ' ) from dot net code then it gives error
> "A severe error occurred on the current command. The results, if any,
> should be discarded "
>
> *** Sent via Developersdex http://www.codecomments.com ***

Friday, February 17, 2012

dtabase design for storing true/false questions

Hai,

I am trying to design a database for storing trule/false questions.
I have no need to store any thing like chapters are topic. I want to just design a bare minimum tables for just storing questions and its responses.
So does the following tables and fields suffice to achieve that?.

Questions_table(id(autogenerated),course_id,Questi on(text type))
id field uniquely identify each question, course_id(ex:CRS235) is used to identify which course a particular question belongs to, and Question filed store actual question.

Response_table(id,response)
Response field is of int type, 1 for correct answer, 0 for wrong answer. I am not storing options for each question because every question has same options that is True/False.

So, will this work. Please advice and I would appreciate if any one can point me to a good resource on the web.

Thanks,yes. You might also want to add a NOT NULL constraint to the column|||I'd use smallint rather than int, for saving space and for efficiency.

I would not use bit, as you would have to convert to smallint every time you wanted to run an aggregate function.