Viewing 15 posts - 541 through 555 (of 626 total)
Try this:
--Create table test
CREATE TABLE [dbo].[test](
[c1] [varchar](30) NULL,
[c2] [varchar](20) NULL
) ON [PRIMARY]
--Insert values in to the test table
Insert into test values ('533','Robin')
Insert into test values ('655','Steve')
GO
--Create View
create view [dbo].[test_vw]
as
select *,...
June 17, 2015 at 11:37 am
Are you sure your predicates are identical in both IF clauses. In your test you set your parameters but I can't tell if you used those exact values in...
June 17, 2015 at 11:23 am
The database size will not change no matter how many rows you delete. To better understand this you should do some research on how SQL actually stores data. ...
June 17, 2015 at 9:26 am
RP_DBA (6/16/2015)
DECLARE @StartDate DATE = '20150601'
,@EndDate DATE =...
June 16, 2015 at 2:17 pm
This should work:
NOTICE - I purposely created a gap for CBA to demonstrate.
DECLARE @test-2 TABLE ([Index] INT, FactorS NVARCHAR(3), Value DECIMAL(2,1), [Date] DATE)
INSERT INTO @test-2 ([Index], FactorS, Value, [Date])
VALUES (1,...
June 16, 2015 at 1:46 pm
GilaMonster (6/16/2015)
yb751 (6/16/2015)
If so than you could (ironically) make use of the LAG function. Otherwise Jeff's solution will work just fine.
Unless I'm missing something, LAG won't produce the results...
June 16, 2015 at 1:36 pm
Robert klimes (6/16/2015)
read the post at the link in my...
June 16, 2015 at 1:02 pm
Fairly straightforward, try this:
SELECT
MRN,
DischargeDate,
ApptDate,
DATEDIFF(dd,DischargeDate,ApptDate) AS DayDifference
From
Test
WHERE
DATEDIFF(dd,DischargeDate,ApptDate) <= 7
LOL, I feel like I'm answering a question for a former employer. (I used to be in Healthcare)
June 16, 2015 at 12:38 pm
6 single quotes does work as a replacement string because...
'<-Outside quotes contain your string->'
The 2nd & 3rd '' will become a single quote because the 2nd is used to...
June 16, 2015 at 11:55 am
It's a little tricky to demonstrate because you have to escape the single quote in the example itself but the execution is fairly simple.
DECLARE @quotedString NVARCHAR(10) = 'ABC''DEF''GHI'
SELECT REPLACE(@quotedString,'''','"');
June 16, 2015 at 11:36 am
Michael L John (6/15/2015)
yb751 (6/15/2015)
Did you try using GO?Example:
First SP
GO
Second SP
This will not work inside a procedure.
Can you post your code?
Darn...missed that in the OP
June 15, 2015 at 12:38 pm
You could do something like this. Just be mindful if you have any values that exceeds 24hrs (in seconds).
DECLARE @seconds INT
SET @seconds = 24331
IF @seconds < 43200
SELECT CAST(@seconds/3600 AS...
June 15, 2015 at 11:53 am
You have a few options.
1. Setup a trace using profiler
2. Extended Events (I'm assuming your using 2008)
3. You can get some limited stats from DMV's i.e. sys.dm_exec_query_stats
Cheers,
June 15, 2015 at 11:39 am
Viewing 15 posts - 541 through 555 (of 626 total)