Viewing 15 posts - 3,706 through 3,720 (of 5,588 total)
You know, the people that help out here are all un-paid volunteers. Providing the DDL scripts (CREATE TABLE, CREATE INDEX, etc.) for the tables affected, and INSERT statements to put...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 5, 2010 at 8:17 am
First question: are you working in SQL 2008? I ask because you posted in a SQL 2008 forum, yet your xml code looks like SQL 2000 era. If you're in...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 5, 2010 at 6:04 am
TRACEY-320982 (8/4/2010)
INSERT INTO MAIN_TABLE
SELECTCOLUMN1, COLUMN2
FROM TEMP_TABLE
WHERE NOT EXISTS
(SELECT * FROM MAIN_TABLE) W
WHERE
W.COLUMN1 = COLUMN1 AND
W.COLUMN2 = COLUMN2)
So i am doing a where...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 9:37 pm
Jack Corbett (8/4/2010)
Just made my first "real" forum post in awhile. Had to pick a thread where Mr. Celko has already weighed in. http://www.sqlservercentral.com/Forums/Topic963903-391-1.aspx
Then it looks like you went...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 9:30 pm
You can't use a CTE in SQL 7/2000 (which is the forum that you posted in).
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 9:26 pm
In addition to what has already been mentioned, you might want to check out the cross-tabs and pivot articles (Parts 1 and 2) - links are in my signature. Part...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 9:25 pm
Ken,
You're not going to find too many people here very wild about your cursor solution. There are many of us that will be willing to help you get rid of...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 3:05 pm
Steve Jones - Editor (8/4/2010)
I vote no. I like my watch. I don't want to have to buy a new one that has 10 digits.Plus I have this cool clock:
Okay,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 2:46 pm
I think the problem with using a view in a select statement is if the view doesn't have all of the columns that you need, and you end up joining...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 2:26 pm
Ray, thanks for that link. I'm also trying to look into MVC.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 12:52 pm
Perry Whittle (8/4/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 9:46 am
Yes. Did you even try to do this?
WITH TableCTE (ClientID, ProductName, ProdSize, MeasuredDate) AS
(
select ClientID, ProductName, CAST(Avg(ProdSize) AS DECIMAL(9,2)) as ProdSize,
convert(varchar(4),dateadd(month, datediff(month, 0, MeasuredDate),0),100) + convert(varchar(4),year(dateadd(month, datediff(month, 0,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 9:40 am
One slight improvement on Lutz's function:
CREATE FUNCTION [DSUSER].[BDP_WPS_Approvals] (@lWPSID AS INT)
RETURNS TABLE
WITH SCHEMABINDING
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 8:33 am
Sure. Just know that this will cause more transactions in the log file, and since you were concerned about the size of that...
Since you're continually updating the tables until they...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 7:55 am
I don't see anything wrong with it.
Another way would be:
declare @rowcount int
set @rowcount = 1
while (@rowcount > 0) begin
begin transaction
update top (10000) ...
set @rowcount...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 4, 2010 at 7:36 am
Viewing 15 posts - 3,706 through 3,720 (of 5,588 total)