Viewing 15 posts - 1,606 through 1,620 (of 6,036 total)
Make the PK on UserID non-clustered and create a clustered index on UpdateDt.
February 17, 2016 at 2:22 pm
Same object has 2 or more permissions granted to it under the specified role.
Which is pretty typical.
For example, tables usually have permissions to INSERT, DELETE and SELECT for the same...
February 17, 2016 at 2:02 pm
It's not about the tables, it's about the columns.
When parsing a query SQL Server does not check if the table exists or not, but it validates the schema for all...
February 16, 2016 at 9:03 pm
As Gail said, SQL server creates missing statistics automatically.
Check sysindexes to see which "missing" statistics have been created by the server in the background. Their names start with "_WA_Sys_"
February 16, 2016 at 8:52 pm
When you run those queries from SSMS their resultsets must be cached already, so the queries aren't actually executed.
Try to run them at the end of the day, when SQL...
February 16, 2016 at 8:46 pm
When you decide on table design don't be driven away by technical details.
Follow the business logic.
Should you distinguish different types of notes?
Forget about the implementation in the old system.
Is the...
February 16, 2016 at 8:23 pm
ScottPletcher (2/16/2016)
Get rid of the dashes (-) in the date, they introduce errors (ambiguity).Use format 'YYYYMMDD [hh:mm:ss]', which is always interpreted correctly, regardless of language/date settings.
+1.
But better - go with...
February 16, 2016 at 3:20 pm
Try this one:
SELECT X.ADDRESS_ID
INTO #ToDelete
FROM dbo.ADDRESS A
WHERE NOT EXISTS (SELECT * FROM LEGAL_ENTITY L
WHERE L.ADDRESS_ID = A.ADDRESS_ID
)
IF EXISTS (SELECT * FROM #ToDelete )
DELETE A
FROM #ToDelete A
INNER JOIN...
February 16, 2016 at 3:10 pm
IndianRock,
Is it possible to record unique ADDRESS_ID's from deleted records of, say, table SERVICE_REQUEST when you clean it up?
Best way would be to use FOR DELETE triggers on the tables...
February 16, 2016 at 2:12 pm
insert into Target (CodelistId, Value)
select S.CodelistId, S.Value
from Source S
WHERE EXISTS (select * from Codelist L
where L.ID = S.CodelistId
OR
insert into Target (CodelistId, Value)
select L.ID , S.Value
from Source S
INNER JOIN Codelist...
February 15, 2016 at 2:50 pm
luissantos (2/12/2016)
--check if any records from inserted match SL
SELECT *
FROM SL sl
RIGHT JOIN inserted i ON i.fistamp = sl.fistamp AND...
February 15, 2016 at 2:38 pm
From the data given your script gives this outcome:
(No column name)(No column name)
@START_DATE2014-01-01 00:00:00.000
@END_DATE2016-03-01 00:00:00.000
@Previous_Start_Date2013-01-01 00:00:00.000
@PREVIOUS_END_DATE2015-03-01 00:00:00.000
What does not look right for you here?
February 15, 2016 at 2:28 pm
Jeff Moden (2/15/2016)
Sergiy (2/14/2016)
Jeff Moden (2/14/2016)
Sergiy (2/14/2016)
I wonder - how long the SELECT part of the query would take?
The DELETE part would probably take as long as not doing any...
February 15, 2016 at 1:52 pm
Jeff Moden (2/14/2016)
Sergiy (2/14/2016)
I wonder - how long the SELECT part of the query would take?
The DELETE part would probably take as long as not doing any deletes and would...
February 14, 2016 at 10:29 pm
Since ADDRESS_ID on dbo.ADDRESS is a clustered PK you better delete only those entries which make up a continuous range of unused addresses.
Which means - ADDRESS_ID is less than...
February 14, 2016 at 8:50 pm
Viewing 15 posts - 1,606 through 1,620 (of 6,036 total)