Viewing 15 posts - 271 through 285 (of 907 total)
Here is an example of a case in the where clause. Not sure if this is what you are looking for:
create table xxx (regionid int, col1 int, col2 int)
insert...
Gregory A. Larsen, MVP
May 20, 2003 at 11:33 am
Will this work for you:
select * from table
where (regionid>0 and col1 = 1)
...
Gregory A. Larsen, MVP
May 20, 2003 at 10:02 am
I see the problem. I think you will either need to you place your common SP in master, or replicate them in all your user db's.
Gregory Larsen, DBA
If you...
Gregory A. Larsen, MVP
May 20, 2003 at 8:14 am
Thanks for the tip on this EMAIL software. Does anyone else recommend a different software package?
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at...
Gregory A. Larsen, MVP
May 20, 2003 at 6:53 am
You might try something like this:
declare @cmd varchar(8000)
set @cmd = 'declare @table table (l datetime)' + char(13) +
'insert...
Gregory A. Larsen, MVP
May 19, 2003 at 1:43 pm
You need to do something like this:
declare @cmd nvarchar(4000)
set @cmd = 'declare @db2 nvarchar(50)' + char(13) +
'use pubs' + char(13)+...
Gregory A. Larsen, MVP
May 19, 2003 at 1:38 pm
It is my understanding you need a POP3 server to set up SQL Mail even if you are only sending mail. At least that is what I understand via...
Gregory A. Larsen, MVP
May 19, 2003 at 1:32 pm
How about something like this:
select * from (SELECT top 20 [LoginName], sum([CPU]) as SUM_CPU
FROM [master].[dbo].[proc_use]
GROUP BY [LoginName]
order by Sum_cpu DESC
) B
union
select 'Others' 'LoginName', (select sum([CPU]) FROM [master].[dbo].[proc_use])...
Gregory A. Larsen, MVP
May 19, 2003 at 11:10 am
You might try something like this:
declare @d decimal(10,5)
set @d = 25.000
select case when @d = floor(@d) then CAST(floor(@d) AS CHAR) else rtrim(cast(floor(@d) as char)) + '.' + REVERSE(RTRIM(CAST(CAST(floor(reverse(cast(@d as char(10))))AS...
Gregory A. Larsen, MVP
May 19, 2003 at 8:43 am
Here is an article I wrote about changing collation.
http://www.sqlservercentral.com/columnists/glarsen/collate_part2_1.asp
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
Gregory A. Larsen, MVP
May 15, 2003 at 1:51 pm
You can do what you want by building dynamic sql that builds dynamic sql, that then gets executed. Here is an example that issues a USE statement, followed by...
Gregory A. Larsen, MVP
May 14, 2003 at 7:41 am
Possibly your stored procedures are still in cache. You might try SP_RECOMPILE on all SP. Seems like there is an easy way flush all execution plans from cache,...
Gregory A. Larsen, MVP
May 13, 2003 at 9:57 am
Now there is a acronym "DASD" that I normally don't here people use any more. I do all the time, and people look at me like they don't know...
Gregory A. Larsen, MVP
April 29, 2003 at 9:19 am
Andy, I guess I'm now confused. I know there are two service accounts, one for MSSQLSERVER, and one for SQLSERVERAGENT. Now I always thought if you run JOBs...
Gregory A. Larsen, MVP
April 29, 2003 at 7:52 am
Winash, would you please explain? For some reason I can't figure out what the three *'s in the following statement means:
select distinct(F2.machine_id),F1.product_key
from Forum F1,Forum F2 where
cast(F2.machine_id as varchar)***'#'***cast(F1.product_key as varchar)...
Gregory A. Larsen, MVP
April 29, 2003 at 7:23 am
Viewing 15 posts - 271 through 285 (of 907 total)