February 9, 2012 at 9:50 am
if the temporary table is in dynamic sql?
____________________________________________________________________________
Rafo*
February 9, 2012 at 9:55 am
xRafo (2/9/2012)
if the temporary table is in dynamic sql?
So what? You can use temp # tables in dynamic sql.
What is you point?
February 9, 2012 at 12:20 pm
A) Dynamic SQL should be used sparingly and with a specific intent to optimization, otherwise: kill it with fire. Even then, # tmps work just as well in dynamic as table variables. Table Variables are primarily good for two things: Table Parameters and Functions. Neither of those are safe to use on large systems if you don't know how badly table variables affect estimated execution plans.
B) Best solution to this is usually an SSIS package, because you redirect error rows to another 'error table' that's more generic and you can review the result set. It also splits off the stream without having to do any heavy lifting in code or table manipulation. It also avoids you having to type check every little thing about every single column. Any error, off to the dump table!
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
February 13, 2012 at 11:24 pm
xRafo (2/9/2012)
Hmm, can u prove it?, i mean,do you have an example and probe it what you say?
It's a well known fact. Google it. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
February 13, 2012 at 11:27 pm
Actually, this is all very easy using BULK INSERT which now allows you to do like we used to do in BCP. Sequester errors in a file and keep on truckin'! Just set the max number of errors to some ridiculously high number and any data that doesn't "fit" the target table will go to the error file you identify. NO special handling required. 😉 And, look Ma! No SSIS validation required. :w00t:
--Jeff Moden
Change is inevitable... Change for the better is not.
February 16, 2012 at 12:34 pm
Jeff Moden (2/13/2012)
Actually, this is all very easy using BULK INSERT which now allows you to do like we used to do in BCP. Sequester errors in a file and keep on truckin'! Just set the max number of errors to some ridiculously high number and any data that doesn't "fit" the target table will go to the error file you identify. NO special handling required. 😉 And, look Ma! No SSIS validation required. :w00t:
LOL, nice Jeff. I'll have to check that out. How does BCP/Bulk Insert inform you when a process includes items to an error file? Difficult to detect/report on to a DBA from an automated job?
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
February 16, 2012 at 1:46 pm
Evil Kraig F (2/16/2012)
Jeff Moden (2/13/2012)
Actually, this is all very easy using BULK INSERT which now allows you to do like we used to do in BCP. Sequester errors in a file and keep on truckin'! Just set the max number of errors to some ridiculously high number and any data that doesn't "fit" the target table will go to the error file you identify. NO special handling required. 😉 And, look Ma! No SSIS validation required. :w00t:LOL, nice Jeff. I'll have to check that out. How does BCP/Bulk Insert inform you when a process includes items to an error file? Difficult to detect/report on to a DBA from an automated job?
It's like any other validation procedure. If the codes checks the error file at the end of the run and it's not empty, then you have errors. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
February 16, 2012 at 1:56 pm
Ram...total sidebar
but I do think we ought to combine our avatars 😀
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Viewing 8 posts - 16 through 22 (of 22 total)
You must be logged in to reply to this topic. Login to reply