Forum Replies Created

Viewing 15 posts - 211 through 225 (of 907 total)

  • RE: Identifying other SQL Server Machines on Network.

    Thanks for the suggestions, I ended up using DMO, via TSQL. Here is my hack, if you are interested.

    Declare @rc int

    DECLARE @object int

    declare @Output varchar(255)

    Declare @Method varchar(255)

    DECLARE @src varchar(255)

    Declare...

    Gregory A. Larsen, MVP

  • RE: xp_readerrorlog

    In case you are interested I answered my own question. Here is my solution. Came to me as I when to get something out of the vending machines....

    Gregory A. Larsen, MVP

  • RE: xp_readerrorlog

    Maybe I don't make myself total clear. What I want is to have is a complete error messages as a single column. So basically you need to concatinate...

    Gregory A. Larsen, MVP

  • RE: query

    How about something like this (not tested):

    SELECT DISTINCT

    a.JobId,

    a.fromstoreId,

    b.storeName,

    a.toStoreId,

    c.storeName

    FROM tblJob a,

    tblStore b,

    tblstore c,

    tblClient cl

    WHERE

    AND cl.clientId = b.clientId

    AND a.fromstoreId = b.storeId

    and a.tostoreid = c.storeid

    AND a.toStoreId <>...

    Gregory A. Larsen, MVP

  • RE: Return First Record of each group

    You have the sub-query a little wrong, thought you wanted one by event_date. Try this:

    select a.* from (select p.people_id, p.last_name, p.first_name,

    c.cases_id as casesid,

    ep.start_date,

    st.site_id, st.site_name as PfizerSiteName,

    ev.event_id,...

    Gregory A. Larsen, MVP

  • RE: subtraction

    You could add an id field to each table like this, so you could do the join.

    create table aaa (a1 int)

    create table bbb (b1 int)

    insert into aaa values (6)

    insert into...

    Gregory A. Larsen, MVP

  • RE: Return First Record of each group

    You might try a correlated sub query like this:

    select * from Northwind.dbo.[Order Details] a

    where

    ProductId = (select top 1 productid from Northwind.dbo.[Order Details]

    ...

    Gregory A. Larsen, MVP

  • RE: Moving entire SQL content to new server.

    I always do logins first. I use sp_help_revlogin to accomplish the moving of logins. More info here about sp_help_revlogin

    http://www.databasejournal.com/features/mssql/article.php/2228611

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check...

    Gregory A. Larsen, MVP

  • RE: Find second highest

    Jeremy, hopefully jpipes and DavidBurrows answered your question. If not let me know.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • RE: Moving entire SQL content to new server.

    use xp_help_revlogin. You can find a copy here:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;246133

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • RE: Calculating Averages and Totals Between Dates

    You might consider looking into using the DATAPART function and summing and averaging on the WEEK datepart.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at...

    Gregory A. Larsen, MVP

  • RE: Find second highest

    Here is an example that shows the 76th highest salary. You might be able to do something like this with dynamic SQL to change the 76 to some N...

    Gregory A. Larsen, MVP

  • RE: Database Compare

    I use SQLCompare. Think you can download a trial copy. If you like it I would buy it. It is a great tool for a number of...

    Gregory A. Larsen, MVP

  • RE: sql server log

    I'm not so quick to agree. We logging all successful logins, as well as unsuccesful logins. One reason we do this is to audit logins to see when...

    Gregory A. Larsen, MVP

  • RE: CPU loop in SQL Server 7.0

    We have in the past gone a number of months between reboots.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 15 posts - 211 through 225 (of 907 total)