Viewing 15 posts - 32,356 through 32,370 (of 49,552 total)
You're missing the END from the CASE
CASE
WHEN ...
ELSE ...
END
CREATE PROCEDURE StoredProcedure1
AS
SELECT
Id, EntryDate, Product, ProdPrice, Qty, Rtn,
(SELECT
CASE [X].Rtn
WHEN 0 THEN SUM([X].[Qty] * [X].[ProdPrice])
ELSE SUM([X].[Qty] *...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 19, 2010 at 6:52 am
Type the name of the DB you want it restored as at the top of the restore dialog.
You're probably right-clicking the database 'abc' and selecting restore. Don't. Right click the...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 19, 2010 at 3:58 am
CirquedeSQLeil (6/18/2010)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 19, 2010 at 3:38 am
No. Threads can't be deleted.
If you post in the wrong place, you can either report the post and request that it be moved, or post a new thread and update...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 12:36 pm
Please don't cross post. It just wastes peoples time and fragments replies.
No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic939716-149-1.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 11:15 am
VinicioAizpurua (6/18/2010)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 11:10 am
If you just want to view the proc, you can grant view definition rights on it.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 8:49 am
It is safe to restore an old backup, you'll lose backup and job history and any new jobs. It's generally not recommended to repair msdb anyway.
Fix the disks first though...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 7:38 am
sparky-407434 (6/18/2010)
DBCC CHECKDB REPAIR_ALLOW_DATA_LOSS
No point. If checkDB can't complete a check (in this case because the system tables are damaged) there's no way it's going to be able to repair...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 7:23 am
Are you increasing the size of the varchar? (null to non-null)? That will fragment the index because you're increasing the size of the index row.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 7:22 am
Not repairable. Sorry, DB's a loss.
You may be able to extract some data with it in emergency mode. Some objects will likely fail to script, some will fail to export....
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 7:20 am
Before you try a repair, let's see how bad it is.
DBCC CHECKDB (<Database Name>) WITH NO_INFOMSGS, ALL_ERRORMSGS
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 6:12 am
Eugene Elutin (6/18/2010)
Also, INT is implicitly convertable to datetime!
DECLARE @NotADate INT, @ADate DATETIME
SET @NotADate = 20100618
SET @ADate = @NotADate
When an int is cast to a datetime, SQL takes...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 6:12 am
Please, no. Storing dates as integers in that format makes any form of manipulation far harder than it needs to be. If the date can't be stored as a date...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 4:34 am
That doesn't look like SQL Server syntax. CurrentDate isn't a SQL function and that 'integer 5' is also not t-SQL.
The SQL Server way of doing that would be
SELECT dateStartTime FROM...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2010 at 3:32 am
Viewing 15 posts - 32,356 through 32,370 (of 49,552 total)