« first day (2104 days earlier)      last day (2214 days later) » 

04:05
Morning Guys :)
 
2 hours later…
05:53
HI Everyone !!
Hey @shankar.parshimoni
06:24
Hi @Sankar, I have a query . Can you help on it ?
any idea how to delete records from table faster way ??
I have 150 Million data in one table ,Normal DELETE query is taking 1 hour time to delete Half million records
It's too time taking process
do you have any idea how to delete in faster way ?
morning guys
@shankar.parshimoni do you want to empty the table?
if you want to delete all, isn't it faster to just drop table and create it again?
and good morning :)
@Zulatin Good idea unless he don't wants to keep the identity column value
morning @ARr0w @Zulatin
06:49
@ARr0w ,Should keep table in DB.Want to delete only data which has
has?
@shankar.parshimoni He is asking whether you want to delete all records in the table or not
@shankar.parshimoni if you are looking to delete all, try

truncate table tblname
No,I dont want to delete entire data ,wanted to delete based on condition like older than 180 days
Ok, then How we decide a record is older than 180 days?
getdate()-180 days
06:58
can you post your table structure ?
@shankar.parshimoni Is that meant to be sarcastic? :D
lunch, brb
07:12
@shankar.parshimoni ,try
Delete from tablename where DateColumn < DATEADD(day, -180, GETDATE());
let me know if this doesn't work. It should though.
morning guys
morning
morning @Zulatin @Veljko89 @Sankar and the rest of the world.
:P
08:02
morning
Morning Andy
@Sankar sup man?
Replying mails... What about you?
@Sankar trying to get support from microsoft
damn lazy basta**ds
@AndyK ha ha ha... Indeed
08:14
@Sankar created a ticket thursday
still waiting
getting close to a week without resolution
you're trying to get something useful out of Microsoft? I expected you to know better than to think they'll provide something useful
@WhatsThePoint ah well ...
good morning
I know the soft
@Tomm o\
@Tomm yo yo yo
snoop dog in da houusssee
2
08:18
Morning @WhatsThePoint @Tomm o/
morning
what time is it in india? like 12ish?
1:50 PM
wait 1:50? I thought minutes where the same across the world
what??? is it looks different? @WhatsThePoint
it should be the same, I've also only heard of timezones.
Time here is 9:24 am
08:25
yeah it just turned 8:25am here
we are +05:30 than IST
@WhatsThePoint that makes no sense
For sure It being set as a Monday. And the key is also monday
I'm not sure he understands his own question tbh
08:45
lol
not sure how people have formed an answer when the question is completely unclear
i agree
i cant do that
people are that hungry for rep that they will just try and get a good answer
because at that stage you can only guess
or a good loking answer
@JasonKohlhoff thank You, but this example is a counter example of silent failure, which I would like to generate. Like the site's view example. Where everything is running fine, just the returned result is funky.
08:50
i am sure i do not know your question @ntohl but instead of * just ask your table cols then
@Tomm I'd like to make up an example just as clear as the site's "Using SELECT * in a view" example for stored procedures
how bad it is to use select *
well select * is bad cause if there will ever be made changes into a table that you did not count for
17 hours ago, by ntohl
  CREATE procedure dbo.complete_orders AS
  SELECT *
  FROM orders
  JOIN orderlines
    ON orderlines_order_id = order_id
  AND   order_date = '20100805'
	go


  ALTER TABLE orders
  ADD last_change_date datetime NULL

  exec dbo.complete_orders
your query might return errors or unwanted results
@ntohl theres nothing wrong with using select * if you handle it properly in your application. in your app if you reference column names rather than column indexes, and build your own tables of the data you want to display rather than just displaying the whole result set
08:53
I tried to make an example, but example above doesn't throw up
there is no application
what do you mean with application
I remember a senior showed me an example, when it throw up, but can't reproduce
only sql
@ntohl ask the senior perhaps?
I'm not in that company, and definitely don't want to talk to him again
well I don't see an issue with select * in plain sql
08:55
I cant think of select * being an issue only geting unwanted info being returned once you ever make a change in the table
Sam
Sam
o/
@Sam hi
@WhatsThePoint check out the site's "Using SELECT * in a view" example. If the table have a new column inserted into, than the result's columns might shift. There is a price value with a date's column index
that's why I said to not reference column indexes
in the example everything is select *
no column index
to clear up something>
17 hours ago, by ntohl
  CREATE view dbo.complete_orders AS
  SELECT *
  FROM orders
  JOIN orderlines
    ON orderlines_order_id = order_id
  AND   order_date = '20100805'
	go


  ALTER TABLE orders
  ADD last_change_date datetime NULL

  select * from dbo.complete_orders
that 3 statement works differently from the stored procedure counterpart
09:00
i do not understand your last sentece
some messages above there is the create procedure ... counterpart. That code doesn't show the shifted column indexing behaviour
create procedure ... counterpart. i swear what does this mean
8 mins ago, by ntohl
17 hours ago, by ntohl
  CREATE procedure dbo.complete_orders AS
  SELECT *
  FROM orders
  JOIN orderlines
    ON orderlines_order_id = order_id
  AND   order_date = '20100805'
	go


  ALTER TABLE orders
  ADD last_change_date datetime NULL

  exec dbo.complete_orders
^ that code
which is just like the create view, just uses stored procedure
m8 you can stop linking this
ok. How can I clear it up? I used the word counterpart, because both does the same, just one is creating a view, other SP
and their behaviour is different
09:03
okey so you have a view and a stored procedure we have that information now
what is different between those 2
and what are the suspected results
at the view result values are shifted right, and last_change_date doesn't appear
at the SP result everything is just fine
I wanted SP to do the same funky
again what are your suspected results and what is the difference between those 2
a picture without context wont make things easier
may i help?
09:05
ofc
yes @HéctorÁlvarez
that is no context to your picture
please check out the "Using SELECT * in a view" part. It's copied from that site
you have a problem, out of all respect if you want help can you make an mcve with all the problems you have and the data we can use
09:06
and second note, it's the result of my query
i dont want to do research for your problem i want to help you by you provinding me your info
try this:
SELECT *
FROM orders
JOIN orderlines
ON orderlines_order_id = order_id
WHERE order_date = '20100805'
@Tomm that question I linked earlier, I'm flagging as unclear what youre asking
one step ahead of u @WhatsThePoint
@HéctorÁlvarez where?
09:09
@HéctorÁlvarez thats not his question. he has a difference between his view and sp
in your quote, you made a similar statement within the SP
but you shouldn't really use ON for conditions
@Tomm yeah I'm looking into it
please provide a screenshot of both the view and the SP
I mean, the results they output when you select the resulting table
ive only had 1 disputed flag in 2018, and it was a spam flag which jon clements, couldn't decide if it was spam or not, so he didn't decline the flags
I'll make MCVE please wait. But that M is very long
2018 no disputeds yet
@ntohl Got a SQL question? Any SQL flavor here, just ask. Indicate your db, quick question: quick answer. *Long question, we will need an MCVE ---> *
I flag a llllooottt
09:13
i dont recently
my goal was marshal tbf
just no time
brb i have break
@Tomm close to be a Mathers
ooooh
im back :) spending my break on so
I'm counting my 2018 flags so far
Marshal Mathers
word game
xD
09:22
136 in 2018 so far
MSSQL
m8
that is not an mcve
please can you delete that and put it in a sqlfiddle or pastebin
or something
dont put it in chat
Morning all
morning @Shaneis
hey @Tomm
09:29
tho it wraps, and the results are unreadable
believe me or not, it's minimal for full understanding
@ntohl You can use this one : sqlfiddle.com
Request content too large (>8000)
Check this fiddle: sqlfiddle.com/#!18/c3bc5/1
did i make it correct?
yes. But the essence of the example is changing the schema I think
note that the last change date is 2.5
okey im looking at the fiddle
now the question
09:36
note that the last change date is null
yes i see its null
argh
it's changing
I wanted 2 different fiddles
just copy paste it into a new one
and save that
oh. It's not changing. It's ok. So there is sqlfiddle.com/#!18/3a39b/1 with the view results. 2.5 at last change date. And there is
sqlfiddle.com/#!18/b9e31/1 with the SP result. null at last change date
okey
so return_date is added into the sp not the view
thats why your data is shifting since the view is missing colun return_date
if you insert it will insert into the available cols
@ntohl and i have never worked with views but i think its alter view instead of alter table
@Shaneis is that correct?
I am not sure if what im saying is correct
09:46
Sorry wasn't on the page, let me read up
I'm adding column to the table. Not to the view
view is gone obsolate
sp_refreshview "dbo.complete_orders" refreshes the view
and the same result will be seen as the SP version
ight but the problem is that the table is not being altered
in the view
the sp is correct
I would like an example (which I remember I could do, because long ago a senior showed me), where the sp is also not correct. With a kind of obsoleteness problem, that the view have. Caused by a "select *"
why would you want that if i may ask
nothing is wrong in any of this except for your alter table not working
so at the company noone uses select *
09:51
sigh just tell them that if in the future changes are made you dont want slow queries returning unwanted cols
there is already codebase with select * in SPs. There is no way of changing those, unless You provide a malicios example, where in a future change the data is misbehaving
because, don't change whats working
and I would like to add "yet"
well instead of making something hard just make a fiddle with the table and a select * using a new column added to the table as varchar(max)
i am not sure*** dont trust me on what i am about to say
but i read about something that said varchar(max) can screw up results using select *
I have modified the script
ALTER TABLE dbo.orders
ADD return_date VARCHAR(MAX) NULL
but same results unfortunately
@ntohl there are reasons beyond laziness to use select *
adding a varcharmax without a value is not smart no
there is a reason you want max
09:58
e.g. a temporal table won't feature the system versioning dates when using the asterisk wildcard
so you can give a max value......
@HéctorÁlvarez yes. In the codebase there are dynamic SQL which creates SPs, and there are "select *" in it. Which columns are dynamic. So select * is "verified" to use there.
but I would change the dynamic SQL to expand the *.
if you select all the fields, it won't make much of a difference. The only problem with the wildcard is that it will run a table scan instead of index search.
and depending on your fill factor and fragmentation that could get REALLY slow
@HéctorÁlvarez no. It's not the only problem. The view example shows one of the problems also. there are the rest> gertjans.home.xs4all.nl/sql/…
@ntohl why dont you let your employees study that page you keep sending us
instead of trying to make your own reproduction
just use one that is done already
comes down to the same
10:12
@ntohl I think I'm not looking at the right fiddle. I have these and both output the same result, save the extra columns you added to one of them: sqlfiddle.com/#!18/b9e31/1 sqlfiddle.com/#!18/3a39b/1
am I looking at the right place?
@HéctorÁlvarez you are looking correct
they dont have the same output
view doesnt have the extra column
which shifts values to the left
I'm proven wrong. So why should they change? They use SPs not views
ALTER TABLE dbo.orders
ADD return_date VARCHAR(MAX) NOT NULL default '<10000 random characters>'
SP still prevails
haha well it won't work in sql fiddle
but you could do this in sql server
ALTER TABLE dbo.orders ADD SelectStarBreaker as (SELECT 1 / 0)
that'll stop 'em
brb coffee time
no idea why that happens
don't have time now to research it, please keep me up to date
10:39
10 persons are coming to my ethic design evening tonight
@AndyK Destroy them with knowledge @AndyK!!!
@Shaneis yeah... lolll
11:10
morning
hey @Ricky
@Ricky hey ricky
11:33
Hi all
I need a clarification regarding the location of mdf and ldf file
If I move mdf file and ldf file to any other location,is there any impact on the execution time of queires
well it only has impact if you move it to another country
it doesn't depend on the location of the file for sure
If you move it from Folder A to Folder B on local drive, won't make any dif
you might experience different access times if you move it to a different storage, e.g. SSD to 3000rpm HDD = notable slowdown.
but nothing to do with the file
@KesiyaAbraham as long as your database and application deployed on same machine (one hard drive or ssd) = fast
11:47
but someone told me that,it may affect the data retreival time
didn't you ask them "how?"
because that makes no sense
ie, if the files are in C drive, the retrieval will be much faster than taking it from D
@Sankar At that time,I am not much aware about moving mdf and ldf files.But now I got a scenario to move the files.I searched in the google about this.But didnt get any inf about the speed
@KesiyaAbraham hmmm.. I don't think its right.. Correct me if i'm wrong
ok..will ask him again and let you know
14 mins ago, by Héctor Álvarez
you might experience different access times if you move it to a different storage, e.g. SSD to 3000rpm HDD = notable slowdown.
12:00
@HéctorÁlvarez Sorry,I didnt notice this...
@HéctorÁlvarez it means there will be some execution time issues,if i move the files
but i am not planning to move to an SSD drive,I am planning to move to a different drive resides in the HDD
is it sql server or something else?
its sql server
12:17
i am learning c# and it makes me feel like a retard
@Tomm it took you long enough...
@ARr0w i cant even make a propper for loop....
just kidding by the way.. <3
xD
C# is easy, what's your issue
tell me lil' Tomm
12:20
lil' o Tomm
2
:P
k so i have a for loop and isntead of parsing 1 next line 2 next line 3
it just takes the last value of the for loop
IDK what you are trying to do
wait
il send the loop xD
I need some background
yeaj, put it on pastebin
nah its small enough for chat xD dont laugh
so we have to make a form where you input 2 values the variable and times to multiply
so its basically variable 10 and times to multiply 5
12:23
int z = 0;
for(int i=0; i<3; i++)
{
z = i;
}

first loop 0: z = 0
second loop 1: z = 1
third loop 2: z=2

output: z=2
int variable = Convert.ToInt32(textBox1.Text);
            int timestomultiply = Convert.ToInt32(textBox2.Text);

            for (int i = 1; i <= timestomultiply; i++)
            {
                label1.Text = i + " * " + variable + " = " + Convert.ToString(i * timestomultiply);
            }
int z = 0;
for(int i=0; i<3; i++)
{
z += z;
}
there you go
you were just doing z = 0 |z = 1| z = 2| Read z---> 2
yh il try this real quick
xD
you have to replace the second z
by whatever you want to add
12:25
label1.Text += i + " * " + variable + " = " + Convert.ToString(i * timestomultiply) + "<br />";
Hi all,one more issue,please help me
When I tried to delete the data in a table, it shows an error

The transaction log for database 'test' is full due to 'LOG_BACKUP'.

Also, I have checked the size of C drive, and it almost full now, before doing this delete operation, the free space was 10GB.

When I searched for the error, I found that backing up the transaction log will resolve the issue.I did the same and still, C drive remains full.
int z = 0;
int y = 13; // I will add this number X times;
int x = 3; // I will multiply Y times this number
for(int i=0; i<x; i++)
{
z += y;
}
that <br /> <-- will break the line
now refactor the crap out of those values and call them something that actually makes sense (except i, which is the universal nomenclature for iteration)
12:27
so the next output will be on new line.
br i know xD
thats same in php
@KesiyaAbraham backing up the log does cut the trail up to the point where the backup was made, so make sure you did it correctly
@Tomm if you muliply 5*10 you will get 10 messages with a result of 50
@Tomm try sending "abc" in your textBox1 :P
i got it to work
@ARr0w i know small basics now xD, im trying to learn some functions
like some loops etc
@HéctorÁlvarez Thanks Hector
12:31
@Tomm use 'foreach' for this same operation now
the " <br />" wont work though
let's see how you manage it with 'alternative option'
@Tomm aww then try --> /r /n <--
if that don't work too then i really have forgotten to do the next lines on webforms labels.
yeh i found /r /n i didnt know if it was bad practise though
c# is quite fun
but the syntaxes are much harder then php
\n \r , not /n /r.. ahh i editted it and its stamped now :(
you make me doubt, its been long now
:P
@Tomm
C# is english.
foreach(datatype nameofvariable in somearray)
i know its \r \n i was to lazy to click these \ instead of /
xD
13:07
sup guys
13:30
@AndyK nothin' just got done with a big project
did someone say c#?
@WhatsThePoint @Tomm 's learning c#
does he have a question?
c# you call War
13:52
do you guys know if I can do one tablix per item in a parameter list?
For example
I have a list with users, I can select 1|many|all
@HéctorÁlvarez are you ssrs-ing?
if I pick users 1,2,and 3, I want 3 tablixes with the same report, but one for each user
@AndyK Indeed I am
create a table in ssrs report using group?
ive worked on rdlc, if they are similar. grouping would work
@HéctorÁlvarez tricky
@ARr0w That will output a tablix with all 3 users grouped up by their own stuff
In the end there should be N queries, where N is the number of users, i.e. 3 queries for this case scenario
14:21
guys, do you know a way to do this, but as a column?
 select 1,2,3,4,5
@HéctorÁlvarez there is a way but I forgot somehow
I want to have this:
col1
1
2
3
4
5
I could UNION the results, but it looks UGLY AF
SELECT
       1
UNION
SELECT
       2
UNION
SELECT
       3
UNION
SELECT
       4
UNION
SELECT
       5;
Like that, but that sucks
@HéctorÁlvarez would it work ? stackoverflow.com/a/18026337/2572645
Nah, pivoting yields completely different results
@HéctorÁlvarez even like that?
14:36
WITH huh (what) AS (
    SELECT 1
    UNION ALL
    SELECT what+1
    FROM huh
    WHERE what < 5
)
SELECT huh.what
FROM huh
4
rofl
okay, now my example used integers, but I need strings
@Shaneis super smart
@Shaneis +1
mwahahahahahaahahahahahahahahahahahaha ( I've had 5 coffees )
4
I've had 5 coffees Yes I could understand :D
14:41
okay let's get factual, I have a list of tables I have to include in an SSRS report
@Shaneis that's my man! :D that's why we are best friends :P

https://chat.stackoverflow.com/transcript/message/41322962#41322962
I need to run the exact same query in all those tables
later folks
night.
see ya @ARr0w
14:42
@ARr0w bye bye
so my idea was a list with all those tables, select one, run query, select another one, run query...
Sounds like a case for dynamic sql cough or PowerShell cough
it has to be done in SSRS
but yeah this is BS I'll just make one report per table
@ARr0w cya
 
2 hours later…
16:18
Is it possible to filter by a multi-value parameter in the dataset query @SSRS?
e.g. I have a combo with IDs: 1,2,3,4,5... I select them all, and I want to filter in my query WHERE Id IN @ParametersFromCombo
I've done this previously using the Filter tab, but I've been told to do it in the query directly because it's faster
16:31
hey
It was a pain in the balls
16:47
@HéctorÁlvarez If your dataset is not calling a stored procedure, then it's very easy to do in the WHERE clause of the query. WHERE ColumnName IN (@ParameterName) ... SSRS will comma delimit the multi-value parameter in the SQL before it's executed.
I managed to get it working earlier ^^
It's just the UI sucks and gives the wrong suggestion
 
1 hour later…
17:56
god damn dates in SSRS
I hate them all

« first day (2104 days earlier)      last day (2214 days later) »