Viewing 15 posts - 916 through 930 (of 7,191 total)
Step by step dynamic pivot script? Your wish is my command. It's all out there for you if you search for it.
John
February 2, 2018 at 8:52 am
A few things to look out for:
- Indexes that are never used for seeks or scans
- Indexes that are too wide (have more columns than are necessary to...
February 2, 2018 at 5:39 am
No, the locks don't cascade up to the views and back down to the other tables referenced by the views. If you do something to a table, you'll get locks...
February 2, 2018 at 5:28 am
Why do you want to store denormalised data in your database, especially when that data is a duplicate of data that is normalised? If you insist on doing this, the...
February 2, 2018 at 3:12 am
Doing the update in small batches with intervals between them and very frequent log backups, or the database in Simple recovery mode, will minimise the quantity of log space required. ...
February 2, 2018 at 2:22 am
You've missed the ON clause from your GRANT statements, but never mind - I think I get the gist of it. If it were my system, I'd be pleased that...
February 1, 2018 at 3:16 am
You didn't say what kind of changes they're making. And I still don't understand what exact permissions they have - perhaps you could script them out as GRANT statements, please? ...
February 1, 2018 at 2:55 am
What is the actual permission they have, and at what level (database, schem, object)? What sort of alterations are the users making. Normally DDL changes really would be something that...
February 1, 2018 at 2:32 am
February 1, 2018 at 2:13 am
Yes, or this, which is very similar. It relies on Red and Green being the only two possible values of Value1. I think Piet's solution deleted too many rows.
January 31, 2018 at 8:34 am
My previous script showed you how to pivot and how to do time differences, so what are you stuck on? It would also be helpful if you would show what...
January 31, 2018 at 4:51 am
If you're getting a login failed error, you can check the errorlog on the server to find out why the login failed (that's assuming that the instance is configured to...
January 31, 2018 at 4:25 am
What are you asking for help with here - calculating time differences, or pivoting information for each user into a single row? What have you already tried?
John
January 31, 2018 at 3:24 am
No consumable DDL or sample data supplied, so I couldn't test, but this should work after any necessary tweaking.
WITH KeysandCounts AS (
SELECT
TempKey
, MAX(SLNNumber) AS...
January 31, 2018 at 2:56 am
before where i worked, it's was possible in sql server management studio to...
January 31, 2018 at 2:10 am
Viewing 15 posts - 916 through 930 (of 7,191 total)