Viewing 15 posts - 12,991 through 13,005 (of 14,953 total)
Simon Facer (7/2/2008)
GSquared (7/2/2008)
Don't use table variables unless you absolutely have to. Even then, check your options with someone else.
Why do you say that? I'm not necessarily an advocate...
July 3, 2008 at 7:59 am
Steve Jones - Editor (7/2/2008)
July 3, 2008 at 7:50 am
John Rowan (7/2/2008)
I think Jeff is reffering to ALTER TABLE SWITCH ... for partitioned tables
Yes, this is what I thought also, but the OP had not mentioned using SQL...
July 2, 2008 at 2:52 pm
Odd. I don't get that in mine. The plan just gets rid of the other two columns, but is otherwise identical.
July 2, 2008 at 2:49 pm
Jeff Moden (7/2/2008)
I'm with Gus, but let me go one step further. With 5000 procedures (I assume that's like saying "a bazillion"), and all those ugly WHERE clauses, etc,...
July 2, 2008 at 2:45 pm
I have to admit, these days, I generally use the GUI to build maintenance plans and schedule them. Easier than writing my own cursors and all that.
July 2, 2008 at 2:37 pm
declare DatabasesCur cursor local fast_forward
for
select name
from sys.databases
... set up the cursor, open it, assign the name to a variable
While @@Fetch_Status = 0
Begin
select @sql = 'Use ' + @DBName...
July 2, 2008 at 2:36 pm
I'm talking about something like this:
eclare @CurrentDt smalldatetime
declare @CurrentDtStr varchar(8)
set @CurrentDt = getdate()
set @CurrentDtStr = CONVERT(VARCHAR,@CurrentDt,112)
WHILE NOT EXISTS
(SELECT *
FROM DB2_PROD_DCDB.DCDB.APP.NIAD_ETL_STATUS
WHERE CONVERT(VARCHAR,etl_dt,112) = @CurrentDtStr)
AND datepart(hour, getdate()) < 23
BEGIN
WAITFOR DELAY...
July 2, 2008 at 2:33 pm
Generally, for that kind of thing, I use a cursor to step through the databases and run a dynamic SQL command on each one. It's the only place I...
July 2, 2008 at 2:26 pm
Inserting it into a staging table means you don't have to mess around with making the clustered index match the order in the import file. You can use a...
July 2, 2008 at 2:22 pm
You have a proc/script in your trace that doesn't select/update/insert/delete anything in any tables.
July 2, 2008 at 2:18 pm
I think that's just a display issue in the plan. I get the same thing with both versions of your query.
July 2, 2008 at 2:16 pm
You have my sympathy. As expected, a procedural programmer with no clue how relational databases work.
It can be done as a series of joins, which will be faster, but...
July 2, 2008 at 1:22 pm
Good that it works.
I was only looking for table definition data if the query didn't work.
July 2, 2008 at 1:19 pm
Viewing 15 posts - 12,991 through 13,005 (of 14,953 total)