@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10



Comments:

<0> HERPES FOR EVERYONE!
<1> it's nice here now
<2> well, my mom is dead, getting herpes from her would be difficult as she was cremated
<2> ...but hey, everyone has thier fantasies, right?
<3> I'm using Sybase ASE 12.5, although I think MS SQL Server solutions should work for this, too. I want to get the total space allocated and total space used over all database devices (log and data)
<1> MSSQL will tell you that
<1> i don't know how to do it in sybase, tho
<1> after lunch i'm going to a session on indexing by kimberly tripp
<1> man she's gotten fat since 2004
<1> ha
<4> Is there a way to surpress a DTS package error? From some .Net code I run a several stored procedures that in turn executes a DTS package. One of those DTS packages sometimes generates a harmless error, but the error results in a .Net Exception which I don't want to.
<3> TZJungly, yes, but I want that in SQL because we have 8 DBMS servers and hundreds of database devices. looking in the GUI and adding it all up would take forever. SQL would be faster :)
<2> heh snig, welcome to MS error hell
<2> why is a sproc calling a DTS, shouldn't that be the other way around?
<4> guest2, not me who makes the SQL code in this project, so I don't know why it's done like that...
<5> BobRoss1, you can try sp_spaceused



<2> snig, well thats a tough corner he's painted ya into
<4> I know :o). If it cannot be surpressed, I guess I need to deal with the Exception in the .Net code. But I hoped there would be a better solution...
<2> I'll bet it's because the DTS was converted to vb script and the vb script is throwing the error to a confirm dialog which never gets clicked
<2> I will never use vb for automation scripts just because of that
<4> Nah, it has to do with a DTS package that get's executed when it's already running. And I'm told to just ignore it in the .Net code. But it would be better to surpress it directly in the DTS package.
<2> well if the error isn't stopping execution then whats the problem?
<4> The problem is that when an error is thrown, the .Net code should treat it as an error (logging it etc.) Of course, some single errors could be ignored, but it is bad code to ignore it in the .Net code when the problem should be fixed in the DTS/SP itself, as this is where the problem originates. It would otherwise confuse new developers in the future.
<1> what is the error and why is it generated?
<6> guest2: ive had occations when i do want to run DTS
<6> like i have an agent run a stored proc that does several things and then calls a DTS pacakge and uses results from that package to do other things to the data
<6> its not the best practice but its got its uses
<6> snig: can you change the stored proc?
<2> is there a DTSrun command? or are you just making a vb script and sp_shellexec?
<4> "SQLServerAgent Error: Request to run job Run SomeJob (from User SomeUser) refused because the job is already running from a request by User SomeUser." The error occurs when the job is executed before it's previous execution has ended. And the DB programmer told me there's no way to check in advance if the DTS package is running or not.
<4> SicLuDe: Sure!
<7> any1 what the maximum length of an INSERRT statement in microsoft SQL 2000? So far I have reach about 100K and it's still fine
<2> 100K in one row?
<2> wow
<7> the sql statement is 100K
<2> oh, that shouldn't be a problem
<7> it's inserting thousands of record in one long statement
<4> guest2, it's executed using the exec() command
<2> it is pretty big
<2> snig, thats what I thought
<7> I concern that there is a limit..
<7> I can't find the limit any where..
<6> guest2: DTSrun
<2> so the DTS is already running and subsequent requests to execute it are erroring out
<7> Maximum Capacity Specifications documentation in SQL doesn't said
<6> snig: yes there is a way to check if its running already
<4> guest2: exactly
<2> does each request need to run the DTS to return what is needed?
<4> SicLuDe: I'd be happy to know how :o)
<2> or is it some sort of clean up operation?
<6> i dont have a mssql db access right now
<6> but there are system tables you can look at
<4> guest2 It's performing a search, but I'm quite sure that it doesn't return anything, so it would function like it should by not starting up twice.
<3> jadeboywk, why not use BCP to load in the data
<6> theres a database (not master) that starts with an m
<6> like MSxx
<6> but theres tables in there that you can look at
<6> to find the status of the DTS jobs
<2> you could look at the 'command' field of sp_who2 (?)
<6> basically just think about it this way... anything that you can do in EM, you can do yourself in a query
<6> guest2: dont know if DTS packages will show up in there
<2> snig, if thats the case then the error can be ignored
<6> snig: basically do this: open up EM and go to wehrever you would normally go to to see the status of the DTS job, and run tracer on it
<6> just trace what EM is calling
<6> and you will be calling the same thing
<4> I will try that. Back in a few minutes...
<2> I'm not getting why ignoring the error is a problem
<2> it doesn't effect execution, the DTS isn't needed to be run if already running
<2> whats the problem?
<4> guest2, maybe I missed your point. How would I just ignore it? I mean, how do I prevent it from throwing an exception into the .Net code?
<2> try/catch?
<2> so the error IS stopping execution?
<2> you said it wasn't
<4> well, I might have written something unclear. It doesn't stop the execution in the stored procedures etc. but it throws a .Net exception that "stops execution" in the .Net code. And you are correct that I can solve it using a try block, but that is basically what I want to avoid to start with, because this database error should be handed by database code (as the .Net developers shouldn't need to ignore some db errors and not others).
<4> But if I can't find a better way to solve it, I'll do it using a try block. But only if there's no better solution for it...
<8> how large can a transaction be (for postgres in particular)? I'd like to do a whole lot of inserts (a library, so no idea what amounts of data people will be trying to stuff in; could be a lot if it's for performance testing), using deferred constraints and a transaction to get around dropping and recreating foreign keys. bad idea?
<6> snig: what erorr code are u getting?



<4> Server: Msg 22022, Level 16, State 1, Line 0
<6> check on the DTS if you can hide errors
<2> if your using DTSrun it should have something in one for the system tables I would think
<4> ok. I'll also monitor how the EM does it. brb...
<2> for/of
<2> eevar, just default the foreign keys... I have no idea what postgres can handle
<2> "not much" comes to mind
<8> ment foreign key constraints, obviously. so i should drop and recreate instead of defer?
<9> i have a table with 3 columns: a pk, quantity, and a date. how can i select exact pk's, ordered by date descending, in which the sum of the quantities first crosses a threshold of x (>= x?)
<9> (ms sql server, but basically a general sql question)
<10> sure it isn't mysql?
<9> yep
<10> how can x be greater than itself?
<9> i meant x>=y
<9> sorry
<10> what is x and what is y
<9> eh, i've poorly worded, i'm sorry.
<9> crosses a threshold of x
<9> as in, >= x, i was right the first time
<9> e.g. 30
<9> some variable i plug in to check when the sum of the quantities up to that point has reached this threshold
<10> how do you sum the quantities
<10> based on what condition
<10> the primary keys are unique correct?
<9> ordering by date descending
<9> yeah
<9> maybe i could do it with count(*) somehow?
<9> select count(*) from mytable where sum(qty) >= x
<9> with the order by
<2> select distinct pk,date,count(*) group by pk,date having count(*) > 30
<2> order by date DESC
<2> this sounds like homework to me
<9> haha. its not
<9> i'm trying to write an inventory prioriziation algorithm
<9> but its slow as hell when i do the above procedurally
<2> oh sorry I didn't see quantity
<10> hansbrix
<10> please answer the question
<10> [14:11] <10> how do you sum the quantities
<10> [14:11] <10> based on what condition
<10> ordering a date is only vanity
<10> that doesn't discuss the grouping conditions
<10> for summing
<9> i dont sum the quantities
<10> also don't listen to guest2
<9> er, i do, i dont know, i'm a bit muddled here, to be honest
<10> heh
<10> your primary keys are unique, correct?
<2> darken is a bit of an SQL newb himself that likes to act like some sort of gawd...so, well, you'd better listen to him or he'll get pissed
<9> i sum them all
<9> not by key
<6> whats a primary key?
<9> yeah the keys are unique
<10> hansbrix you want a table sum?
<9> i thought pk meant unique
<9> i want a conditional sum
<10> hansbrix you have PK = AB1, AB2, AB3
<9> more importantly, the rows involved
<10> how do you know you want AB2 only?
<2> table has pk(unique),date,quantity, right?
<9> when it crosses the threshold x
<10> define 'when it crosses the threshold x'
<9> that's why i'm here
<9> hehe
<2> what crosses the threshold? quantity?
<9> yeah
<10> if you don't know how to define it
<9> sum of quantity
<10> we can't tell you that
<10> sum of quantity of what
<9> see you iterate through the rows
<2> suming on what?
<9> and sum them
<9> this is how i do it now


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #sql
or
Go to some related logs:

#flash
#linuxhelp
#computers
#beginner
tailoring blue jeans so not to lose trading
#redhat
#gentoo
#politics
#microsoft
#unixhelp



Home  |  disclaimer  |  contact  |  submit quotes