Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag, like sql-server-2016, since it is often relevant to the question.
0
votes
2
answers
300
views
database design storing historical information
I have this database table Templates and I need to keep historical information. So in code what I am doing is inserting a new row with the updated data and then setting the IsCurrentVersion flag to f …
0
votes
2
answers
2k
views
stored procedure case statement
I am building this where condition by concatenating the @whereClause variable in my stored procedure. At this point I am using the case to add additional values. if there a better way to do this?
SET …
0
votes
0
answers
33
views
User profile keeping old records and add endDate
I have this table CustomerProfile that has the CustomerId, ProfileId,startDate and endDate. When the user add data to the profile it will insert a record with a startDate and endDate is null. If the u …
2
votes
2
answers
701
views
Compare two table and update with endDate
I have two table CustomerProfile and NewData. The CustomerProfile has CustomerId,ProfileId,startDate and endDate. The NewData table is new data that is coming in just has the ProfileId.I create a temp …
-1
votes
1
answer
161
views
Cluster Index Scan 96%
I am seeing this Cluster Index Scan at 96% and I am not sure why that is? In the table I have a clustered index on the PK and a non-clustered on the where condition so should this being using the non …
2
votes
1
answer
135
views
Date time cast preferred method
What would be the preferred method for speed and less database stress using a between or less than?
SELECT LogId
FROM [Master].[dbo].log mlog
WHERE cast(LogDate as Date) BETWEEN '2019-01-01' AND '2019 …
0
votes
1
answer
301
views
query bad performance
Is there anything I can do to improve this query performance? I have included the execution plan and the Server Profiler output. Is there a index that can help? I see there is a Index Seek that is ta …
3
votes
1
answer
135
views
Temp tables streamline query
I am trying to get to the Customer table from data in the SiteConfiguration table.
I am getting the data and setting it to @AdditionalVoteViewers, which would be a string of emails address. I then spl …