Viewing 15 posts - 61 through 75 (of 206 total)
bommaka.nagarjun (9/23/2009)
I am writing a batch script which will take Full backup of the specified databases on our server. For this i am first creating...
September 23, 2009 at 6:29 am
Yet another syntax problem I missed. Change the @sql datatype to NVARCHAR(1000).
I think that will fix your problem.
rjv_rnjn is correct also. I went down a more...
September 22, 2009 at 9:26 am
Sorry, it should look like this:
execute sp_executesql @sql
September 21, 2009 at 11:40 am
You can't "select * from" a varchar variable but you can do something like this. The syntax might be incorrect. I can't test right now but you can...
September 21, 2009 at 8:59 am
Lynn's right having the table structures and sample data does make helping out a lot easier. But I think I understand the problem at least well enough to throw...
September 16, 2009 at 12:51 pm
The problem is that a count of 0 is still nonnull so that is what coalesce returns. You could probably do something with a case statement that would correct...
September 16, 2009 at 12:42 pm
From BOL: COALESCE Returns the first nonnull expression among its arguments.
So in your case the first argument will always be nonnull so it will be the one returned.
September 16, 2009 at 12:21 pm
I think this will work for you
SELECT * FROM sys.sysobjects S
WHERE type = 'U'
AND name LIKE 'GEN%'
September 16, 2009 at 12:18 pm
Just to expand a little. The issue is that whatever account runs xp_cmdShell needs to have permissions on the server since this stored procedure basically just gives you a...
September 16, 2009 at 9:39 am
The execution plans are quite different but I am not an expert at reading these so I will leave that for someone else.
1 does a merge join (concatenation)...
September 16, 2009 at 8:19 am
This should work but I don't have a SQL 7 or 2000 instance to test on.
DECLARE @BeginDate DATETIME
DECLARE @EndDate DATETIME
SELECT @BeginDate = DATEADD(YEAR,DATEDIFF(YEAR,0,GETDATE()),0)
SELECT @BeginDate
September 16, 2009 at 7:57 am
As GSquared said:
you can use the variables you already have
select sum(revenue) from table1
where revenueDate between @dMonthStartDate and @MonthEndDate
September 15, 2009 at 1:36 pm
The datetime datatype will use midnight as the time if none is specified. So you really do want the dates between 03/19 and 03/20
September 15, 2009 at 1:17 pm
I think this will work but it would help if you posted the DDL for these tables and some insert statements.
select firstName, lastName
from table_1
where id in (select supervisor from table_2...
September 15, 2009 at 6:08 am
Viewing 15 posts - 61 through 75 (of 206 total)