Viewing 15 posts - 331 through 345 (of 345 total)
College had an interesting one recently
update #tbl
set fld = 'asd'
from #tbl left outer join #tbl2 on #tbl.fld1 = #tbl.fld2 and #tbl2.fld3 = 'zxcv'
where #tbl.fld4 = ''
It should have updated every...
October 30, 2001 at 3:00 pm
I've come across problems with deeply nested views where the server can take a long time to generate the plan (hours) and getting differring plans depending on which order things...
October 30, 2001 at 2:35 pm
The v7 problems are probably the locking issues where if a temp table was created in one sp and used in a called one then it was fine in a...
October 30, 2001 at 2:31 pm
Agree with Andy Warren - you might want to do it with a global temp table though for a bcp / xp_sendmail
anyway - something like this should work.
Whenever you're building...
October 29, 2001 at 5:16 pm
I suspect you want something like this - probably are easier ways and ma=ybe you could use the ID if the datetimes are consecutive.
select log.ID, Log.[datetime] ,
case when coalesce(l2.[datetime],'1 jan...
October 29, 2001 at 5:01 pm
>> I mean no disrepect.
Chances of me ever taking it are very slim - hope you're as thick skinned (/confident).
>> especially if they are coming from a row processing background.
That's...
October 29, 2001 at 4:45 pm
What are you going to do with the output.
You will need a record of what is produced. If this is to be in the database then you should probably populate...
October 29, 2001 at 4:26 pm
Sure there's room for production DBAs but I consider them to be allied to the infrastructure depatment rather than development or application support (other than at a superficial level).
I consider...
October 29, 2001 at 4:17 pm
to save the last substring you could make this
declare @r nvarchar(1000)
select @r = coalesce(@r+',','') + rtrim(type) from SM_Servers,SM_group_Link where (SM_group_Link.group_name = @pop_group) and (SM_servers.ID = SM_Group_Link.group_item)
...
October 29, 2001 at 3:55 pm
You will end up doing single row processing but as soon as you use the explicit cursor you are limitting yourself to processing a single row from then on. Usually...
October 29, 2001 at 3:49 pm
You can always simulate a use database command by putting the command in a string and executing via sp_executesql
i.e.
use dbname
exec sp...
should be the same as
exec dbname..sp_executesql 'exec sp...'
October 29, 2001 at 3:43 pm
you could try it with an exec (look at sp_MSforeachtable to see what it generates).
But why use sp_MSforeachtable anyway, you will probably find it safer and easier to code yourself....
October 25, 2001 at 7:30 pm
You should never need to use a cursor and it is usually the worst way.
In this case you can just
select 'drop table ' + name from sysobjects where type =...
October 25, 2001 at 7:23 pm
You could have
Create PROCEDURE u_errorTest AS
DECLARE @intError int
SELECT * FROM CUSTOMERSzzzzzzzzzzzzz
SET @intError = @@ERROR
IF @intError <>0 GOTO Errh
BEGIN TRANSACTION
SELECT * FROM CUSTOMERSzzzzzzzzzzzzz
SET @intError = @@ERROR
IF @intError <>0 GOTO TxErrh
COMMIT TRANSACTION
Return
TxErrh:
ROLLBACK...
October 25, 2001 at 7:15 pm
Viewing 15 posts - 331 through 345 (of 345 total)