Viewing 15 posts - 3,766 through 3,780 (of 5,588 total)
In your code, you have:
SELECT @CurrentTime = getdate()
SET NOCOUNT ON
The select before the "SET...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 22, 2010 at 4:58 am
As the others have already mentioned, you need to PIVOT your data. Take a look at the two Pivot/Cross-tab articles (Part 1 and Part 2) linked to in my signature.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 22, 2010 at 4:54 am
I would agree that Unique, filtered and included indexes are a sub-type of the clustered (for Unique) or non-clustered index types. However, according to the latest Microsoft documentation, they are...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 22, 2010 at 4:46 am
hrvoje.piasevoli (7/22/2010)
Would missing and unused make it 10?:)
Thanks for the early morning chuckle! Yes, you are right about this. 😀
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 22, 2010 at 4:34 am
You might want to look at STUFF also. If you use this, it might be easier to add the dashes from back to front.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 9:10 am
This code might help you out. Just take the deadlock XML info you posted above, put it into the @deadlock variable, and run.
declare @deadlock xml
set @deadlock = 'put your deadlock...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 9:04 am
Eduardo Gutiérrez (7/21/2010)
I have some problems with the following, I am trying to execute a statement to insert the percentage of the amount of money...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 8:48 am
Create a new step with T-SQL code to call sp_send_dbmail with the appropriate parameters to send your email.
On the step with the SSIS pkg, have it fail the job if...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 8:37 am
Anthonykush (7/21/2010)
I want to insert into Table A...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 8:29 am
Are the names of the tabs known in advance? If so, use a For or ForEach container to loop through each tab. Inside that, put the name of the tab...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 8:04 am
From what I see in your code, you are building a temp table, then opening up a cursor and inserting all columns from all rows from the Employee table into...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 6:48 am
The INTO clause goes before the first FROM:
Select A, B, C
into YourNewTable
from (Select A1, B1, C1 from (Select A2, B2, C2 from Table1 Union Select E2, F2, G2 from...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 6:28 am
Instead of using a correlated subquery, you might want to look into using a derived table:
UPDATE a
SET a.ShipQty = b.ShippedQuantity
FROM TempTotal a
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 21, 2010 at 6:18 am
DUPLICATE POST
please post all responses over here
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 20, 2010 at 9:15 pm
@Ron,
Excellent! I see I need to look into WITH TIES a bit now.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 20, 2010 at 9:11 pm
Viewing 15 posts - 3,766 through 3,780 (of 5,588 total)