Forum Replies Created

Viewing 15 posts - 316 through 330 (of 582 total)

  • RE: date difference between rows

    using some code found on stackoverflow you can try this.

    create table #temp1

    (

    [aId] [char](9) NOT NULL,

    [dtDate] [datetime] NOT NULL

    )

    insert into #temp1 values ('001','2012-08-30 00:00:00.000')

    insert into #temp1 values ('001','2012-08-31 00:00:00.000')

    insert into #temp1...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Check SQL Version

    you can take the variable out of it and just have the check for version in the If clause

    IF (CONVERT(int, SUBSTRING(CONVERT(varchar(15), SERVERPROPERTY('productversion')), 0, CHARINDEX('.', CONVERT(varchar(15), SERVERPROPERTY('productversion'))))) < 10)

    BEGIN

    RAISERROR('Youc an only...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Cumulative Update #7 fails

    if you haven't found an answer yet may this will work.(http://blogs.msdn.com/b/karthick_pk/archive/2012/07/16/the-process-cannot-access-the-file-c-windows-system32-perf-mssql10-50-mssqlserver-sqlagtctr-dll-because-it-is-being-used-by-another-process.aspx)

    I have had the same issues with CU2 for SQL Server 2008 R2 SP2. Haven't test the fix yet...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Need the Best Solution for splitting into batches

    would just adding a group by to your final statement get desired results

    SELECT Batch1,Batch2,Batch3 FROM #SplitBatches

    GROUP BY Batch1,Batch2,Batch3

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: How to find a Query in all stored procedure

    you could replace all spaces with wildcards

    SELECT o.name

    FROM sys.sql_modules m

    JOIN sys.objects o ON m.object_id = o.object_id

    where definition like replace('%select * from table1 where id=5%',' ','%')

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: How to find a Query in all stored procedure

    you can also use the sys.sql_modules view.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Upgrade from SQL 2005 to SQL 2008

    might be worth reading through this. http://www.microsoft.com/en-us/download/details.aspx?id=15220.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: SQL 2008 Reporting Service without IIS

    You can install SSRS stand alone with the Reporting server databases on a different serve and without IIS. I have two SSRS instances configured like this.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: sys.dm_exec_query_plan question

    Thanks alot. I guess my google skills were weak today.:blush:

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Transaction Logs Initial Size

    try running these commands

    SELECT name,log_reuse_wait_desc

    FROM sys.databases

    DBCC loginfo

    DBCC SQLPERF (logspace)

    they will if you log reuse is waiting on something, you have many VLFs, or lots of unused space on the transaction...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Login User mapping related issue

    If there is not a login Mike should not be able to connect to the server. In SQL server 2012 there is a new feature called contained databases which allow...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Login User mapping related issue

    you will need to create logins and map them to your current users or create new users.

    http://msdn.microsoft.com/en-us/library/aa337552

    The reason you have users in a database and no associated logins could...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Update statistics

    check for blocking while any of the processes (SP, dbcc, stats) is running. you can use this to identify any blocking SPIDs.

    SELECT s.session_id AS spid

    ,s.[status]

    ,s.login_name AS...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Dynamic field names on a cross tab report

    instead of dynamically assigning column names, statically figure out the day of the week with datepart.

    SELECT

    SUM(CASE WHEN DATEPART(weekday,datestamp) = 1 THEN TimeTaken ELSE 0 END) AS Sunday,

    SUM(CASE WHEN DATEPART(weekday,datestamp)...

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • RE: Help with join types/usage

    a cross join should accomplish what you want(http://msdn.microsoft.com/en-us/library/ms190690%28v=sql.105%29.aspx)

    here is an example

    CREATE TABLE #foo(id INT)

    INSERT INTO #foo(id)

    VALUES(1),(2),(3)

    SELECT a.id,b.id

    FROM #foo a

    CROSS JOIN foo b

    WHERE a.id <> b.id

    DROP TABLE #foo

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

Viewing 15 posts - 316 through 330 (of 582 total)