1,685 reputation
620
bio website
location Ukraine
age
visits member for 2 years, 7 months
seen 1 hour ago

Sep
9
comment Database Design for lookup tables
Do you mean you have multiple foreign key columns and one and the same table & column that those FKs are referencing?
Aug
28
revised Constant values in columns
added 10 characters in body
Aug
28
answered Constant values in columns
Aug
28
revised Dynamic file name for file import
added relevant tags
Aug
28
suggested suggested edit on Dynamic file name for file import
Aug
27
comment How to relate two rows in the same table
Even if for some reason INSERT VALUES had worked differently from INSERT SELECT, there would still have been the option of INSERT INTO t SELECT 1, 5 UNION ALL SELECT 5, 1, which you say you are aware is considered a single statement.
Aug
21
revised EF Code First uses nvarchar(max) for all strings. Will this hurt query performance?
capitalisation
Aug
21
suggested suggested edit on EF Code First uses nvarchar(max) for all strings. Will this hurt query performance?
Aug
12
revised scramble the value of one column and unscramble it?
reformatted and reworded for possibly better clarity
Aug
12
comment scramble the value of one column and unscramble it?
On the other hand, why do you need to be able to restore original values?
Aug
12
suggested suggested edit on scramble the value of one column and unscramble it?
Aug
2
comment Select rows after a specific ID
@AdamHaines: In SQL Server 2012, it is possible to solve this without ROW_NUMBER. Please see my answer if you are interested.
Aug
2
revised Select rows after a specific ID
deleted 193 characters in body
Aug
2
answered Select rows after a specific ID
Aug
1
comment How to do aggregate functions in GROUP_CONCAT
Have you tried looking at the resulting query that you are executing eventually? I'm still not sure what the calculations must be but I suspect your last attempt is not bringing your the results you were hoping for. Just look at the query. It seems like you are trying to build a query without having a firm idea what it should look like. I suggest you first try writing a complete static query that does what you want. Basing off the static query, it will be easier for you to figure out how to construct it dynamically.
Aug
1
comment How to do aggregate functions in GROUP_CONCAT
You don't have (nor need) to put all the code into your question. Put only most relevant parts that need to be shown exactly and explain the rest in simple terms, leaving the Fiddles only as (helpful) illustration. Same for the sample data, which you don't need to present as DDL/DML in the question. Talking of the data, it would also be a good idea to simplify your problem in terms of tables and columns involved so that you could easily show in your question what you are trying to do and not fear that the length of your question might drive away potential answerers.
Aug
1
comment Distinct rows from a join
The result set of a SQL query is a table, a set of rows and columns. If some of the rows belong with one another based on certain criteria, some of the values must be repeated to indicate that. If you want to avoid the repetition in the output, then you are dealing with a presentation issue, which, accordingly, should be addressed at your presentation level (typically your application). If, however, you are positive that in this case you want the query to be your presentation level and return a result set already prepared for display, please tell/show us what the output should look like.
Aug
1
comment How to do aggregate functions in GROUP_CONCAT
You are trying to use a column list as the argument (list) of SUM() (twice), but SUM accepts only one argument (column or expression), not a list. Because of the incorrect use of SUM(), it is not entirely clear what you are trying to achieve. An example of the expected output (output resultset) might help. Also, please consider putting the relevant parts of your code and sample data into your question. I like SQL Fiddle very much but that doesn't prevent it from falling sometimes. Just imagine it stops working at this very minute, what then? Your question will stop making much sense.
Jul
31
comment SQL Server Management Studio 2012 - horrible blue background
@MartinSmith: Yes that one, and the overall theme is blueish as well: menus, panels, status bar etc. (I have no problem with it, just clarifying.)
Jul
31
comment SQL Server Management Studio 2012 - horrible blue background
@MartinSmith: They may be referring to the blue colour of SSMS 2012's empty workspace. @ paulH: Could you post a picture of what you are talking about, just to clear any doubts?