1,565 reputation
618
bio website
location Ukraine
age
visits member for 2 years, 5 months
seen 9 hours ago

Feb
12
comment Return value formatted similar to if casted as money
TIL: REPLICATE accepts negative lengths (returning NULL as a result).
Feb
11
comment create a batch script on windows that periodically starts a sql function
You may not need any batch file at all. In your Scheduler Task, you can just specify the command line tool you are going to invoke to run your script, with all the parameters necessary. There's no need to write a batch file for a single command like that.
Feb
11
comment create a batch script on windows that periodically starts a sql function
‘but I don't know how to write the script’ – batch file script or SQL script?
Feb
8
comment Does union all have an enforced ordering
If both parts of UNION ALL read the same table and your underlying concern is how to speed up the query, you could try the approach as in this SO answer (of mine). That may not work equally well for UNIONing sets retrieved from different tables.
Feb
7
comment SQL Calculated Field in both SELECT and GROUP BY clause
@11684: Um, that begs too many questions. Perhaps you could just explain what you have in mind? Using some example perhaps? Anyway, by simply aliasing an expression (if that's what you are talking about) you aren't really instructing the interpreter to keep the result for future use.
Feb
7
comment SQL Calculated Field in both SELECT and GROUP BY clause
@11684: It does, why?
Feb
7
comment SQL Calculated Field in both SELECT and GROUP BY clause
Unless you also know about CROSS APPLY.
Jan
31
awarded  Outspoken
Jan
22
comment UPDATE … FROM … syntax for iSeries for a MS SQL Server developer
In each case your statement is simply UPDATE ... SET ..., not UPDATE ... SET ... WHERE .... Therefore it will affect every row, as it has no filter. (You do have a WHERE clause there but it applies to the subquery. You can't filter the outer query's rows from within a correlated subquery. Well, if iSeries did allow that, that would be very extraordinary. And confusing.)
Jan
15
revised Select rows based on latest date with multiple joins
incorporated the query in question
Jan
15
suggested suggested edit on Select rows based on latest date with multiple joins
Jan
14
awarded  Civic Duty
Jan
7
comment joining two tables and counting joined rows
Your query seems to return the expected result for the data samples shown. Please show an example where the query doesn't work as expected.
Jan
3
comment databasename_indx.ndf file not referenced but can't delete
@MartinSmith: I think the issue is about whether the .ndf can be deleted/truncated/whatever without resorting to purging old data, i.e. whether it actually contains data or not.
Jan
3
revised SQL server agent job built on SSIS package not working
typos, orthography, product name corrections, formatting
Jan
3
suggested suggested edit on SQL server agent job built on SSIS package not working
Dec
23
revised Cast to date is sargable but is it a good idea?
removed a duplicate word, capitalised a name
Dec
23
suggested suggested edit on Cast to date is sargable but is it a good idea?
Dec
17
revised SQL Server: How to get the responsiveness of a trigger, without blocking the transaction that fires the trigger?
minor formatting & grammar, some punctuation & typos
Dec
17
reviewed Reviewed Cassandra - Query a column with collection type