Viewing 15 posts - 5,941 through 5,955 (of 6,036 total)
You created nested triggerd.
Your UPDATE trigger invokes sp KVtest which updates the table and fires the trigger which invokes the sp which fires the trigger which ...
Read BOL about Recursive...
_____________
Code for TallyGenerator
September 15, 2005 at 3:57 pm
Nobody mentioned another important difference.
Compare:
Select @A = ColA from tblA where ColB = @b-2
Set @A = (select ColA from tblA where ColB = @b-2)
SET will fail...
_____________
Code for TallyGenerator
September 15, 2005 at 3:42 pm
DBCC CHECKIDENT (tablename, RESEED, 0)
_____________
Code for TallyGenerator
September 14, 2005 at 10:49 pm
Look around before posting:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=219897
_____________
Code for TallyGenerator
September 14, 2005 at 7:44 pm
Trick is COUNT(ColumnName) counts only not null values, count(*) counts everything.
_____________
Code for TallyGenerator
September 14, 2005 at 5:41 pm
SELECT TP.TableParentID , Count(TP.TableParentID ), Count(TC.TableChildID)
FROM TableParent TP
LEFT JOIN TableChild TC on TC.TableParentID = TP.TableParentID and TC.Date1 IS NULL
GROUP BY TP.TableParentID
criteria for select:
_____________
Code for TallyGenerator
September 14, 2005 at 5:39 pm
add to my script:
where syscolumns.id = object_id(N'dbo.PROC_AllEvents')
and you'll see sky with diamonds!
![]()
SPs are in that list too.
_____________
Code for TallyGenerator
September 14, 2005 at 5:25 pm
SELECT *
FROM syscolumns
INNER JOIN syscomments ON syscolumns.cdefault = syscomments.id
_____________
Code for TallyGenerator
September 14, 2005 at 4:57 pm
Try to comment everything in SP but this statement and run it.
Looks like you look at wrong point.
_____________
Code for TallyGenerator
September 14, 2005 at 3:28 pm
Are trying to create reporting tool out of single query?
Answer on your last question depends on:
where you going supply results to;
what kind of presentaton format you gonna use;
etc...
But actually SQL...
_____________
Code for TallyGenerator
September 13, 2005 at 8:28 pm
Replace
SUM ( Quantity * UnitPrice ) AS [TOTAL AMOUNT]
with
'====' + convert(varchar(25), SUM ( Quantity * UnitPrice ) ) + '====' AS [TOTAL AMOUNT]
OR ![]()
_____________
Code for TallyGenerator
September 13, 2005 at 6:59 pm
If you will convert to CHAR(8) yes, not more than 8 chars will be allowed. In case of less than 8 chars string will be filled with spaces up to...
_____________
Code for TallyGenerator
September 13, 2005 at 6:55 pm
Same way. Just don't forget to convert "Total Amount" to any of char types before concatenation.
select '====' + convert(varchar(255), [Total Amount]) + '===='
_____________
Code for TallyGenerator
September 13, 2005 at 6:45 pm
Use Varchar(255) or Varchar(8000) instead of Char(8) if you need.
The only point is to use same type of data in the column. '=======' is char (varchar) data, so you cannot use...
_____________
Code for TallyGenerator
September 13, 2005 at 6:40 pm
It's just silly mistake:
cast(od.Orderid as char(8))
or
convert(char(8), od.Orderid)
![]()
_____________
Code for TallyGenerator
September 13, 2005 at 6:36 pm
Viewing 15 posts - 5,941 through 5,955 (of 6,036 total)