« first day (1867 days earlier)      last day (2451 days later) » 
05:00 - 19:0019:00 - 00:00

user7912927
5:19 AM
gm guys :)
 
6:28 AM
good morning
 
6:45 AM
morning @AdiMohan
 
6:56 AM
@Mofty what's up? how's your day going so far?
 
not so good so far... got 3 oracle DBs and if i do this on sqldeveloper
SELECT * FROM NLS_SESSION_PARAMETERS;
than i get NLS_LANGUAGE = GERMAN
but if i do the same via console it is AMERICAN
okay i got the mistake i did there... was connected on the Server and this ist setting the parameter to english
thanks @AdiMohan
so how about you
 
7:16 AM
morning
 
kinda the same, trying to get a result in sql server and not getting it
@AndyK good morning
 
morning @Adi
 
7:27 AM
Good morning everyone
@Andy o/
 
hey @Sami o/
 
Sup?
 
very busy
 
Oh ok mate
 
no worries Sam. This is part of the deal
 
7:33 AM
:)
 
I wish I was more involved in the chat room
but for now, it is a tough sell
 
Yeah , I know sometimes it's verry hard to have a time for friends
 
7:55 AM
guys, the SQL command " partition by should also work as a distinct kinda' thing, right?
 
mornin' @Sami
 
@Mofty Morning
 
8:15 AM
hi @Mofty
 
Hi @AndyK
how is everyone doing?
 
busy as hell
feels like a trader
 
well that's how it is in our business right?
 
I wish it was easier
but well
 
Morning guys
 
8:24 AM
hi @Shaneis
 
hey @Mofty
@War you're blog has an error again :)
 
hi @Shaneis
 
hey @AndyK
 
War
@Shaneis dammit ... fucking router
 
how's things?
@War :D
 
8:27 AM
@War excellent :D
busy as hell
waiting for holidays
 
War
gimme a minute to bitch slap my LAN
 
@War ah yes, the universal fixing technique
@AndyK when 's that?
 
not even sure
I forgot actually
20th of July to 28th and then the second week of August
 
War
@Shaneis for some reason EF thinks the DB is not in the right state
I haven't made a code change in about 2 months
so I have no idea WTF it's going on about
 
@War You don't respect the DB, the DB don't respect you @War
 
War
8:37 AM
respect ... me and SQL are going to fall out pretty soon
this bullshit wont be tolerated
 
@War have you tried EF? I've heard good things about that :P
 
War
oh really ... I will have to give it a look!
 
@War haha
 
War
and BAM!! just like that
reboot the SQL server and it works
I knew it was fkcin SQL
Oh this EF thing looks good ... I bet you could do some great stuff with LINQ in that
wow you can even put OData on top of it ... let me try that!!!
wow that was fast ... blog.ccoder.co.uk
might have my servers auto reboot once a week or something
this issue seems to come back about once every 10 days
 
As a DBA, I object to your use of rebooting SQL Server to fix the problem :(
As a reader of your blog, I'm happy it's fixed :)
 
War
8:44 AM
As a dba I'm tempted to ask if you want to make a deal
My SQL box does not like me and I feel its because I treat it with contempt
I need a dba that will sweet talk it in to working
 
@War when will you an rss feed on your db?
 
@War I'd be scared to man, I'd be going "what is all this linq crap doing here? ODATA? More like OhNoData!"
that being said, ever want me to take a quick look, I'm here
 
War
haha, not on my DB server @Shaneis ... only SQL lives there ... any DBA on that box would not even know I had any code at all except whats in the db's
@AndyK yes I need to sort that out :( sorry man ... been so crazy stupid busy lately ... is your pref rss format or atom?
I recall they are very specific in structure
 
@War rss is better. I'm using Feedly mainly
@War no worries, we're all busy as hell
 
War
i'll try and pick that soon
I think OData has a formatter built in for atom but i've never seen it working so I may just have to build my own
half tempted to just build the response stream myself and ignore OData for this
the request has to follow a very strict formatting convention for feeds
that said ... it shouldn't be too bad to do
oh wow
all that and all i need is a method that maps from my page collection object to an rssitem collection then I can do ...
var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(xml, Encoding.UTF8, "application/atom+xml") };
return response;
that's a grand total of about 3 lines of code
I'll see if I can get the time to hack that in later today
I already have automapper in the stack so I think I can setup a linq query that returns data in rss format straight out the db
makes the controller code even simpler ...
return Ok(Service.GetFeed(blogRef));
how cool is that
 
user7912927
9:55 AM
@War i dropped that xD
 
user7912927
but if we do that in right way..it will be achieved..but it really takes more time and patience...
 
user7912927
well,time is there but patience ..it wont pass near me
 
user7912927
24
Q: How to restore a SQL Server 2012 database to SQL Server 2008 R2?

user2742047I am trying to restore the backup taken from a SQL Server 2012 to SQL Server 2008 R2, and it giving an error Specified cast is not valid. (SqlManagerUI) If you have any solution to this please give comment thanks.

 
user7912927
@Shaneis @War i found this...the first method didnt worked for me..as the the job got failed on the second server. For the second method, u need this thing : sqlazuremw.codeplex.com
 
huh, so MS have a tool for it now, good to know.
thanks @Nias
 
user7912927
10:04 AM
yeah.. :)
 
War
10:32 AM
fair enough
 
@Shaneis @War Hi!
 
dhS
11:15 AM
Hi
How to extract the month from the timestamp column in postgresql
I have searched on google but not got the exact month from the date
 
user7912927
39
Q: How to extract year and month from date in PostgreSQL?

BdfyI want to select sql: SELECT "year-month" from table group by "year-month" AND order by date, where year-month - format for date "1978-01","1923-12". select to_char of couse work, but not "right" order .

 
dhS
SELECT date_part('month',date1) from res
this query is giving in number
But i want in the name of the month
@Nias the query is giving the number,
the result wants the name of the month or the short form
 
user7912927
SELECT to_char(to_timestamp (4::text, 'MM'), 'TMmon')
 
hi. i am new in sql server. can anybody tell be, can I delete primary key which is foreign key of other table. if i do so what will happen
 
user7912927
you cant delete it unless you remove the foreign key relation to it
 
11:26 AM
how to do so
 
user7912927
alter table tablename drop constraint tablename_Columnname_FK
 
user7912927
@Bha15
 
user7912927
@dhS u got it right?
 
is it nessesry to use constraint
 
user7912927
Foreign keys aren't required to have a working relational database , but they are definitely essential to avoid broken relationships and orphan rows
 
11:32 AM
thank u.. same I need to do with primary key.?same query ?
 
dhS
@Nias I am trying
 
War
@Sami hi
 
user7912927
@Bha15 replace 'FK' with 'PK'
 
dhS
@Nias
SELECT to_char(to_timestamp ((date_part('mm',date1))::text, 'MM'), 'TMmon') from res
this is the query i make
what u suggested
Could you please make it small?
 
11:49 AM
thanks @nias
 
dhS
How do I extract months between two dates.
 
Hi all
@dhS, do you mean the number of months?
 
dhS
No the months names
 
hey guys, do i have a "Like" equivalent in sql server syntax?
 
Which db?
 
dhS
12:01 PM
postgresql
 
@AdiMohan Yes, it's called like
SELECT * FROM Table WHERE column like '%something%'
 
oh, yeah. typo in my syntax
ok cool xD silly question sorry
 
@dhS This should get you started: stackoverflow.com/a/17833299/177416
 
dhS
@Alex this is the count of the month
the result is to find the months name between two dates
 
Sorry
 
dhS
12:08 PM
@Alex It is ok no need for sorry
:)
 
Hi @Alex
 
Hey Andy
@dhS Here's code to do that on Oracle; might be portable to postgres: dba-oracle.com/t_sql_display_all_months_between_two_dates.htm
 
dhS
@Alex Yes it should work
thanks
 
You're welcome
 
user7912927
@dhS SELECT to_char(to_timestamp ((date_part('mm',date1))::text, 'MM'), 'TMmon') from res this doesnt give month names?
 
user7912927
12:23 PM
wait
 
dhS
yes
this is the diferent query
actually i need the 2
queries
thanks alot
 
user7912927
she wants to simplify this query "SELECT to_char(to_timestamp ((date_part('mm',date1))::text, 'MM'), 'TMmon')" to a format like "SELECT to_char(to_timestamp (4::text, 'MM'), 'TMmon') @Alex
 
Thanks, Nias
 
 
3 hours later…
3:18 PM
@Shaneis Hey , what's wrong with DELETE Exists?
delete from del1 where exists(select * from del1 d1 join del2 d2 on d1.id = d2.id);
del1 : id pk
del2: id pk
del1
 
1 , 2 , 3 , 4 , 5
 
del2
 
1,2,3
it should delete just 1,2,3 . but the table del 1 is empty
 
you're deleting everything from del1 if you're exists returns any rows
you're not limiting it at all
you need to remove the del1 in your exists
declare @t1 table (id1 int);
declare @t2 table (id2 int);

insert into @t1 values (1),(2),(3),(4),(5);
insert into @t2 values (1),(2),(3);

delete from @t1 where exists (select * from  @t2 where id2 = id1 ) ;

select * from @t1;
that will return 4 and 5
 
ok , but when it like:
delete from @t1 where exists (select * from @t2 ) ;
it should return 4 and 5 too
bc @t2 have just 1,2,3
 
3:29 PM
nope, you're saying DELETE FROM TABLE1 if my exists (returns anything at all)
because you're not specifying any link back to the first table
 
select * from @t2 return 1,2,3
and @t1 have : 1,2,3,4,5
 
yeah but exists techinally returns a TRUE or FALSE
so you're saying delete if TRUE
not delete if table1 = table2
 
aaaaah , ok , TRUe @Shaneis ;)
 
np @Sami
 
THNX
 
3:31 PM
best o'luck
 
How about a INNER JOIN @Shaneis ?
 
inner join would work as well, might be easier to read too
 
DELETE FROM @T1 WHERE EXISTS (SELECT * FROM @T1 T1 INNER JOIN @T2 T2 ON T1.ID1 = T2.ID2);
 
nope, cause your EXISTS is back to a TRUE for everything again, i.e. there's no link back to the DELETE FROM @T1
 
I think in this case, you can leave out the INNER... it is an INNER/NATURAL join by default
 
3:35 PM
I thought you meant
DELETE @t1 FROM @t1 join @t2 on t1.id1 = t2.id2
 
I can use IN clause but I want to use EXISTS
 
then you just need to link back to the DELETE FROM table
 
So , if I have 3 tables (tbl1 , tbl2 , tbl3)
 
and you want to use exists?
 
DELETE tbl1 FROM tbl2 t2 INNER JOIN t3 tbl3 ON t2.id = t3.id;
 
3:40 PM
oh, very close!
DELETE tb1 FROM tbl1 join tbl2 t2 on t1.id1 = t2.id2 INNER JOIN t3 tbl3 ON t2.id = t3.id;
 
So I must join them all not just two tables?
 
if you're using the join syntax then yep
 
Hahahaha , I think IN clause is better & easy
 
whatever works for you ;) @Sami
 
With coalesce too
for the IDs
 
3:44 PM
say what?
 
What about performance?
which one is faster?
 
between IN and COALESCE?
 
No , IN and Exists
 
oh, EXISTS normally
 
dam
 
3:46 PM
check out the query plan deep dives sample here for why
 
@Shaneis Thnx for the link , I think when you want to delete with Exists claus
you should always join the table who want to delete from
 
yeah it's still faster I'm afraid :(
 
Or just truncate all the tables and start fresh :)
 
all I can say is using that way, make sure whatever is outside your exists links up to what's inside your exists
 
I'm right?
 
3:52 PM
100%
 
99.999999%
;)
 
@Alex sheet
:p
 
5 9's @Alex, 5 9's with databases!
 
But we'll round it up to 100%
 
99.999%
 
3:53 PM
Ah, nicer
 
@Alex What I ask you yesterday?
 
Can't help it. My chemistry class had calculations down to 7 or 8 places
 
Hmmm , that was on 6 months ago I think
So , I can't create one since today
I talk to "John" about it
but he do nothing
 
What was the question? You must've hit me up when I'd gone home
 
I don't have access to the second one
Can't create a room
 
3:56 PM
Creating chat rooms?
 
Yep
 
How many rep points do you have?
 
1497
It's not about rep
 
Dang! You should be able to create chat rooms
Awarded At: 100 Reputation -- stackoverflow.com/help/privileges/chat-rooms
 
I get banned for 1 month (When I was new user here) , from that day to this day I can't create a chat room.
It's about the ban in the system
 
3:59 PM
Oh. When did ban begin?
 
I think " 8/08/2016"
 
Can't be. We're well into 2017
 
Well the ban end on "11/11/2016"
so it's not in 08/08
 
Okay. So that date is in the past
 
I don't remember it exaclty , but it's a long time
 
4:02 PM
You might want to go to the meta SO area and see if you can ask for the ban to be lifted
 
yeah , even I try to talk to a mod about it his name is "john"
 
Oh
Be patient. Nothing happens by accident. There's a wisdom in all things, even those that are against our wishes
 
Yeah it's about a user who insult me and keep annoy me
but he flag me bc I don't even know how to deal with it (was new user in this time)
 
It's okay. Happens to the best of us
Key is to keep going
 
but from that accident I learn how to deal with those trolls
 
4:04 PM
Yup. ^ that's what we gain from these things
We learn
 
Well , I don't need to new room cause I have SQL room and you guys , but it is annoying that's all :)
 
Know what you mean
Give it time and it will come to you
Now you have the skill to deal with trolls on here
 
Yep
The best choice is : Ignore button :)
you will find it when you click on the avatar of any user
 
Didn't know that existed
 
Yeah , you can give it a try , then you can't see or ping that user (and the same for him)
 
4:09 PM
Nice!
 
Enjoy :)
 
Thanks
 
np
we are friends
 
heading off guys, talk to ya
@Sami, that's the spirit (Y)
tty tomorrow
 
See ya, Shaneis
 
 
2 hours later…
5:49 PM
@Shaneis cya
 
6:32 PM
@Sami I am a student, yes
 
That's good
 
6:53 PM
@CrashBandicoot I'm a student too :)
0
A: Grant access to all Windows users in SQL Server

SamiFollow this steps: Firest create login if you don't have it: CREATE LOGIN [<domainName>\<loginName>] FROM WINDOWS; Create the user in the database for the login: USE Your_Database CREATE USER UserName FOR LOGIN LoginName; Then for example assign it to db_datareader to read all tables or...

 
Nice
What are you studying?
 
05:00 - 19:0019:00 - 00:00

« first day (1867 days earlier)      last day (2451 days later) »