Viewing 15 posts - 6,001 through 6,015 (of 7,608 total)
If you basically just want to copy/clone one table but without the identity, why not just "cancel" the identity as part of the SELECT ... INTO the new table? ...
June 18, 2014 at 2:17 pm
If I run a bunch of DELETE statements not wrapped in a BEGIN TRAN, COMMIT TRAN, will my deletes commit after each statement?
Yes, because SQL DELETE | INSERT | UPDATE...
June 18, 2014 at 2:14 pm
seequill (6/16/2014)
They also have indexes on the keys that I am linking them with too.
Verify that those indexes are actually being used; an estimated query plan is enough for
You...
June 16, 2014 at 4:57 pm
If you are using a native SQL account, you can check in:
sys.server_principals
There is no date specifically for password changes, but the modify_date does get reset when the password is changed.
June 16, 2014 at 1:13 pm
Jeff Moden (6/13/2014)
Jake Shelton (6/12/2014)
I'm looking for the most time-efficient way to backup db's to a local drive and then move the .bak files across to a new server,...
June 13, 2014 at 10:28 pm
I deferred converting the date to character until the very end to avoid having to convert every date and to avoid grouping on a char/varchar.
SELECT right('0' + cast(month(ClosingMonth) as...
June 12, 2014 at 4:40 pm
You also need to get rid of all the ISNULL()s in the WHERE clause. You should follow this simple rule:
Never use ISNULL() in a WHERE clause.
June 12, 2014 at 4:29 pm
The quick way would be switch the "=" and "<" in the current code 😉 :
delete table
from table t join
(select col1,col2,col3,col4, from table
where convert(varchar,insertdate,112) = convert(varchar,getdate(),112)
) y
on t.col1...
June 12, 2014 at 2:39 pm
I also suggest considering average wait time as opposed to only using total wait time:
select
case when waiting_tasks_count = 0 then 0 else
...
June 12, 2014 at 2:37 pm
It deletes only today's date, but only if there are matching records before today.
Apparently, based on the code, only the earliest matching row, across the 4 columns compared, is needed...
June 12, 2014 at 1:55 pm
It deletes rows with the current date/day if the table contains any row with a date before today's date where the 4 column values match today's 4 column values.
Edit: btw,...
June 12, 2014 at 12:59 pm
SUBSTRING(sample_text, PATINDEX('%[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9][0-9][0-9]%', sample_text), 10)
For example:
SELECT
sample_text,
SUBSTRING(sample_text, PATINDEX('%[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9][0-9][0-9]%', sample_text), 10)
FROM (
SELECT 'some other 44 numbers and text 555-555-1212 for...
June 12, 2014 at 9:42 am
Agreed, no.
But always use the SQL Server management tools to change SQL accounts, never the Windows tools.
June 12, 2014 at 9:28 am
To be safe, I make them all "Text".
Select the whole spreadsheet (if it's not too large) or each column separately (if it's very large), do "Format Cells...", and on "Number"...
June 12, 2014 at 9:25 am
You can have two log files, but it doesn't directly benefit you. When the first drive is (near) full, though, adding a second log file on a different drive...
June 11, 2014 at 8:00 am
Viewing 15 posts - 6,001 through 6,015 (of 7,608 total)