Viewing 15 posts - 24,826 through 24,840 (of 26,490 total)
MD (5/7/2008)
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[ufn_MaxDate] (@DateA DATETIME, @DateB DATETIME, @DateC DATETIME)
RETURNS DATETIME
BEGIN
DECLARE @ReturnDate DATETIME,
BEGIN
...
May 7, 2008 at 9:15 am
Just a problem with some people not reading the entire question. The question did specifically state SQL Server 2005.
Good question, everything specified to be able to make an educated...
May 7, 2008 at 8:57 am
Would you please provide a little more detail into what you are doing? Specifically, how are the four tables related (just need enough of the DDL to understand the...
May 7, 2008 at 8:56 am
Just another view of the example above. I added a count(n) to show the difference between count(*) and count(column_name).
select
count(*) as theCount,
count(n) as theOtherCount,
avg(n)...
May 7, 2008 at 7:46 am
Do the following:
round((s.ScoreAdjTotal - c.CourseRating) * 113 / c.CourseSlope,1,1) -- The additional 1 at the end will truncate instead of round (read BOL)
😎
May 6, 2008 at 1:49 pm
I put in my own referential integrity. You will need to adjust my code below for the fourth table you added. Also, mathematically, the result of your equation...
May 6, 2008 at 1:15 pm
gtan018 (5/6/2008)
(ScoreAdjTotal) - (CourseRating)...
May 6, 2008 at 12:37 pm
This is done in T-SQL, but the principle is the same:
declare @phonenum varchar(25)
set @phonenum = '(555) 555-1212'
select replace(replace(replace(replace(@phonenum, '(', ''), ')',''), ' ',''),'-','')
😎
May 6, 2008 at 12:29 pm
I found a way to connect to the Windows Internal Database (SQL Server 2005 Embedded Edition (SSEE)) with thanks to Wikipedia!
It has to be done local to server, and you...
May 6, 2008 at 9:53 am
Dumb question, but why are you using a cursor to move data from one table to another instead of a set-based query?
😎
May 6, 2008 at 8:28 am
Not sure if this is totally correct, but this is the view I'd start with.
create view Vw_name
as
select
cust.customerID
from
dbo.customer cust
inner...
May 6, 2008 at 8:04 am
Looks like you are trying to connect to SQL Server 1005 using SQL Server 2000's Enterprise Manager or Query Analyzer. Just like the messge says, you need to use...
May 6, 2008 at 7:37 am
Could we see the DDL for the table?
😎
May 6, 2008 at 7:34 am
John Mitchell (5/6/2008)
Try turning the subquery into a derived table and joining to it.John
Derived tables are not allowed in indexed views either.
😎
May 6, 2008 at 7:15 am
Viewing 15 posts - 24,826 through 24,840 (of 26,490 total)