Viewing 15 posts - 316 through 330 (of 541 total)
May 27, 2004 at 2:43 pm
Wow! Nice trick, Rockmoose!
If you want to do it for dynamic SQL:
create function Column_CSV (@TableName sysname)
returns varchar(8000)
as
begin
declare @ColList varchar(8000)
SELECT @ColList = isnull(@ColList + ', ', '') + c.name
FROM sysobjects o
JOIN...
May 27, 2004 at 2:37 pm
The biggest problem I saw with your schema is lack of indexes. Definitely index the columns that are referenced by Foreign Keys, but I'll bet there are more besides.
cl
May 27, 2004 at 2:30 pm
The author also says that UDF to UDF joins will be faster than straight joins. NOT! If this is occuring you've got some schema/index issues.
cl
May 27, 2004 at 2:26 pm
exists is definitely better; left join and looking for a null is better then "not exists".
cl
May 26, 2004 at 12:31 pm
Milo,
You should check the Microsoft knowledge base. Here's an article about what waittime and waittype mean.
http://support.microsoft.com/default.aspx?scid=kb;en-us;822101&Product=sql
I'm sure you could find more information as well.
cl
May 24, 2004 at 12:19 pm
Good article.
It's amazing to me how many DBA's know how to create tables and indexes, but they have no idea how to create GOOD tables and indexes. The first thing a...
May 21, 2004 at 6:19 pm
Wait a minute; an 8 proc XP machine. Good God! I believe the only OS that supports SQL with more than 4 procs is Advanced Server (or is it DataCenter?),...
May 21, 2004 at 2:44 pm
Alternatively, you could put this in a trigger:
if object_ID('temp_Product') is not null drop table Temp_product
create table TEMP_Product
(Product varchar(255),
ProductCount int,
ProductPerc money
)
go
create Trigger TR_TEMP_Product
on TEMP_Product
after insert
as
Update TEMP_Product
set ProductPerc = cast(ProductCount as money)/(select sum(ProductCount)...
May 21, 2004 at 2:39 pm
The check constraint is going to be more expensive then a trigger, as you have access to the logical "inserted" and "updated" tables (usually in memory). If you can make the...
May 21, 2004 at 2:24 pm
Build the string first and then print to the console to verify that they command is correct (or you can use profiler).
string p22 ="hello" ;
string tSQL = "EXEC transact '"+p22+"'";
--Print...
May 21, 2004 at 2:20 pm
Sorry, I should have been more clear about "capitals in proc". I meant in the proc name, not in the actual code.
Apparently this is not required, system procs with uppercases works...
May 21, 2004 at 12:24 pm
Phill,
What do you mean, "fields are manually entered in"?
cl
May 20, 2004 at 4:58 pm
sqljean,
You should not be using a sub-query at all, and definitely not a "Where IN". Instead, use a join...
DELETE d
From #Test_Delete d
JOIN dbo.Account a on d.MyID = a.MyID
May 20, 2004 at 3:17 pm
Viewing 15 posts - 316 through 330 (of 541 total)