Viewing 15 posts - 2,896 through 2,910 (of 7,191 total)
That's a very unambiguous message. What do you not understand about it? What statement are you running to get the error?
John
December 14, 2015 at 2:36 am
Why are you creating the table at runtime? Does it change from one run to the next? Indexes will slow down inserts, yes, although not necessarily by a...
December 11, 2015 at 8:34 am
Yes, you'd need to use dynamic SQL, something like this:
DECLARE @sql nvarchar(200)
SET @sql = N'Select * from #emps Where EN IN (' + @names + N')'
EXEC sp_executesql @sql
John
December 10, 2015 at 8:39 am
Careful, Chris. That doesn't work if you use values explicitly defined as time.
DECLARE @TimeTable table (StartTime time, EndTime time)
INSERT INTO @TimeTable
SELECT * FROM (VALUES
('09:00', '17:00'),
('09:00', '15:00'),
('09:30', '17:30'),
('12:00', '17:00'),
('13:00',...
December 10, 2015 at 5:45 am
Ooh yes, I take it back. I assumed it would be available in BI Edition also, but it isn't.
John
December 10, 2015 at 5:33 am
OK, the simplest way would be to do the calculation as normal, and use your CASE expression to test whether start is greater than end. If it is, then...
December 10, 2015 at 5:11 am
Start by looking up the syntax for RESTORE DATABASE. But what do you mean by "secondary server which is located in main server"?
John
December 10, 2015 at 4:59 am
Sounds like you need a CASE expression, although you don't give many details. What are your expected results?
John
December 10, 2015 at 4:57 am
Mirroring is deprecated. You should use AlwaysOn Availability Groups if you're upgrading to SQL Server 2012 or later.
John
December 10, 2015 at 3:55 am
The quickest way to find out is to type DATEDIFF into your favourite search engine. Yes, it works with the time data type. Here's an example; I'll leave...
December 10, 2015 at 3:46 am
Have you looked at the DATEDIFF function?
John
December 10, 2015 at 3:33 am
Damian
The "?" placeholder isn't used by all providers. Check your connection manager to see what provider you're using to connect to the database, then check the documentation to see...
December 9, 2015 at 8:04 am
Kim Crosser (12/8/2015)
SELECT PatientID, ...
from dbo.MDTest tbl1
where tbl1.IndexEndDate > @dParamDate
and not exists (select 1
from dbo.MDTest tbl2
...
December 9, 2015 at 2:15 am
That doesn't return the result set that the OP requires. He appears to want the cumulative count to show 0 unless there is actually a value in the corresponding...
December 8, 2015 at 9:01 am
SELECT
IndividualDate
,ClosedDate
,OpenDate
,CASE
WHEN ClosedDate IS NULL THEN 0
ELSE COUNT(ClosedDate) OVER (ORDER BY IndividualDate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
END AS CumClosedDate
,CASE
WHEN OpenDate IS NULL THEN 0
ELSE COUNT(OpenDate) OVER (ORDER BY...
December 8, 2015 at 8:34 am
Viewing 15 posts - 2,896 through 2,910 (of 7,191 total)