Viewing 15 posts - 226 through 240 (of 1,219 total)
If you want today before 23:00, then it would be
datecolumn < dateadd(HOUR, 23, convert(datetime2(0), convert(date, sysdatetime())))
But you are talking about five o'clock in the morning, so maybe you really mean...
October 16, 2019 at 11:37 am
In the same module, there can only be one CREATE TABLE/SELECT INTO for the same table. That is just the way it is. It is a holdover from SQL 6.5,...
October 8, 2019 at 9:44 pm
If you are assuming that we know the tables you are working with, I will have to disappoint you. We don't.
The normal recommendation when people ask with help to form...
October 4, 2019 at 7:49 pm
It's not fully clear to me what result you are looking for. Can you post CREATE TABLE + INSERT statements with some sample data and what result you want?
I can...
October 3, 2019 at 8:31 am
Don't use the Table Designer to change tables. It is utterly buggy and outright dangerous. It may decide to create a new table and copy data over when there is...
September 30, 2019 at 12:41 pm
And the error is?
September 30, 2019 at 10:51 am
Because at the time the trigger is compiled, ARITHABORT is still ON. The SET command is not a declaration, but an executable statement.
Here is a demo. The database has to...
September 25, 2019 at 8:57 pm
Requires compat mode 80? Only supported up to SQL 2008, which is itself is out of support. Time to look for a replacement, I'm afraid!
As for the actual problem, it...
September 25, 2019 at 6:23 pm
IF OBJECT_ID('tempdb..#data') IS NOT NULL DROP TABLE #data
IF OBJECT_ID('tempdb..#pivotcols') IS NOT NULL DROP TABLE #pivotcols
CREATE TABLE #Data (AccountId int, YrMo varchar(6), Amount int)
INSERT INTO #data
SELECT 10001, 201906,...
September 24, 2019 at 7:45 am
That stopped with SQL 2005. More precisely, SQL 2008 was the first version where BUILTIN\ADMINISTRATORS were not added by default.
September 23, 2019 at 9:02 pm
so it wont take hours to roll back.
There is no much rollback with shrink. It works with many small transactions as it moves pages around.
Note that to move the tables...
September 20, 2019 at 7:13 pm
Are there LOB columns in the database? If there are LOB columns it takes forever to shrink the database. Or more precisely: it can take a very long time. And...
September 20, 2019 at 3:17 pm
To be able to use ALTER TABLE PARTITION SWITCH, all indexes on the table must be on the partition scheme.
So change
CONSTRAINT UQNP_MyTable_IndexGUID UNIQUE NONCLUSTERED ON [PRIMARY],
to
September 13, 2019 at 8:53 pm
I don't know in which order connections and sessions are created, and I don't think it is relevant. I would say that for all practical purposes, they appear at the...
September 12, 2019 at 10:30 am
See session as the main concept. It is identified by the session_id, and it exists as long as the user is logged in. There are also sessions which are internal...
September 11, 2019 at 9:14 am
Viewing 15 posts - 226 through 240 (of 1,219 total)