Viewing 15 posts - 796 through 810 (of 8,416 total)
DECLARE
@StartDate datetime = '2012-02-03 23:00:00',
@EndDate datetime = '2012-02-07 00:00:00';
DECLARE @Holidays AS TABLE
(
HolidayDate date...
February 8, 2012 at 2:54 am
suhailquadri (2/8/2012)
Thanks for the reply..Similar post : http://www.sqlservercentral.com/Forums/Topic1248766-391-1.aspx?Update=1
Yes I saw that after I posted here. Please don't post twice in different places next time, thanks.
February 8, 2012 at 2:15 am
Koen Verbeeck (2/8/2012)
The INTERSECT is quite an elegant solution, that one is going straight into my knowledge library
For details here, for anyone interested:
February 8, 2012 at 2:13 am
Jason-299789 (2/7/2012)
February 8, 2012 at 2:11 am
Koen Verbeeck (2/8/2012)
I believe this will work:
Doesn't account for NULLs.
SELECT
t2.*
FROM dbo.temp1empdtls AS t1
JOIN dbo.temp2empdtls AS t2 ON
t2.empno = t1.empno
WHERE
...
February 8, 2012 at 1:56 am
This meets the stated requirement:
SELECT
t2.*
FROM dbo.temp1empdtls AS t1
JOIN dbo.temp2empdtls AS t2 ON
t2.empno = t1.empno
WHERE
NOT EXISTS
...
February 8, 2012 at 1:54 am
monpara.sanjay (2/8/2012)
Where is the DATE datatype in sql server??????????
Here: DATE (Transact-SQL)
It's been around for four years or so now 🙂
February 8, 2012 at 1:34 am
Hugo Kornelis (2/6/2012)
SQL Kiwi (2/6/2012)
We use a CLR aggregate for this.
That's definitely cleaner, and easier to understand code. But how does the performance of a CLR aggregate compare to performance...
February 8, 2012 at 12:31 am
ssc_san (2/7/2012)
For this query where should I place collate clause?
It depends on the rules you want to apply:
DECLARE @T1 TABLE (col1 varchar(30) COLLATE Latin1_General_CI_AS);
DECLARE @T2 TABLE (col1 varchar(30) COLLATE Latin1_General_CS_AS);
INSERT...
February 8, 2012 at 12:06 am
CELKO (2/7/2012)
we use COALESCE() not ISNULL
Also, we would tend to use a VIEW and not an UPDATE.
And we never, never use the...
February 7, 2012 at 11:50 pm
Another option would be to have SYSTEM_USER as the default for the column.
February 7, 2012 at 11:46 pm
February 7, 2012 at 11:31 pm
Example simple join:
DECLARE @Table1 AS TABLE (col1 integer NULL, col2 integer NULL);
DECLARE @Table2 AS TABLE (col1 integer NULL, col2 integer NULL);
INSERT @Table1 VALUES (1, 10), (2, 20), (3, 30), (4,...
February 7, 2012 at 11:15 pm
February 7, 2012 at 11:11 pm
Guessed from memory at 31 (-15 to +15) and got it wrong. Ah well.
February 7, 2012 at 10:56 pm
Viewing 15 posts - 796 through 810 (of 8,416 total)