Viewing 15 posts - 31 through 45 (of 248 total)
Then you need to do a join between the header table and the two child tables (do an outer join if the record existence is not guaranteed in the two...
March 16, 2006 at 12:29 pm
You can save on one derived table by doing this...you cannot avoid both.
SELECT
ac.ID,
COALESCE(sum(a.Quantity),0) AS AQuantity,
COALESCE(max(b.BQuantity),0) AS BQuantity
FROM
#tblAccount ac
LEFT OUTER JOIN #tblA a
ON ac.ID = a.ID
LEFT OUTER JOIN (SELECT...
March 16, 2006 at 12:13 pm
When using a UNION or a UNION ALL, the order by clause applies to the entire set..since you want to order per set and then in them on the ID...
March 16, 2006 at 12:01 pm
Look into sp_procoption in BOL. You can set up a procedure to run when the service starts.
March 15, 2006 at 7:56 am
You can do this:
declare @ierror int, @rcount int, @i int, @table_name varchar(50), @cmd nvarchar(1000)
declare @table table (rownum int identity(1,1), table_name varchar(50))
insert into @table (table_name) select name from sysobjects where xtype...
March 15, 2006 at 6:47 am
Go through the solution guide that Microsoft has on their site for such migrations:
http://www.microsoft.com/technet/itsolutions/cits/interopmigration/unix/sybsqlsv/04sybmig.mspx
DTS is a part of the migration strategy.
March 15, 2006 at 6:37 am
Can the list of items be very large ? If not, then all this amounts to is an update statement with an IN clause for the Item values.
If the list...
March 13, 2006 at 6:10 am
Why not use COALESCE() which is present in both Oracle as well as SQL Server rather than writing UDFs for these ?
March 13, 2006 at 6:05 am
Apply the where clause before the order by..something like:
use pubs
go
select a.au_fname, a.au_lname, a.state,
(select count(1) from authors where au_fname <= a.au_fname and au_lname <= a.au_lname)
from authors a
where state = 'CA'
order by...
March 13, 2006 at 6:02 am
From BOL:
TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable.
So, you can...
March 9, 2006 at 7:21 am
If you can use the column Place from the view as a matching criteria, then you can generate the running number (this may or may not be applicable in your...
March 9, 2006 at 7:18 am
And also check this KB:
http://support.microsoft.com/default.aspx?scid=kb;en-us;812915&Product=sql2k
March 7, 2006 at 6:48 am
Your perfmon counters seem to be missing. Search for unlodctr and sqlctr80.dll and you will find instructions on how to fix it.
March 7, 2006 at 6:39 am
There are couple of ways of doing it...one is:
declare @table table
(col1 numeric(9,5))
insert into @table values (60.12456)
select col1, cast (col1 as numeric(6, 2)) changed_val from @table
--Output
col1 changed_val
----------- -----------
60.12456 60.12
March 7, 2006 at 5:59 am
Look at sysperfinfo..it will give you a poor man's way of monitoring the perfmon counters from within T-SQL...you can write scripts around it to do some trend analysis.
March 7, 2006 at 5:56 am
Viewing 15 posts - 31 through 45 (of 248 total)