Monday, August 12, 2013

[SQL Server] Case statements advice - query case field?

[SQL Server] Case statements advice - query case field?


Case statements advice - query case field?

Posted: 12 Aug 2013 01:25 AM PDT

Hi,So basically I have three tables with three types of "things". Each of these tables have a column called "name". My fourth table contains references to these tables through an id field, only one of these tables will be related to the fourth table - I have produced the following SQL so the query has a name column which is populated by the related tables name.[code="sql"]SELECTCASE WHEN thing1.name IS NOT NULL THEN thing1.name WHEN thing2.name IS NOT NULL THEN thing2.name WHEN thing3.name IS NOT NULL THEN thing3.name END AS name,base.ls_id, base.date_lease_start, base.date_lease_end, base.lease_term, base.amount_current_rentFROM base_table AS base LEFT OUTER JOIN thing1_table AS thing1 ON base.as_id = thing1.as_id LEFT OUTER JOIN thing2_table AS thing2 ON base.bl_id = thing2.bl_id LEFT OUTER JOIN thing3_table AS thing3 ON base.ld_id = thing3.ld_id[/code]That query works, my problem is the following, I hope to use the query in a SSRS report with a parameter enabling a search against the name column (which the case statement populates).I would like to query the returned "name" column from that query - I could populate a temporary table however I would like to know what the "proper" way is for this?

Joining data from two tables to another

Posted: 12 Aug 2013 05:55 AM PDT

Hi All;. I am testing some code with temporary tables. I have let's say table 1 which I will call "mother table". Here what it looks like.ID Letter Data11 A 23 2 B 24 3 C 25 4 D 12 5 E 14 6 F 10 7 G 12 I am trying to join data from two tables which I will call "child1" and "child2" to the mother table on matches from letter column to have something like this. ID Letter Data1 LetterC DataC1 A 23 A 1232 B 24 B 1243 C 25 C 125 4 D 12 D 1275 E 14 E 1286 F 10 F 1297 G 12 G 130Here is "Child1" and "Child2" respectivelyID Letter DataC21 D 127 2 E 128 3 F 129 4 G 130 ID Letter DataC11 A 123 2 B 124 3 C 125 I have tried for one hour to come up with some code, but it seems that I am only able to get only data from one table joined to the mother table with the following query. I'm stuck and was wondering if any suggestion or code for a poor soul like me. Here is what I have so far. thanksUSE TEMPDBIF exists (SELECT * FROM Mother AS M inner join dbo.cHILD1 AS C1 ON M.Letter = C1.LETTER)begin SELECT M.LETTER, C1.LETTER, M.DATA1, C1.DATAC1 FROM Mother as M inner join child1 as c1 on c1.letter = m.Letterendelsebegin select M.Letter , C2.Letter, M.data1, C2.DataC2 from Mother as m inner join child2 as c2 on c2.letter = m.Letterend

Using Replace to ..well...replace...

Posted: 12 Aug 2013 12:41 AM PDT

I have a field in a table which has hard coded paths for files. Like "http://www..../downloads/files/dlr-tlk-apr-2001.pdf"I need to update all references to "downloads' and change it to "forms" so all of the paths would look like:"http://www......./forms/files/dlr-tlk-apr-2001.pdf"I assume I need to use Replace. What would be the best way of doing this?

[SQL server issues] Commented Issue: AdventureWorksDW2008R2 DimDate table has missing dates [13383]

  1. AdventureWorksDW2008R2 DimDate table has missing dates

    sqlserversamples.codeplex.com/workitem/13383 - Cached - Similar
    28 May 2010 ... AdventureWorksDW2008R2 DimDate table has missing dates ... in dates
    between 2008 and 2010 in the AdventureWorksDW2008R2 DimDate ...

  2. Microsoft SQL Server Community & Samples - Issues

    sqlserversamples.codeplex.com/workitem/list/basic - Cached
    22 Feb 2013 ... There seams to be an issue with the AdventureWorksDW2012 Data file ...
    AdventureWorksDW2008R2 DimDate table has missing dates.

  3. SqlServerSamples Work Item Rss Feed - Kekunda.com

    reputationless7.kekunda.com/chan-5121419/latest.php - Cached
    24 Jul 2013 ... 08/27/09--10:26: Commented Issue: Installer: The zipped DB package doesn't
    contain the DB Data (chan 5121419). Environment ========== ...

  4. AdventureWorksDW2008R2 DimDate table has missing dates [13383]

    sqlsample.blogspot.com/.../ Commented%20Issue%3A%20AdventureWorksDW2008R2%20Di... - Cached
    25 Jul 2013 ... Showing posts with label Commented Issue: AdventureWorksDW2008R2
    DimDate table has missing dates [13383]. Show all posts ...

  5. Recent Items from 6/2/2010 | Pulse | SQLServerPedia

    pulse.sqlserverpedia.com/stream/?when=2010-06-02&page=34
    2 Jun 2010 ... SqlServerSamples - View Issue #13383: AdventureWorksDW2008R2 DimDate
    table has missing dates. Type: Link; 6/2/2010 at 1:39 PM ...

[SQL server issues] Created Issue: SQL Server 2008 Developer edition sample database install error [18174]

  1. SQL Server 2008 Developer edition sample database install error

    sqlserversamples.codeplex.com/workitem/18174 - Cached
    2 Jun 2012 ... SQL Server 2008 Developer edition sample database install error. description. I'
    m trying to install Adventureworks sample dB and i get an error.

  2. Microsoft SQL Server Community & Samples - Issues

    sqlserversamples.codeplex.com/workitem/list/basic - Cached
    22 Feb 2013 ... When I try to run this SQL statement: CREATE DATABASE ... SQL Server 2008
    Developer edition sample database install error. I'm trying to ...

  3. Release notes 2.2 - dCache

    www.dcache.org/downloads/1.9/release-notes-2.2.shtml - Cached
    If you are installing over a pre-existent billing database, you may, after upgrading
    and starting dCache, see some messages in the log for the domain where ...

  4. Rational Quality Manager and Rational Test Lab Manager 2.0 ... - Jazz

    jazz.net/downloads/rational-quality-manager/releases/2.0?p... - Cached
    29 Jul 2009 ... This document contains information about system requirements, installation, and
    known issues for Rational Quality Manager version 2.0.

  5. SqlServerSamples Work Item Rss Feed - Kekunda.com

    reputationless7.kekunda.com/chan-5121419/all_p1.html - Cached
    06/01/12--17:07: Created Issue: SQL Server 2008 Developer edition sample
    database install error [18174] (chan 5121419). I'm trying to install
    Adventureworks ...

  6. BESX 5.0.2., BAS-AS service starts and stops, admi... - BlackBerry ...

    supportforums.blackberry.com/t5/BlackBerry.../615372 - Cached
    Hello, Hopefully someone knows has the answer to this problem. I installed
    BESX 5.0.2. On a Win2k3 SBS server. The server is fully patched. I.

  7. Multiple BSODs, help please? - Windows 7 - Bleeping Computer

    www.bleepingcomputer.com/forums/t/.../multiple-bsods-help-please/ - Cached
    I uninstalled Avast and installed Microsoft Security instead as I've seen ... that - I
    will certainly look harder if that appears to be the issue though.

  8. Sql samples, sql tips: [SQL server issues] Created Issue: SQL Server ...

    sqlsample.blogspot.com/2013/04/sql-server-issues-created-issue-sql.html
    8 Apr 2013 ... [SQL server issues] Created Issue: SQL Server 2008 Developer edition sample
    database install error [18174]. An unexpected error has ...

  9. SilverStream Application Server 3.5.4 Release Notes - Novell

    www.novell.com/documentation/extendas35/docs/relnotes.html - Cached
    Welcome to SilverStream Application Server Version 3.5.4. ... For example, to
    verify the latest install level for package bos.rte.libc you would use the following ...

  10. opatch failed on linux 32 bit while installing ... | Oracle Forums

    https://forums.oracle.com/thread/2258839 - Cached
    22 Jul 2011 ... Trying to install latest JulY PSU patch 12419378 on oracle 11g r2 11.2 but get ...
    the database, but stay in SQL Plus you will get a similar error.

  11. SQL Server >> Archive Page 84

    www.help-sql.info/archive/27/84.html - Cached
    45868: data processing extensions on sql server express edition ... 29423: setup
    issue: unable to install sql server 2005 express on windows 2003 server sp2

  12. What is Virtual Directory? ... - IIS Forum - DotNetFunda.com

    www.dotnetfunda.com/.../thread2063-what-is-virtual-directory.aspx - Cached - Similar
    Virtual directory a directory that is created in the IIS to host a local application or
    target a certain physical folder available on the server or where ...

  13. 16.3sp2 (22-Feb-08) - Petrosys Technical Support

    www.petrosysguru.com/releases/ReleaseNotes_16_3sp2.htm - Cached
    22 Feb 2008 ... 17805 Change windows install to Microsoft MSI installer. 17893 Installing Petra
    .... 18368 Issues with Multiple Dispatch Servers on one Host.

  14. The specified module could not be found. (Exception from ...

    www.dotnetspark.com/.../18174-specified-module-could-not-be-found- exception.aspx - Cached
    13 Sep 2010 ... I've been using SQL Server 2008 Express Edition on my development pc for
    several months now.Â? It has recently started giving me an error ...

  15. wiki-analysis/data/Programming_languages.wikitax at master 路 ...

    https://github.com/dmosen/wiki.../data/Programming_languages.wikitax
    10 Jun 2013 ... Contribute to wiki-analysis development by creating an account on GitHub.
  16. Windows Tech >> Visual Studio >> Archive Page 52

    www.windows-tech.info/archive/4/52.php - Cached
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
    30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 ...

  17. a RESTful Pet Catalog | Java.net

    weblogs.java.net/blog/caroljmcdonald/.../2008/.../a_restful_pet_c.html - Cached
    Posted by caroljmcdonald on August 5, 2008 at 9:03 AM PDT ... Sample Catalog
    application implemented with JAX-WS on the server side and JSF on the client ...

  18. WebPDM Release Notes V5.3 - Scribd

    www.scribd.com/doc/42064028/WebPDM-Release-Notes-V5-3 - Cached
    11 Nov 2010 ... WebPDM Release Notes V5.3 - Free download as PDF File (.pdf), Text file (.txt)
    or read online for free.

  19. Blue skies for Microsoft's Azure cloud offering - Worldnews.com

    article.wn.com/.../Blue_skies_for_Microsofts_Azure_cloud_offering/ - Cached
    24 Jan 2012 ... How to create table in SQL Azure -- Cloud Database .... Microsoft Developer
    Forum 2011 Presentation - Cloud Girl (Madobe Claudia).

[SQL server issues] Created Issue: AdventureWorksDW2012 Download file corrupt [19063]

  1. AdventureWorksDW2012 Download file corrupt - Microsoft SQL ...

    sqlserversamples.codeplex.com/workitem/19063 - Cached
    14 Dec 2012 ... There seams to be an issue with the AdventureWorksDW2012 Data file
    download. When I try to run this SQL statement: CREATE DATABASE ...

  2. Microsoft SQL Server Community & Samples - Issues

    sqlserversamples.codeplex.com/workitem/list/basic - Cached
    22 Feb 2013 ... There seams to be an issue with the AdventureWorksDW2012 Data file
    download. When I try to run this SQL statement: CREATE DATABASE ...

  3. Microsoft SQL Server Community & Samples - Kekunda.com

    repute7.kekunda.com/chan-5121423/all_p2.html
    1 | (Page 2). 12/14/12--09:05: Created Issue: AdventureWorksDW2012
    Download file corrupt [19063] (chan 5121423). There seams to be an issue with
    the ...

  4. Created Issue: AdventureWorksDW2012 Download file corrupt [19063]

    sqlsample.blogspot.com/.../ Created%20Issue%3A%20AdventureWorksDW2012%20Download... - Cached
    2 Aug 2013 ... Created Issue: AdventureWorksDW2012 Download file corrupt [19063]. There
    seams to be an issue with the AdventureWorksDW2012 Data file ...

  5. Tobe Kimalaja - Google+ - I experienced the same problem. Looking ...

    https://plus.google.com/102311087450897723438/.../NJ5xgHBrn9g - Cached
    25 May 2013 ... Looking for a solution for this, as well. [SQL server issues] Created Issue:
    AdventureWorksDW2012 Download file corrupt [19063].

  6. Tobe Kimalaja - Photos - Google+

    https://plus.google.com/102311087450897723438/photos - Cached
    25 May 2013 ... Looking for a solution for this, as well. Read more. [SQL server issues] Created
    Issue: AdventureWorksDW2012 Download file corrupt [19063].

  7. Ofelio - Search results for...techcent - 10 of 2 returned feed content.

    www.ofelio.com/preview?lang=en&url=/show?id=apifeed&search...
    1 Oct 2012 ... Favicon 3.Created Issue: AdventureWorksDW2012 Download file corrupt [19063]
    14 Dec 2012, 6:05 pm. There seams to be an issue with the ...

  8. Read more - t?m kiếm nhanh - SEO web | Chuy?n nghiệp

    timnhanh.thietkewebtl.com/?...Created%20Issue: %20AdventureWorksDW2012%20Download%20file%20corrupt%20%5B...

  9. download files are corrupt - Computing.Net

    www.computing.net/answers/.../download-files...corrupt/169500.html - Cached - Similar
    I use Windows 98 with a DSL modem, and for the last couple of days I have been
    having trouble downloading files. The internet itself works fine ...

[SQL Server] Advanced SQL Server 2008 Extended Events with Examples

  1. Advanced SQL Server 2008 Extended Events with Examples ...

    www.sqlteam.com/.../advanced-sql-server-2008-extended-events-with- examples - Similar
    25 May 2009 ... In the previous article we learned about SQL Server 2008 Extended Events
    terminology, components and took a look at a simple example.

  2. Introduction to SQL Server 2008 Extended Events - SQLTeam.com

    www.sqlteam.com/article/introduction-to-sql-server-2008-extended-events - Similar
    19 May 2009 ... Article Series Navigation: Introduction to SQL Server 2008 Extended Events,
    Advanced SQL Server 2008 Extended Events with Examples ...

  3. Using SQL Server 2008 Extended Events - TechNet - Microsoft

    technet.microsoft.com/en-us/library/dd822788(v=sql.100).aspx - Cached
    In SQL Server 2008, Extended Events data for wait events can be correlated ... be
    appropriate for standard release, to customers for advanced troubleshooting of ...

  4. SQL Server Extended Events - SQLskills.com

    www.sqlskills.com/blogs/paul/category/extended-events/ - Cached
    11 Jul 2011 ... Using the Extended Events mechanism for troubleshooting SQL Server.
  5. Getting Started with Extended Events in SQL Server 2012

    https://www.simple-talk.com/sql/.../getting-started-with-extended-events-in- sql-server-2012/ - Cached
    4 Feb 2013 ... Consequently, the Extended Events feature in SQL Server 2008 saw ... For
    example, in Figure 2, the query_post_execution_showplan event is ...

  6. Advanced SQL Server 2008 Extended Events with Examples ...

    www.sswug.org/nlread.asp?id=44795&d=6/8/2009&t=4
    8 Jun 2009 ... (Mladen Prajdi?) In the previous article we learned about SQL Server 2008
    Extended Events terminology, components and took a look at a ...

  7. How to monitor deadlock using extended events in SQL Server 2008 ...

    blogs.msdn.com/.../sqlserverfaq/.../an-in-depth-look-at-sql-server-memory- part-2.aspx - Cached
    26 Apr 2013 ... Before I talk about how to monitor the deadlocks let us have a small brief what is
    deadlock and how we were handling them in the previous ...

  8. SQL Server 2008 Extended Events SSMS Addin - Home

    extendedeventmanager.codeplex.com/ - Cached - Similar
    7 Aug 2009 ... Project Description. SQL 2008 Extended Events are a powerful new way of
    troubleshooting problems with SQL Server. One short coming is that ...

  9. Manual Extended Events Manager Install - SQL Server FineBuild ...

    sqlserverfinebuild.codeplex.com/wikipage?... Install%20Extended%20Events%20Manager - Cached
    SQL Server Extended Events are a powerful way of troubleshooting ... .com/
    article/advanced-sql-server-2008-extended-events-with-examples. Extended
    Events Manager can only be installed on SQL Server 2008 and SQL Server 2008
    R2.

  10. Getting Started with Extended Events in SQL Server 2008

    www.mssqltips.com/sqlservertip/.../getting-started-with-extended-events-in- sql-server-2008/ - Cached
    29 Oct 2010 ... Extended Events for SQL Server 2008 (and later versions) provides a ... In my first
    example, I am going to create an Extended Event session to ...

  11. Retrieving Deadlock Graphs with SQL Server 2008 Extended Events

    www.dnnsoftware.com/.../Retrieving-Deadlock-Graphs-with-SQL-Server- 2008-Extended-Events - Cached
    21 Sep 2011 ... SQL Server extended events (Extended Events) is a general ... has a few
    examples of accessing the system_health session sql 2008 extended ...

  12. Using XEvents (Extended Events) in SQL Server 2008 to detect ...

    msmvps.com/.../2008/.../using-xevents-extended-events-in-sql-server-2008- to-detect-which-queries-are-causing-page-splits.aspx - Cached - Similar
    7 Dec 2008 ... From http://msdn.microsoft.com/en-us/library/bb630354.aspx: SQL Server
    Extended Events (Extended Events) is a general event-handling ...

  13. Extended Events - SQL Server Blogs

    sqlblog.com/blogs/extended_events/ - Cached
    28 Mar 2012 ... Extended Events demos on Microsoft Virtual Academy ... Let's take a simple
    example, we might write a filter for wait_info such as: wait_type = ...

  14. SQLServerCentral: Articles tagged Extended Events

    www.sqlservercentral.com/articles/Extended+Events/
    Items 1 - 12 of 12 ... Getting Started with Extended Events in SQL Server 2012. Extended Events ...
    Advanced SQL Server 2008 Extended Events with Examples.

  15. SQL Server 2008 Advanced Troubleshooting with Extended Events ...

    www.cnblogs.com/lenoevo/archive/2008/12/24/1361026.html - Cached - Similar
    24 Dec 2008 ... Paul Randal demonstrates how you can use the new Extended Events
    functionality in SQL Server 2008 for monitoring and troubleshooting.

  16. SQL Server 2008 extended events using the Advanced ...

    www.ixwebhosting.mobi/2011/09/19/2241.html - Cached
    19 Sep 2011 ... SQL Server 2008 extended events using the Advanced Troubleshooting ...
    example, workload may change (such as the number of concurrent ...

  17. Querying Extended Events in SQL Server 2008 - Database ...

    dba.stackexchange.com/.../querying-extended-events-in-sql-server-2008 - Cached
    Querying Extended Events in SQL Server 2008 ... curve has been rough. Thank
    you in advance for your help. sql-server-2008 extended-events ...

  18. Locking in Microsoft SQL Server (Part 4 ? How to detect blocking ...

    aboutsqlserver.com/.../locking-in-microsoft-sql-server-part-4-how-to-detect- blocking/ - Cached
    26 May 2011 ... EXECUTE sp_configure 'show advanced options', 1 ... method to obtain blocked
    process report is using extended events (SQL Server 2008+).

  19. An Introduction to SQL Server 2008 Audit | Brad M McGehee

    bradmcgehee.com/2010/.../an-introduction-to-sql-server-2008-audit/ - Cached
    30 Mar 2010 ... Fast and Lightweight: SQL Server Audit uses SQL Server 2008′s Extended
    Events engine to capture audit data. This results in fast ...

  20. The Rambling DBA: SQL Server 2008 Extended Events - Reference ...

    jmkehayias.blogspot.com/2008/.../sql-server-2008-extended-events.html - Cached - Similar
    9 Dec 2008 ... SQL Server 2008 Extended Events - Reference List ... MSDN Webcast: SQL
    Server 2008 Advanced Troubleshooting with Extended Events ...

[Articles] Review Your Code

[Articles] Review Your Code


Review Your Code

Posted: 11 Aug 2013 11:00 PM PDT

Steve Jones notes that SQL Injection is still a problem, and while it might be for some time to come, we should not be adding to the issues. Learn how to write secure code.

[MS SQL Server] "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON")

[MS SQL Server] "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON")


"Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON")

Posted: 12 Aug 2013 01:49 AM PDT

I have a user who get this error when querying tables in another database from the same server.select * from AdOps.dbo.tblRCP_Source where name like '%american%egg%'and this is the error message: Msg 18456, Level 14, State 1, Line 1Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.If they run the command from the adops database the query works. I have dealt with this error when it comes to linked servers but this database is on the same server. It happens to and from any database on the server, not just adops. Thanks...

Database mirroring cannot be enabled while the database has offline files. Error 5003

Posted: 12 Aug 2013 01:38 AM PDT

Dear colleagues, need help!!!Set up mirroring between two servers A - principial, B - mirror:Created certificates, created endpoints for server instances using its certificate,created logins at units, created at B RESTORE DATABASE and RESTORE LOG with the WITH NORECOVERY.Run on the server BALTER DATABASE DBName SET PARTNER = 'TCP://110.110.10.15:5024'; GOThat's finished successfully. Run on the server AALTER DATABASE DBName SET PARTNER = 'TCP://110.110.10.16:5024'; GOgot the following error:"Msg 5003, Level 16, State 1, Line 1Database mirroring cannot be enabled while the database has offline files."Done it many times, the result is the same.Configuration: Windows Server 2003 SP2 at both servers, servers is not at domain.Principial SQL Server 2008, mirror SQL Server 2008R2. Returns are not planned. DB around 800Gb. Partitioned tables exists.Just for testing created test database on the server A, and restored it on Server B and turn on mirroring.It is well earned.The basic database can't be mirrored!Please prompt me, what is the reason for this behavior?Shortly before this, did this operation on the test servers with the same configuration,mirroring worked without problems.thanks.

log file growth on particular time

Posted: 11 Aug 2013 10:25 PM PDT

Hi Experts,How can i prove whether the file growth happened on particular time ? We had space crunch in tempdb and i killed a transaction which released enough space but is there any way that i can show that the log growth happened on this particular time?Thanks IN Advance.

Search This Blog