Viewing 15 posts - 16 through 30 (of 33 total)
Are you trying to select only the insert statement and only execute that? If so, execute the entire script and not just insert statement.
July 14, 2011 at 5:02 am
If NumberOfUsers (distinct count of Users) each day were as below:
Sunday = 10
Monday = 10
Tuesday = 20
Wednesday = 20
Thursday = 30
Friday = 30
Saturday = 40
I expect that these values add...
July 14, 2011 at 3:48 am
Hi Lutz,
The Week is defined Sunday through Saturday. Also, it is actually the Time Dimension I have with Hierarchies as :
1. Year> Qtr > Month > Day
2.Week -...
July 14, 2011 at 12:26 am
Hey,
Do let me know in case any solution to this problem. I have been stuck with it for 3 days, and its freaking me out. :w00t:
July 13, 2011 at 7:00 am
The point being driven here is that when we store " EXACTLY SAME" string data as char in one table and as varchar in the other table there is a...
June 24, 2011 at 5:21 am
The question was to practically demo how char uses up more space than varchar, so here's the demo.
I created two tables, VarChar_Table and Char_Table as below:
create table Char_Table (name char(100))
create...
June 23, 2011 at 1:42 pm
Faced the same problem and the solution to DELAY VALIDATION posted above is just perfect. When you delay validation, it checks for the file only at the time of execution.
June 23, 2011 at 1:11 pm
You may achieve that using a FOR XML AUTO clause at the end your query. Hope this is what you were looking for.
June 23, 2011 at 12:14 pm
You might as well better the query using a CTE. You can avoid the cost of creating and inserting into a temp table.
WITH CTE (QuestionID)
AS
(select distinct sf.questionID
...
June 23, 2011 at 12:01 pm
You might as well use below query to find any sproc that uses your table.
select * from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_DEFINITION like '%YourTableName%'
June 23, 2011 at 10:57 am
You might as well refer to Grant's answer above as to what the answer in this case can be attributed to.
June 19, 2011 at 7:53 am
Consider your first statement:
dateadd(qq,datediff(qq,-1,GETDATE()),-1)
1. GETDATE() gets you current date
2. 0 here represents system start date which is 1900-01-01 00:00:00.000
3. -1 here represents a year before 1900 i.e 1899
4. qq is...
June 19, 2011 at 7:14 am
With the table structure and values as below:
create table a
(ID int, Orderdate datetime)
insert into a values
(1,GETDATE()),
(1,GETDATE()-3),
(1,GETDATE()-2),
(1,GETDATE()-1),
(1,GETDATE()-4),
(2,GETDATE()-1),
(2,GETDATE()-2),
(2,GETDATE()-3),
(2,GETDATE()-4)
The below query gives you the second highest date without having to perform joins.
with...
June 16, 2011 at 4:56 am
To answer why you get the else select statement in the output,whenever you compare strings for less than or greater, the comparison occurs between the ASCII values generated for the...
June 16, 2011 at 3:46 am
The solution you used here is temporary result set,CTE. You could as well have achieved this using a simple query like:
select <your col1>, a.sum as sum1, b.sum as sum2,(a.sum-b.sum) as...
March 8, 2011 at 5:12 am
Viewing 15 posts - 16 through 30 (of 33 total)