Viewing 15 posts - 676 through 690 (of 1,491 total)
SELECT *
FROM YourTable
WHERE SnapshotDate > @from AND SnapshotDate < @to
OR (SnapshotDate = @from AND hourkey > 2)
OR (SnapshotDate = @to AND @to < 21)
August 19, 2014 at 5:28 am
I have this old bit of js which may be of use:
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var fldr = fso.GetFolder(".");
var fenum = new Enumerator(fldr.files);
var File_Array = new Array();
var i = 0;
while...
July 21, 2014 at 5:47 am
1. You should post test data in a consumable format:
CREATE TABLE #t
(
Location_Id int NOT NULL
,Parent_Location_Id int NULL
,Location_type char(1) NOT NULL
,Location_name varchar(10) NOT NULL
);
INSERT INTO #t
VALUES(1, NULL, 'F', 'ENGINTLAB')
,(33, 1, 'A',...
July 18, 2014 at 10:28 am
For casting to smalldatetime to work:
1. The date range must be 1900-01-01 to 2079-06-06
2. There must be no more than 3 decimal places with the seconds.
Check you data to confirm...
July 16, 2014 at 9:59 am
I think you have to explicitly make your NULLs smalldatetime:
CASE
WHEN ISDATE(CAST([Inception Date] AS smalldatetime)) = 1
THEN CAST([Inception Date] AS smalldatetime)
ELSE CAST(NULL AS smalldatetime)
END
July 16, 2014 at 9:08 am
SSIS is much more efficient.
As I find SSIS fiddly to work with, I sometimes start development with linked servers and then move to SSIS once I have the correct logic.
May 21, 2014 at 9:27 am
Run:
RESTORE HEADERONLY FROM DISK = '<backup_file_location>';
and see if the backups are compressed.
May 21, 2014 at 9:19 am
DECLARE @backupfile NVARCHAR(512) = N'W:\Backup\360_prod_'
+ REPLACE(REPLACE(REPLACE(CONVERT(varchar(16), CURRENT_TIMESTAMP, 120), '-', ''), ' ', ''), ':', '')
+ N'.BAK';
BACKUP DATABASE DBName
TO DISK = @backupfile
WITH COPY_ONLY, INIT, SKIP, CHECKSUM, COMPRESSION, NAME = N'DBName-Full Database...
May 7, 2014 at 4:43 am
Try 'ORDER BY JOB_Date' not 'ORDER BY a.JOB_Date'.
The query should then be order by the JOB_Date expression.
March 25, 2014 at 5:52 am
Dennis Baldwin (3/11/2014)The wall I hit is marked by the "Microsoft OLE DB Provider for ODBC Drivers" when it attempts to call DSNs. So far, it look like that...
March 12, 2014 at 8:08 am
You should be able to setup 32bit DSNs by using the ODBCAD32.exe in the C:\Windows\SysWOW64 folder.
March 11, 2014 at 10:39 am
I recently had a problem with some maintenance plans on a machine I sort of look after but do not control the access rights on.
The problem was fixed by:
SP_CONFIGURE 'ALLOW...
January 22, 2014 at 10:33 am
CREATE TABLE #YourTable
(
YourTable1 varchar(20)
,YourTable2 int
,YourTable3 datetime
)
SELECT *
FROM tempdb.sys.columns
WHERE object_id = OBJECT_ID('tempdb..#YourTable')
December 3, 2013 at 4:34 am
The fundamental problem is the whole approach reeks of bad design.
The thing that takes the time is scanning the table, not the CASE statements. The query I posted attempted to...
December 2, 2013 at 7:49 am
If you post what you are actually trying to do, someone may be able to suggest a better approach.
The best that can be done with the current approach is a...
December 2, 2013 at 6:31 am
Viewing 15 posts - 676 through 690 (of 1,491 total)