Viewing 15 posts - 2,101 through 2,115 (of 8,731 total)
It probably needs to be more like this to include all the possible hours.
DECLARE @StartDate datetime = '20010101',
@EndDate datetime = '20010107';
WITH
E(n)...
October 3, 2016 at 7:16 am
Jeff Moden (10/2/2016)
The Dixie Flatline (9/30/2016)
Fortunately, I only need around 300, not thousands. 😀Thanks guys.
Just curious.... what are you doing that needs so many APPLYs?...
October 3, 2016 at 6:58 am
peter478 (10/3/2016)
I dont need to define week 1. I know week, year, day and I need to get back date.
The way you define week 1 will change the week number....
October 3, 2016 at 6:54 am
GA_SQL (10/3/2016)
But for each month i have 30 employees, how to maintain that in a single table
What's the problem? You could have 30 million employees and their salaries for several...
October 3, 2016 at 6:47 am
That's not possible without dynamic SQL. That's a bad idea, though.
September 29, 2016 at 11:42 am
Drop the default and recreate it.
CREATE TABLE SampleData(
[EmailDate] [datetime] NOT NULL CONSTRAINT [DF_OnlineDay10_EmailDate_GETDATE] DEFAULT (CONVERT([date],getdate(),0))
);
INSERT INTO SampleData VALUES(DEFAULT);
ALTER TABLE SampleData DROP CONSTRAINT [DF_OnlineDay10_EmailDate_GETDATE] ;
ALTER TABLE SampleData...
September 29, 2016 at 10:14 am
Different options.
SELECT v.*
FROM (
VALUES
(1, 'True', 'True', 'True', 'True', 'True', 'True'),
(2, 'True', 'True', 'True', 'True', 'True', 'True'),
(3, 'True', 'True', 'True', 'True', 'True', 'True'),
(4, 'True', 'True', 'True', 'False', 'False', 'True'),
(5, 'True', 'True',...
September 28, 2016 at 9:56 am
spaghettidba (9/28/2016)
Luis Cazares (9/28/2016)
Don't listen to thatYou mean me? Wow, that's quite a way to disagree... 🙂
Sorry Gianluca, I'm just trying to bring the young padawan into the dark side....
September 28, 2016 at 7:25 am
Don't listen to that, download the developer edition of SQL Server which is free if you just create a (free) account here: https://www.visualstudio.com/dev-essentials/
September 28, 2016 at 7:10 am
Sue_H (9/26/2016)
It's Oracle so it doesn't matter 🙂 See the original post, Oracle.Sue
I don't see any reference to Oracle and this is a SQL Server site.
September 26, 2016 at 5:10 pm
I can't picture a situation in which a CASE statement could be the only option in a WHERE clause.
I, however, can see a lack of understanding of SQL. I said...
September 26, 2016 at 3:10 pm
drew.allen (9/26/2016)
xr280xr (9/26/2016)
September 26, 2016 at 1:57 pm
If you can't change the database design, you need to use dynamic sql to recreate the view constantly.
Here's an idea for a trigger.
IF EXISTS(
SELECT *
...
September 26, 2016 at 1:47 pm
PhilipC (9/23/2016)
Thanks Luis, that did the trick 🙂When you say "You probably have your server configured incorrectly, using the U.S. defaults. ", where is this configuration option?
In the GUI, you...
September 26, 2016 at 12:39 pm
Viewing 15 posts - 2,101 through 2,115 (of 8,731 total)