Viewing 15 posts - 4,621 through 4,635 (of 5,588 total)
You might want to check out the 15 ways to lose your cursor[/url] articles by RBarryYoung.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 2:44 pm
Are you using any catch-all queries?
Does your code utilize the "WHILE" statement?
Are recursive CTEs being utilized?
Have the execution plans for the query been analyzed FOR EACH condition of parameters?
Do the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 2:40 pm
Here's another way (note that it uses a virtual tally table - if you already have one, jump to the final select statement). If there are no gaps, this also...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 1:54 pm
I'm not sure how you saved out your users, but you might want to take a look at sp_help_revlogin. It scripts them out keeping the same SID (avoiding orphaned users),...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 1:29 pm
huston.dunlap (3/23/2010)
SELECT BEGDOC
INTO [#EDC-GH-GF]
FROM TABLE 1
WHERE PROCESSID = 'EDC-GH-GF'
When I use a PRINT(@QUERY) command to see the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 12:53 pm
Paul - thank you for showing me an area of improvement.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 9:14 am
Peter Brinkhaus (3/23/2010)
I guess the subtal difference between Wayne's and Paul's solution is the (ORDER BY N) vs. (ORDER BY (SELECT 0)). The last one doesn't require a sort.
and
Never...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 9:03 am
Paul White NZ (3/23/2010)
Wayne,Nice idea, but I have to say that is the least efficient in-line tally table I have ever seen!
What do you base the inefficiency on? I read...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 8:27 am
GilaMonster (3/23/2010)
WayneS (3/23/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 8:06 am
CirquedeSQLeil (3/22/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 8:03 am
GilaMonster (3/23/2010)
Dave Ballantyne (3/23/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 23, 2010 at 7:36 am
You might want to take a look at TRY/CATCH blocks, i.e.:
BEGIN TRANSACTION
BEGIN TRY
CREATE TABLE [dbo].[XXX](
[a] [smallint] NOT NULL,
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 22, 2010 at 6:16 pm
Lynn Pettis (3/22/2010)
I'm lost. What are you trying to do and why do you feel that you need to use a cursor?
From what I can gather, there is a...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 22, 2010 at 5:58 pm
rkinney-802645 (3/22/2010)
Wayne,How do I get rid of the SQL2? Including Cluster Admin, SQL Server Configuration Manager and SQL Server Surface Area Configuration.
Cluster Admin is an Administrator tool for managing clusters....
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 22, 2010 at 3:50 pm
Ganesh Lohani (3/22/2010)
I am having a difficulty of converting date time from marel to sql server.
I am able to convert to the calender date by applying...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 22, 2010 at 2:47 pm
Viewing 15 posts - 4,621 through 4,635 (of 5,588 total)