| |
| |
| |
|
Page: 1 2
Comments:
<0> if i have just added a register to a table is there any way so that the same sentence retrives the new ID of the thing i added? (FireBird 1.5, the id is given by a generator)... <1> ORDER BY (IF pCount == NULL) <-- Can anyone explain to me how I can do this in sql? <2> a[ka] <2> lol <2> didnt i give you the query already <1> well yes... you gave me one that worked <1> but someone told me that you can use ORDER BY expression <1> and I wanted to see how to do that <1> btw thanks for your help yesterday <2> whydidnt that same someone tell you how exactly to do it <2> hehe <1> hahah seriously <1> just said "use ORDER BY expression" and then was silent <3> asldkjasldkjasdlkjasd <4> exactly <5> morning all
<4> '' <6> In SQL2000, if you execute a remote-query using 4-part naming, do indexes get taken into account on remote tables? <6> Execution plan just says "remote query" and I can't tell if the remote server actually uses indexes or not <6> Unfortunately, remote-functions aren't supported or i'd use those to be sure. <7> Eol : performance on remote joins will always blow - indexes won <7> 't really matter <8> The remote server will take advantage of the indexes, tho. The performance loss is likely network related. <6> Well, that's the best I can do since my boss is terrified of replication ;) <6> Thanks for the info <9> I want to create some audit fields on my tables running SQL Server 2005 Express. I have 4 fields.. create_user/create_date and lastmod_user/lastmod_date. I'd like the fields to record default values for create user/date when the record is created, and the same for lastmod when it is altered <9> I believe the default values to use are GETDATE() and SYSTEM_USER (windows active directory), but I don't know how to distinguish them.. <9> if I use those two function/constants as default values, the values are only generated on create <10> use triggers <9> do you know a good transact-sql guide.. the msdn overview isn't much more then an index <8> When creating the tables you can specify a default value of one of those functions. As for the values updating when modified, triggers. <9> ok, I think I found the appropriate values <9> this means that I can't have my lastmod fields as not null <8> Well, you could if you give them the same defaults as the created fields. <9> right, I should do that.. <9> so I create an update trigger.. does it p*** the information relevent to the record that was updated? the primary key? <8> Triggers contain virtual tables called INSERTED and DELETED which contain the records that were affected. <8> The schema matches that of the table affected <9> so the scope of these virtual tables is only inside the trigger body? <8> yes <9> so if the schema matches the table affected and I have GETDATE and SYSTEM_USER for all 4 values.. the steps would be: 1) I update a record 2) trigger is executed, virtual tables created 3) I update the appropriate record with the lastmod fields of my virtual tables .. and then commit the changes? <5> Halo_Four:: go to "Monad breaking change announcement: Approved verb names enforcement" (http://blogs.msdn.com/monad/archive/2006/02/16/533522.aspx) and Please speak now or forever hold your peace J <8> UPDATE Table1 SET LastModifiedDate = GETDATE(), LastModifiedUser = SYSTEM_USER() FROM Table1 INNER JOIN INSERTED ON Table1.ID = INSERTED.ID; <9> thanks Halo_Four <8> d2d: Double underscores? What is this, GNU? <5> lol well people were complaining about it in the post... <5> well i think that's just absurd.. reminding me of C libraries <5> i should of mentioned about that too.. <5> btw, i am "dontbothermewithspam" :) <8> I don't mind the concept of standard verbs, tho. <5> well i thought they are well thought of too.. except for few cases <5> like that "format-table"... is it going to be replaced to something else? <5> it's like the usage of format-table and format-list has been so prevalent, i think a lot of people should be modifying their cmdlets to conform to the new verb scheme <5> i know that it's the LAST chance for the community to speak out about the approved verb name so i am trying hard to come up with what to sugguest and what not <9> thanks again Halo_Four.. worked beautifully.. now I can finally start this damn webapp <11> Hm, where can I learn SQL? <11> :-\ <4> from a book store <11> LOL, I mean, any sugestions on a good start. <5> stikupkid:: the very basics? on http://www.w3schools.com/sql/default.asp <11> What books? <11> I mean, I know how to do some queries etc.c <11> I am talking about building tables etc. <5> stikupkid:: i really liked SQL Server 2000 programming by Wrox press <4> book store <5> that is if you are using sql server <4> `sql for smarties` <11> Yea, MS SQL 2000 s what we have. <5> stikupkid:: then you won't be disappointed by that book <11> Great. <5> well i can't find the isbn #, hold on a sec <11> Ok <8> I like Guru's Guide to Transact SQL <8> I don't know if it's still in print, tho <5> http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764543792.html <5> Halo_Four:: i got my copy like last october <5> the one written by Ken Henderson right?
<8> Beats me, I don't actually own a copy. <5> lol well then pdf? :) <8> Nah, I have copies at work <5> i haven't been able to read the whole thing yet. so i am not sure if that book deals with creating tables... <8> I don't own many books personally. <5> i just read up to cursors... <5> oh ... wen i read the book, i liked it so much, i just went to a book store and got a copy <11> $60.00! <5> s/wen/when <11> lol <5> stikupkid:: i am telling ya, it's worth it and i got my copy for 39.99 like on amazon or on bookpool.com <11> What do you mean, when you read it you liked it so much you went and got a copy. Where did ya read it? <8> Programming books get expensive. <5> stikupkid:: friend of mine had a copy. <11> oh, lol. <5> yeah. programming books are expensive, but you keep'em forever as a reference for later <5> so that's what makes that SQL server 2000 programming book worth it. <5> it's about hmm 1500 pages thick but .. it's fun to read <11> Transact-SQL? WTF <5> what do you mean by "wtf" part? <11> What the F* is that <5> it's sql server's extended implementation of sql? <5> like oracle has something like hmm p- something something sql <11> Oh <6> PL/SQL <5> yeah... at least i got it right if i convert "somthing something" to "??" <11> Anyone know a good coldfusion book? <12> SQL Server 2000: Given 3 tables linked by 1-many relationships cascading, anyone know a procedure to help me "copy" the data within those same tables? For example with Northwinds (Company, Order, Orderdetails) I want to copy Company and all of it's Orders, for each Order, all Orderdetails. Can't think of a good way to do this without using some sort of temp table [logically speaking] to track all new IDs. <12> As new "IDs" are generated via Identity fields, I'd have to use temp tables to keep a match of the orginal ID, and the New ID. I suspect there's a better way. <13> Sabba do you homework elsewhere <12> Shrike: What's your problem? "Go do your homework elsewhere"? <12> WTF? <12> This database pays my bills and I'm looking for a way to save myself a couple hours of work. <12> Some people have some real ****in nerve! <14> waaaaaaa <15> Sabba, if it pays the bills.. how about you pony up some money to us for support? <4> discriminating against users who want help and asking them for money is not the answer <15> It is the answer if they are whiney kids who dont know how to do their job <15> If his "Northwinds" database pays the bills... well thats sad <4> let's not insult people jarr <4> Jarett_ <15> coJoNEs can you ban Darken, id really appreciate it :P <15> he's a hippy <4> i don't know what your problem is, and I don't care what you do in oracle, but that's now how it is done here <4> now=not <4> so again, do not insult people here <15> I dont see you helping anyone <16> hi. I'd like to create a stored procedure that will optionally receives a param that will alter the WHERE clause and return only a subset of the rows. I can provide a "1=1" expression to receive all the rows, but is there a nicer method? (for ignoring the entire WHERE clause altogether?) <17> with mssql server, how come when i restore database (backed up from the server, and restored onto the development machine), none of the database users have a sql login? However, when i go under sql logins, i see the same names as the database users, but they arent mapped together. and when you try to re-give the login access to the database, it says a user already exists in that database with the same name. <17> naturally, before restoring the newer database over the out of data development one, things worked perfect. they should however be identical in structure, just more data. <18> typical mssql server restore <17> this is the root of my server restor issues as well. if the server ever crashes and we have to reinstall mssql server, having the database isnt enough, becuase you would have to delete all of the database users, create the sql logins (with the same names), which would create the database users when access is given to that database, and then restore all the permissions. what the hell is the point of the restore then if all that work has to go int <17> i am so fricken fed up with the restoration process. always seems easy, but never works <19> yeah <19> i don't use many different users in my db's so when i restore i just manually remap them <19> pain in the *** <19> i'm sure there's a right way to do it but i forget how <19> you could script your security <19> and replay it when you restore <17> this is so retarded <17> should server logins never have the same name as your database users? <12> Jarett_: You're as intelligent as you are tactful. I didn't say I made money off of Northwinds. I was using the tables in it as an example, as does MS because everyone has access to that DB. Get over yourself. <15> Sabba, you do realize you are inches from being banned, right? <15> keep it up <12> Jarett_: You say that like a) It's some kind of big threat and b) Like you could enforce it. Like I said, get over yourself. <12> Are your reference to me being a "kid" is ironic in light of how you're acting isn't it? <12> Are = and <15> Your northwinds is calling. <15> Maybe #mssql can be more helpful with your homework <12> I'm asking there too genius :) <12> I don't think my question is MSSQL specific though. <15> Yep, im sure those wizards are big bunch of help <15> Good luck to you <12> I'll give you this, I haven't seen any help there, but I haven't received any attitude either so this channel isn't looking a whole lot more helpful at the moment (though it has been in the past, and people have been respectful too).
Return to
#sql or Go to some related
logs:
#red service-error-service-unavailable #directx #hardware #unix #politics #asp #red #hardware samba client pma
|
|