Viewing 15 posts - 31 through 45 (of 51 total)
You could try DBCC SHOWCONTIG(object_id)
This will give you the number of pages occupied by the table, and the average page density. Knowing that each page is 8Kb, and given the...
April 20, 2004 at 2:41 am
I agree that dynamic SQL has its problems, and is something I would always try to avoid, but the alternative in this situation of 300 CASE clauses seems a bit...
April 20, 2004 at 2:37 am
Bill
Your original code :
SELECT @SwitchNo FROM AccessProfile WHERE EmpNo = 3567
will always return the value 'S1', since this is what the @switchno variable is set to earlier. Incidentally, if you...
April 19, 2004 at 9:47 am
I find the Page Reads/Sec and Page Writes/Sec very useful - they're in the Buffer Manager list.
They report at the SQL read/write level, rather than on physical disk activity, so...
April 19, 2004 at 9:33 am
Since you are looking for duplicates, you can use the HAVING clause to return only those records which appear more than once. This will save you the trouble of looking...
April 19, 2004 at 9:30 am
Bill
Using a dynamic SQL string should solve this.
Because you don't know the column name until you've done the lookup, you can't right a non-dynamic SQL statement. In your code,...
April 19, 2004 at 9:25 am
I vaguely remember seeing something like this a long time ago. I think I had to have an index on the remote table, possibly a unique one?
April 19, 2004 at 9:20 am
It's exactly the same. Get a DBA who knows what he's talking about!
April 19, 2004 at 5:03 am
Try along these lines :
select
col1, col2, col3, count(*)
from
table1
group by
cols1, col2, col3
having
count(*) > 1
April 19, 2004 at 3:41 am
I agree with Glenda. Cursor-based triggers are a relic and should be replaced wherever possible ie. in 99.99% of cases.
April 8, 2004 at 5:13 am
Not sure if this is related, but I had a similar problem some time ago. It turned out to have something to do with truncating the table containing the text...
April 8, 2004 at 2:57 am
How about the following. Afraid I haven't been able to test it, but any mistakes should be easy to spot and fix.
First create the following table and import your file...
April 7, 2004 at 6:06 am
This will take care of single-row or multi-row updates :
create trigger tr_test
on prod_psz for update
as if update(prim_stor_zone)
begin
update
b
set
b.last_pick = 'Y'
from
inserted as a
join prod_master as b on b.prod_id = a.prod_id
join deleted as...
April 7, 2004 at 5:30 am
Or, without using exists :
insert x
select y.col1, y.col2
from tabley as y
left join tablex as x on x.col1 = y.col1 and x.col2 = y.col2
where x.col1 is null
April 7, 2004 at 5:04 am
You could put your code into a stored procedure, then use the bcp command to execute the proc and output to a .xml file
Regards
Rob
April 7, 2004 at 4:59 am
Viewing 15 posts - 31 through 45 (of 51 total)