Viewing 15 posts - 5,371 through 5,385 (of 6,036 total)
You can do it only with scalar functions.
select dbo.MyFunction(Col1) as Col1Mod, Col2,...
FROM ...
April 27, 2006 at 6:38 pm
FORGET ABOUT "TOP"!!!
Select Identity (int, 1, 1), <key columns>
INTO #TempTable
FROM SomeTable
ORDER BY <desired order>
SELECT T.*
FROM SomeTable T
INNER JOIN TempTable TT ON T.<key columns> = TT.<key columns>
WHERE TT.ID between @StartRow and...
April 27, 2006 at 5:08 pm
Because your "set based approach" is actully a hidden cursor.
April 27, 2006 at 5:01 pm
Yes, of course,
but idea is you don't need to mention the same table twice:
UPDATE OrdMain
SET
ListTotal = SUM_Each
FROM (select OrderId , SUM(ListEach) SUM_Each
from OrdItem
group by OrderId ) DT
WHERE DT.Order_ID =...
April 27, 2006 at 2:18 pm
Everythin is much simpler:
UPDATE OrdMain
SET
ListTotal = SUM(ListEach)
FROM OrdItem
WHERE OrdItem.Order_ID = OrdMain.Order_ID
AND (OrdMain.Order_Num = N'11589');
April 26, 2006 at 7:27 pm
Try to avoid "optional" things.
They may not work on every server.
delete dm
from table2
inner join longname defs on defs.defid = table2.defid
inner join table1 dm on dm.id = defs.id
WHERE table2.col1 ='whatever'
April 26, 2006 at 6:47 pm
Seems it's data type mismatch.
What is the datatype of ColumnB?
The statement
Set @var3 = @var1 + 2
will implicitely convert @var1 from nvarchar to int and than convert int result to...
April 26, 2006 at 6:42 pm
I don't know where to start.
Everything is wrong. Really.
For the beginning, LogPingResponse must be a view, not a table.
Select dbo.DateOnly(RingTime) as pingDate,
-- dbo.DateOnly is a UDF returning only date...
April 26, 2006 at 6:14 pm
Everything here is wrong: from initial design to the way SP is written.
If this the the way your system is developed you better hire SQL developer, otherwise you will never...
April 26, 2006 at 5:25 pm
There are many solutions.
One of them:
Build a table UDF with parameter @DBName.
Another one:
Use dynamic query to BUILD A VIEW addressing your databases.
April 26, 2006 at 4:40 pm
Actually if you look on my trigger you'll realize IT IS "2 INSERT statements in a transaction", exactly as David suggested.
Don't be afraid of triggers. They are really helpful for...
April 23, 2006 at 4:59 pm
Use lookup for retrieving necessary ID.
CREATE View ...
AS
SELECT Name_A, Name_B
FROM TableA
Inner Join TableB on TableA.B_ID = TableB.ID
GO
CREATE Trigger .....
ON <View Name>
INSTEAD OF INSERT
AS
April 23, 2006 at 4:19 pm
I'm not sure what's easier: parse such queries or build a new, properly designed, database.
April 21, 2006 at 7:02 pm
Try to open the file with Notepad.
Probably you'll see why Excell does not see commas in it.
April 20, 2006 at 5:15 pm
Staging is nice and clean while you have SINGLE process to import data.
But when you have a situation with many processes are importing data simultenuosly and sometimes it's probably repeating...
April 20, 2006 at 3:28 pm
Viewing 15 posts - 5,371 through 5,385 (of 6,036 total)