Viewing 15 posts - 6,706 through 6,720 (of 8,731 total)
I can't test this right now because I don't have a 2012 instance available, but it uses Eirikur's idea.
WITH e1(N) AS(
SELECT N FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))e(N)
),
e2(N) AS(
SELECT a.N FROM e1 a, e1...
March 21, 2014 at 12:14 pm
Eirikur Eiriksson (3/21/2014)
Splitting the string is somewhat like crossing the stream for a sip of water, when all that is needed is to get the position of...
March 21, 2014 at 11:35 am
There are 2 options available:
DECLARE @sql varchar(8000) = '';
--Option 1
select top 3
@sql = @sql + 'select top 3 * from '+name + CHAR(10)
from sysobjects where type =...
March 21, 2014 at 11:16 am
Assign it to a variable and execute the variable with sp_executesql or EXEC().
March 21, 2014 at 10:51 am
That's not what I asked for. I need table definitions and sample data in a way that I can copy and paste them in SSMS and use them without any...
March 21, 2014 at 10:46 am
Congratulations Jason, that sounds great.
March 21, 2014 at 10:27 am
These are my observations about your answer, they're not wrong but I can partly understand the interviewer.
first, check whether the query is using index? If yes, check it is a...
March 21, 2014 at 9:57 am
You're looking for CROSS TABS or PIVOT. Take a look at this article to know more about it: http://www.sqlservercentral.com/articles/T-SQL/63681/
Here's an example:
SELECT id , name,
SUM(...
March 21, 2014 at 9:34 am
Another option is to use http://poorsql.com
It has SSMS and notepad++ plugins plus, plus a stand-alone formatter.
March 21, 2014 at 9:24 am
Koen Verbeeck (3/21/2014)
This means you will now have the entire table of tblclientLog...
March 21, 2014 at 9:21 am
steve.spenceST (3/20/2014)
🙂 Thank you for this answer. Helped me greatly.
Note that there are better ways of doing this. As explained in here: http://www.sqlservercentral.com/articles/comma+separated+list/71700/
March 20, 2014 at 2:11 pm
Sure, you can do many things, but we need some help from you. Could you post sample data, and expected results in the form of CREATE TABLE and INSERT statements?...
March 20, 2014 at 12:39 pm
I would suggest that you start with Stairway to Data[/url], continue with Database Design[/url] to understand SQL objects, then T-SQL DML[/url] and continue with whatever you're interested as the topics...
March 20, 2014 at 11:37 am
If I understand correctly, you want to check if there's a continuous character string in the column, it doesn't matter the position of it.
You could do this with a string...
March 20, 2014 at 10:51 am
Your WHERE clause is converting your LEFT JOIN into an INNER JOIN.
You need to change your query a little bit.
Here's a nice article on the subject: http://www.sqlservercentral.com/articles/T-SQL/93039/
SELECT Users.Code AS FE
,COUNT(Matters.FeeEarnerRef)...
March 20, 2014 at 10:39 am
Viewing 15 posts - 6,706 through 6,720 (of 8,731 total)