Viewing 15 posts - 3,301 through 3,315 (of 7,614 total)
You don't state what issue happens when you add the WHERE. [You don't need the N' and shouldn't use it.]
Perhaps there's some other character in the column besides...
July 2, 2018 at 3:01 pm
We could give a more specific answer if you'd show the actual code.
But, for example, if it's something like this:
WHERE ISNULL(date_column, '19000101') >= '20170101'
then you don't...
July 2, 2018 at 2:58 pm
INSERT INTO dbo.Tbl3 ( ID1, ID2 )
SELECT (SELECT ID1 FROM dbo.Tbl1 WHERE Name1 = @Name1),
(SELECT ID2 FROM dbo.Tbl2 WHERE Name2 = @Name2)
July 2, 2018 at 1:51 pm
SELECT Total_Input, Total_OK, Total_Fail,
CASE WHEN Total_Fail > 0 AND Total_Fail > Total_OK THEN Total_OK
WHEN Total_Fail > 0 THEN Total_Fail
...
July 2, 2018 at 1:42 pm
SELECT b.time * 1.0 credit, 0.0 credits, b.Id, b.date
FROM staff b
INNER JOIN (
SELECT *, isnull(dbo.ConvDate2(e.Startdate),'20111101') AS Startdate_converted
FROM emp
July 2, 2018 at 9:18 am
June 27, 2018 at 3:51 pm
I would hope that SQL itself would change it to an INNER JOIN when applicable, but it certainly won't hurt to try -- or verify using the query plan that...
June 27, 2018 at 3:31 pm
aftab97 - Wednesday, June 27, 2018 1:39 PMThat's an idea, but the tables are vendor proprietary tables and can't be modified.
Does that...
June 27, 2018 at 2:04 pm
Check to see if the db A on each instance allows cross-database ownership chaining:
SELECT is_db_chaining_on, *
FROM sys.databases
WHERE name IN ('A')
If it's 1, then security...
June 27, 2018 at 9:52 am
We would have to see the tables definition and the query itself to give you a reliable answer here.
June 27, 2018 at 9:46 am
While researching, I read online that unless you are using WITH(TABLOCK) when inserting...
June 26, 2018 at 12:35 pm
Yes, eventually it will get compressed automatically. Although SQL doesn't actually do any page compression until the page gets full.
June 26, 2018 at 10:47 am
Just plain DATEDIFF(DAY, ...) will do that. By definition, DATEDIFF counts the number of times the midnight boundary is reached/crossed between two dates/datetimes.
June 26, 2018 at 10:45 am
DECLARE @CurrentYearStart INT
DECLARE @CurrentYearEnd INT
SET @CurrentYearStart = 201801
SET @CurrentYearEnd = 201805
June 21, 2018 at 3:25 pm
To fix the immediate problem, try running:
DBCC CHECKIDENT ('dbo.CmEvent', RESEED, 55845910)
Better yet, rid yourself of the foolish and damaging myth that all tables should be clustered...
June 21, 2018 at 10:12 am
Viewing 15 posts - 3,301 through 3,315 (of 7,614 total)