Viewing 15 posts - 5,251 through 5,265 (of 6,036 total)
I would suggest do not create a cursor.
And having read some basics about SQL would be quite useful.
July 21, 2006 at 6:32 am
There must be Line Feed charachters in one of those strings.
Select LEN(mediacode1) and you'll see the difference.
July 21, 2006 at 6:28 am
Select case when dbo.IsInt(ColName) = 1 then CAST(ColName as int) else NULL end, ...
FROM TableName
Where dbo.IsInt(ColName) = 1
July 20, 2006 at 5:34 pm
You need to build SQL string first:
declare @sql nvarchar (4000)
select @sql = 'SELECT sAMAccountName
FROM ''LDAP://corp.jpmp.chase.com''
WHERE objectCategory = ''Person''
AND objectClass = ''User"''
AND givenName = '''...
July 20, 2006 at 3:34 pm
Does the choice of second candidate depend on the personality of the first chosen?
If not, you may choose all in one roll and then work out selected list in a...
July 20, 2006 at 3:20 pm
SET @@Rowcount = @NumberToSelect
Select IDENTITY(int, 1,1) as RandomID,
PersonId
INTO #Selected
FROM dbo.Candidates
WHERE
ORDER BY NEWID()
SET @@Rowcount = 0
Than you can join #Selected to original table by Person ID and do whatever you...
July 20, 2006 at 2:18 pm
Use round ((value/60.0)+0.5, 0)
or even better CEILING(value/60.0)
July 19, 2006 at 7:48 pm
SELECT T1.*
FROM <Table> T1
INNER JOIN (select productID, groupID, MAX(version) -- whatever method you use to identify the latest version
from <Table>
group by productID, groupID) T2 ON T1.productID =...
July 19, 2006 at 5:31 pm
So, add WHERE eh_order_sent = 0 at the end of UPDATE statement.
July 19, 2006 at 5:00 am
If you test both approaches for performance you'll find out that yours is slower.
Relational databased are really bad on altering tables.
July 19, 2006 at 4:50 am
The problem is you expect no failed updates and you have not decided what to do when it's happened.
Now you just repeating failing update again and again. Not the smartest...
July 18, 2006 at 11:56 pm
DELETE C
FROM CxCHon C
INNER JOIN Historic H ON H.Terc = C.Terc AND H.Val = C.Val
July 18, 2006 at 11:45 pm
SELECT Class,
Sum(Volume) as 'Monthly Volume',
Sum(case when Datepart(dw,vDate) NOT IN (1,7) then Volume else NULL end) as 'Business Volume' ,
Average(Volume) as 'Average',
MAX( vDate) vDate,
Max(Volume) Volume
from #tblTemp
group by class
July 18, 2006 at 11:35 pm
INSERT INTO #Table EXEC SPName @var1, @Var2
Select @var1 as Var1, @Var2 as Var2, *
INTO #Table2
FROM #Table
July 18, 2006 at 11:23 pm
Did you delete aliases?
What you need to do is to replace "Table" with real table name. Don't change anything else.
July 17, 2006 at 6:14 pm
Viewing 15 posts - 5,251 through 5,265 (of 6,036 total)