Practical SQL Server

  • SQL Server 2008 CTP Available

    Today the first publicly available CTP for the next version of SQL Server was released.  It will be called SQL Server 2008, it was formerly known by its codename - Katmai. 

     You can download the CTP here:  https://connect.microsoft.com/sqlserver?wa=wsignin1.0

    You can also see a webcast by David Campbel here:  http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032341071&EventCategory=2&culture=en-US&CountryCode=US.

    Enjoy!

     

    Reed

  • Sharing a printer connected to an XP machine with a remote Vista machine

    I know this has nothing to do with SQL Server, but I wanted to put it out ther and hope it helps someone, somewhere.

    If you are like me and you disabled the UAC prompts when you installed Vista, and then you try to add a network printer (in my case the printer was connected to an XP desktop) you get a "Print Monitor Unknown" error.  The way to get around this is to re-enable the UAC, then you will get a prompt for the drivers, and then they install.  Viola!

    Hope this helps!

    Reed

  • Management Studio Timeout Issues

    Timeouts are a real pain, and I was helping someone debug their problems and found this useful info, its from Andy on the SQL Server newsgroups:

    A couple of other possibilities worth checking.
     
    In Object Explorer right click on the SQL Server 2005 instance select Properties. I am assuming that you may be attempting to connect remotely.
     
    On the Connections tab check the value of Remote_query timeout.
     
    On the Advanced tab check the value of Remote Login Timeout.
     
    Hope this helps!
    Reed
  • Full Text Search using a column that contains a list of keywords

    Apparently I am the first person on the Internet to need to do this, which I find hard to believe, but I couldn’t find anything about this, so I had to make a solution myself.  The problem I was trying to solve was this:  I have a table with a column, and I want to search that column for keywords. 

    No problem, that’s what Full Text Indexes do.  However, I didn’t want to just search for one static word, or a list of static words.  I wanted to search for a list of keywords that I was storing in a column in a different table.

    I could not find any way to dynamically pass a to a Full Text Query results from another query, which would have been really easy.   Instead, I had to create a list, enclosed in double quotes (“”) and separated by commas (,) from my table containing my keyword list.  I made this list into a variable and then passed that variable to the “CONTAINS” query I wrote.  Viola!  It worked. 

    This is the sample code I used:

    DECLARE @TermList varchar(100)

     

    SELECT @TermList = COALESCE(@TermList + '", ', '') + '"' +

     term

    FROM dbo.term

     

    select * from dbo.calls where

    FREETEXT ([Subject],@TermList)

     

    Where @TermList  is the variable I created to hold my list of terms, the “term” column in dbo.term is the column containing all my keywords, and the dbo.calls table has the “subject” column that I want to look in to find matches.


    Hope this helps somebody!

    Reed

  • Philadelphia SQL Server User Group Meeting

    If you are in the Philadelphia area and want to attend the Philadelphia SQL Server User Group meeting, you'll find all the details below.  I can't be there this month, but have fun without me.

     -Reed

     

    October PSSUG Meeting

    October 11th, 2006

    MicroEndeavors

    8001 Lansdowne Avenue

    Upper Darby, PA  19082

    Directions: http://www.microendeavors.com/directions.htm

     

    Welcome the crisp fall days of October with our Speaker Contest winners! Instead of one long keynote, we will have four short user

    presentations. Our speaker contest winners are

                Bart Hirst -- Practical SQL Server 2000 to 2005 Migration Tips

                Mike Metcalfe -- SQL Server Funeral Services

                Mike Welsh -- SQL Server 2005 Performance Monitor New Features

     

    Vince Napoli will also present one of his Tips and Tricks Series:  Looking at SQL Server 2005 TSQL enhancements -- using the OUTPUT clause to make your life easier.

     

    Our meeting is sponsored by CA XOSoft. Josh Mazgelis, a senior Systems Engineer at CA XOSoft, will present a session titled Disaster Recovery / High Availability for SQL.

    Abstract: How do the new SQL Server 2005 high-availability features factor into your business continuity planning?

    This session will provide a real-world perspective on the improvements and to understand where you may still need protection.

    Does your SQL environment require a bandwidth-optimized, full compression, high-availability solution? View walkthrough demo of

    CA XOsoft's SQL high-availability product with asynchronous automatic failover and failback capabilities. Also featured will be our

    disaster recovery testing capabilities that perform fully automated, scheduled tests that validate the replica server environment.

    CA XOsoft's rewind technology (built in CDP), which provides the ability to quickly roll back data to any point in time, accelerating

    time to recovery with minimal data loss, will be shown as well.

     

    There is no charge for the meeting, but you must register at www.pssug.org.

     

    Dress code: Geek chic.

     

    Upcoming meetings:

                November 8th. Sponsor: PCTI.  Speaker: Chuck Urwiler – “Data Dude” (aka Visual Studio Team Edition for Database Professionals). Venue TBD.

                December 13th. Speaker: Joe Toscano. Sponsor and venue TBD.

     

  • How to remotely execute an SSIS package

    There is a lot of confusion around SSIS and how and when you can execute packages, so hopefully I can help clear this up.

    If you just have the SQL Server management tools on your desktop (Management Studio and Business Intelligence Development Studio aka. BIDS) then you can build a package in BIDS and run it there, but you can’t deploy to your local machine and execute there.  You need SSIS installed on a machine to execute a package.

    That doesn’t mean you can’t call SSIS packages from a job server that doesn’t have SQL Server on it, however.

    In order to do this you need to put your SSIS package into a job on the SQL Server box.  You don't have to schedule the job, you just need to create a job step that will execute your package.

     

    Once that is done, we can call that job from any machine.  We don't need the SSIS components in order to do this.

     

    The code I tested goes as follows.  I created a query to kick off my job and saved it in text file called query.txt - the query looks like this:

     

    USE MSDB

    GO

    EXEC sp_start_job @job_name = 'TestPlan', @server_name = 'Pashllfixit\SS2K5'

    GO

     

    Then I wrote a little command to call osql.exe on the SQL Server and execute the command.  I can run this from any cmd.exe on any server: 

    "\\pashllfixit\c$\Program Files\Microsoft SQL Server\80\Tools\Binn\osql.exe" -E -Spashllfixit\ss2k5 -iC:\query.txt

     

    And it will execute my SSIS package and we are done.

     

    This will allow you to use SSIS without installing any SQL Server components on your job server. 

     

    Hope this helps!

     

    -Reed

     

  • Custom Code in Reporting Services Reports

    If you like to write custom code and Reporting Services doesn't do something you want it to, then you can  write custom code to make it do whatever you want.  Find out how here:  http://msdn2.microsoft.com/en-us/library/ms155798.aspx.

     

    -Reed

  • How to Troubleshoot SQL Server 2000 Performance Problems

    If you are having trouble performance tuning SQL Server 2000, there is one whitepaper you need.  It’s called “SQL Performance Tuning using Waits and Queues” and it’s written by Tom Davidson.  It takes the guesswork and voodoo out of tuning. 

     

    The way it work is you run a stored procedure (it’s in the whitepaper) and it finds out what SQL Server is waiting on, which gives you a feel for where you need to focus your efforts to tune SQL Server.

     

    I highly recommend reading this paper and using it to help if you are having performance problems with SQL Server 2000.

     

    For an awesome example of how this would work, check out the SQLCAT blog here:  http://blogs.msdn.com/sqlcat/archive/2005/09/05/461199.aspx.

     

    You can find the script itself in this presentation:  http://www.sqldev.net/events.htm#SQL_Connections_12-15_October_2003,_Palm_Springs_CA_ ( it’s this one:  SPR201 - 4 - Performance Tuning - Using Waits & Queues.zip)

     

    And the table to help you determine what to do is here:  http://www.sqlmag.com/Files/09/40925/Webtable_01.doc

     

    The whole thing joined together is available from SQL Server Magazine, but you need a subscription to access it.


    -Reed

  • How to create an XML config file for an SSIS package (SQL Server 2005 Integration Services)

    Being able to have a config file for your packages is one of the huge improvements in SSIS over DTS.  However, it’s a little hidden and the Books Online are absolutely no help here, which is unusual because they are pretty good on most stuff. 

     

    If you want to add an XML config file you need to go to the top toolbar and choose SSIS -> Package Configurations… and then choose Add to create a new config file.  If it’s not already selected you’ll have to choose “Enable Package Configurations” first.

     

    Then you can choose what you want to add to the configurations – variables and connections are the two most popular ones.  Then it will create and XML file in the destination you specify with the configurations you’ve chosen.  You can edit them in a text file or have multiple versions that you can swap out as you choose, or specify at runtime which config file to use.

     

    For a good walkthrough, you can visit:  http://www.sqlis.com/default.aspx?26.

     

    Reed

     

  • How to Write to Office SharePoint Server 2007 (MOSS 2007) from SSIS

    If you are not a SharePoint Admin (I am not) but need to interact with MOSS 2007 and SSIS, this guide should walk you through the basics.

     

    First, and this is the most important part,  you must enable a service on the Windows Server 2003 box.   The service is WebClient – enable it, then set it to autostart.

     

    Now, Open up SharePoint and Navigate to your Document Library – I am using the MOSS 2007 VPC so mine is: http://moss.litwareinc.com/SiteDirectory/EDTDocs/Shared%20Documents/Forms/AllItems.aspx.

     

    Now you have 2 choices, you can map a drive (  net use * "\\moss.litwareinc.com\SiteDirectory\EDTDocs\Shared Documents" will do the trick for that.)  Or you can address it as a UNC Path like this:   \\moss.litwareinc.com\SiteDirectory\EDTDocs\Shared Documents.

     

    Now, when you have a file destination in SSIS you can make it your mapped drive or the UNC path.

     

    I hope this helps someone; it took me days to get this right.

  • Welcome to Practical SQL Server!

    Welcome to Practical SQL Server.  The idea behind this blog is to try to put as much of the awesome informatio about SQL Server that is scattered all over the place in one easy to use location.  As whitepapers and case studies and other useful documents are published by Microsoft, I will post them here.

    In addition, as I run into common questions or problems I will try to post answers/tips/tricks here to make them easy to find.

    Thanks!

    Reed


© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker