Viewing 15 posts - 2,326 through 2,340 (of 7,187 total)
SELECT
Time_Started
,ROW_NUMBER() OVER (ORDER BY DATEPART(wk,Time_Started)) AS Week_No
FROM #tbl_data
John
August 26, 2016 at 8:46 am
Prakash
What question are you asking here - how to do running totals, or how to change how they're partitioned at run time?
The answer to the first question is to use...
August 26, 2016 at 5:24 am
Ah yes. My mistake. I've edited the offending post.
John
August 26, 2016 at 2:05 am
No, but you can query sys.partitions to get the rows per table in a database, and use something like sp_MSForEachDB to loop through all databases and execute the same query.
John
August 25, 2016 at 8:51 am
Rushi
What security model are you using on your data source? It sounds if you're connecting as your own Windows login. If that's the case, the most likely explanation...
August 24, 2016 at 9:58 am
You can't disable a Windows login, but you can revoke the CONNECT permission.
John
August 24, 2016 at 9:50 am
What do you get if you run this?SELECT
o.name AS TableorViewName
,c.name AS ColumnName
,t.name AS TypeName
,c.max_length
FROM sys.indexes i
JOIN sys.objects o ON i.object_id = o.object_id
JOIN sys.index_columns ic ON i.object_id = ic.object_id AND...
August 24, 2016 at 8:51 am
Does this help? I found it by typing the title of your post into a search engine.
John
August 24, 2016 at 4:27 am
Yes. Join to sys.index_columns, sys.indexes and sys.types.
John
August 22, 2016 at 5:54 am
What do you get if you run this?
EXEC xp_fixeddrives
John
August 22, 2016 at 5:49 am
Join sys.indexes to sys.objects. You'll need to do that in every database (or use sp_MSForEachDB), though, if you don't know what database the index is in.
John
August 22, 2016 at 4:58 am
You're looking for times that are between ShiftStart and ShiftEnd. However, if ShiftStart is after ShiftEnd, as it is in your first two rows, that condition will never be...
August 22, 2016 at 4:11 am
You need to declare @result at the start of your code and reverse the order of the variables in the last line. Example C on this page shows you...
August 19, 2016 at 2:24 am
Put all the users into a domain group. Give that group write access on the folder from which the file is imported. Change the job so that it...
August 19, 2016 at 2:10 am
Just before the table is truncated, use the index use DMVs to find out which are the most useful indexes. Do this on several consecutive days, until you've got...
August 18, 2016 at 4:58 am
Viewing 15 posts - 2,326 through 2,340 (of 7,187 total)