Viewing 15 posts - 406 through 420 (of 627 total)
ScottPletcher (12/22/2015)
December 22, 2015 at 12:25 pm
Phil Parkin (12/22/2015)
Sean Lange (12/22/2015)
Lynn Pettis (12/22/2015)
I really hope there is...
December 22, 2015 at 11:51 am
Lowell (12/22/2015)
DECLARE @DOB datetime
SET @DOB='1962-12-11'
SELECT CASE
WHEN DATEPART(DY,GETDATE()) >= DATEPART(DY,@DOB)
...
December 22, 2015 at 11:39 am
It's not too difficult...
SELECT DATEDIFF (YEAR, '1947-11-22 00:00:00.000', GETDATE()) AS Age
Checking out the MSDN page would have given you the answer.
December 22, 2015 at 11:25 am
Something like this worked for me. I used your example and striped out the problem hyphen and inserted into a DATETIME2 column.
DECLARE @myDateString VARCHAR(30) = '2015-12-22-20:21:43.370000'
December 22, 2015 at 7:08 am
I'm not 100% if it behaves differently in SSIS but going from a DATETIME to a DATE data type is an implicit conversion.
CREATE TABLE #before (myDatetime DATETIME)
INSERT INTO #before
VALUES(GETDATE())
CREATE TABLE...
December 21, 2015 at 11:39 am
If you only care about which accounts have reached your defined threshold, you could just do something like this.
DECLARE @CustomerOrders table
(
id int,
account NVARCHAR(20),
deposit INT
)
INSERT...
December 17, 2015 at 2:02 pm
Run your sub query separately and it will become obvious what the problem is.
SELECT WD#Next-3 FROM dbo.Calendar WHERE DTInt = c.CYCLE_DT
What value is that statement supposed to use when more...
December 17, 2015 at 1:39 pm
Try something like this...
CREATE TABLE #procList (procCatalog VARCHAR(256), procSchema VARCHAR(256), procName VARCHAR(256))
INSERT INTO #procList
EXEC sp_MSforeachdb
'SELECT ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME
FROM ?.information_schema.routines
WHERE routine_type = ''PROCEDURE'''
SELECT * FROM #procList WHERE procCatalog NOT IN...
December 17, 2015 at 1:08 pm
I use this simple query for INFO when I need to move files around. Maybe it's just me but I find it easier than digging through menus.
SELECT name, physical_name,...
December 17, 2015 at 7:23 am
The error says it all...you can't sum up a varchar data type.
Whichever way you decide to do the conversion you should sum the values first then convert it.
DECLARE @myTable TABLE...
December 11, 2015 at 8:34 am
anthony.green (12/11/2015)
select * from sysjobsteps where job_id = 0xBEB303926F0CE848BA3F9858417DB773
The hex value is the GUID converted to hex and binary is passed in without...
December 11, 2015 at 8:14 am
You mean something like this?
USE msdb
SELECT
s.name,
s.job_id,
sjs.step_name,
sjs.step_uid
FROM
sysjobs s
JOIN sysjobsteps sjs ON sjs.job_id = s.job_id
EDIT: Sorry, I didn't pay attention to the post title but it might have been worth reiterating in...
December 11, 2015 at 7:23 am
hazeleyre_23 (12/10/2015)
If i was to change my database to datatime datatype would could i get it to just...
December 10, 2015 at 7:17 am
This is actually a nice little exercise for practice. Although you'd hope that you wouldn't have to normally deal with tables like this. 😉
December 9, 2015 at 12:49 pm
Viewing 15 posts - 406 through 420 (of 627 total)