Viewing 15 posts - 181 through 195 (of 3,011 total)
It's a parse time error, not a run time error.
August 8, 2013 at 4:30 pm
the sqlist (8/2/2013)
SELECT [Month] = datename(mm,min(SomeDateTime)),
Amount = SUM(SomeAmount)
FROM #MyHead
WHERE SomeDateTime >= '2010'...
August 2, 2013 at 9:35 am
You can pass the random value to the function via an input parameter:
CREATE FUNCTION dbo.GetRandomNumber (@Lower int, @Upper int, @MyRand float)
RETURNS int
WITH SCHEMABINDING
AS
BEGIN
DECLARE @random int
SELECT @random = ROUND(((@Upper -...
July 30, 2013 at 2:32 pm
Steven Willis (7/22/2013)
--this date MAY or MAY NOT be valid depending on the DATEFORMAT setting
SELECT ISDATE('29-12-2013')
--this is never valid (out-of-range)
SELECT ISDATE('32-12-2013')
--this should always be valid in all formats
SELECT...
July 22, 2013 at 12:54 pm
The CASE expression will verify that the data string is in YYYY-MM-DD format, and is a valid date. It will return a 1 if the date is valid and...
July 22, 2013 at 8:42 am
This code shows how to setup an optional DATE parameter that will use the input passed or default to the current date if it isn't.
go
create procedure sp_MyProcedure
@DateParameterdate = null
as
set...
July 18, 2013 at 11:06 am
For 2005, 2008, or 2008 R2, you should check column packagetype=6 to make sure you are only updating maintenance plan packages.
The script below works with 2005, 2008, or 2008 R2...
July 2, 2013 at 11:38 am
This will usually work to drop a database that is being used.
use master;
alter database [MyDatabase] set offline with rollback immediate;
alter database [MyDatabase] set online with rollback immediate;
drop database [MyDatabase];
June 26, 2013 at 3:12 pm
select top 1
a.[Date]
from
(
select top 1 b.[Date] from table1 b order by b.[Date] desc
union
select top 1 c.[Date] from table2 c order by c.[Date] desc
) a
order by
a.[Date] desc
June 25, 2013 at 1:09 pm
George Hepworth (6/21/2013)
The problem turns out to be finding the developer version for 2008 R2. Gee MS likes to be obscure.
It is not easy to find, but Google is your...
June 21, 2013 at 12:58 pm
SQL Server Developer Edition is only $50.00, so that SQL Server license cost is fairly small.
June 21, 2013 at 10:45 am
jhager (6/20/2013)
A developer created several tables with PKs but no FKs. I used the Database Diagram feature to "map out" where the FKs should be, but when I saved the...
June 20, 2013 at 1:34 pm
The restored DB will be exactly the same size as the database was when you created the backup.
June 17, 2013 at 3:06 pm
"3MB for the procedure cache"???
Did you really mean 3 GB for the procedure cache?
How many connections are open to the server?
June 17, 2013 at 9:46 am
Viewing 15 posts - 181 through 195 (of 3,011 total)