Forum Replies Created

Viewing 15 posts - 1 through 15 (of 254 total)

  • RE: Can't Restore DB Because of Active Connections

    Try to find all connections to your database:

    select d.name,

    p.*

    from sys.databases d join sys.sysprocesses p

    ...

  • RE: Check If user exists in SQL 2005

    sysobjects view does not contain users. Use this script:

    if exists (select * from sys.sysusers where name='test2')

    drop user test2

    GO

  • RE: Ordering on every row...excep the first row

    Yes you can do conditional sorting. For example, to put 'dunlap' at the top and sort all the rest values:

    select * from t1

    order by case

    when c1 <> 'dunlap' then c1...

  • RE: Windows 7 and SQL Server 2005 Standard

    Yes, here it is:

    ---------------------------------------------------------------------Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)

    Oct 14 2005 00:33:37

    Copyright (c) 1988-2005 Microsoft Corporation

    Standard Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

  • RE: Windows 7 and SQL Server 2005 Standard

    Thanks Lowel and Steve for your replies, but I am little bit confused.

    I have my SQL Server 2005 Standard Edition (and it is properly licenced) installed on my home...

  • RE: When database was restored?

    Thanks a lot. This is exactly what I needed.

  • RE: SSMS settings

    Yes, I use that drop-down, but I want to change it permanantly.

  • RE: Question about partition function

    Yes, I will use ALTER PARTITION FUNCTION.

  • RE: Question about partition function

    Thanks, John. sys.partition_range_values is what I wanted.

  • RE: Need help with a while and cursor

    When I pasted my code, this site changed removed all my brackets. I replaced them with quotes (") here.

    Here is the code:

    1. Alter "your_large_table" add surrogate_key not null int identity(1,1);

    2....

  • RE: Need help with a while and cursor

    I think you can do it without looping through while/cursor. But you need to alter both details and lookup table.

    Here is what I suggest:

    1. Alter "your_large_table" add surrogate_key not...

  • RE: Need help with a while and cursor

    I think you can do it without looping through while/cursor. But you need to alter both details and lookup table.

    Here is what I suggest:

    1. Alter add surrogate_key...

  • RE: TEMPDB cannot Shrink

    You can query sys.dm_db_session_space_usage system view.

    It will show you number of pages allocated per each SPID in tempdb. Going from there, you can get the largest SPIDs are doing...

  • RE: Error Message

    Did you receive this error as a response to what ? Did you get it from SSMS or from your runninng application ? It is possible that developers used this...

  • RE: spaceused

    If your system is 2005 you can also use this:

    select

    num = row_number() over (order by sum(f.size)*8/1024 desc),

    database_name = left(d.name,30),

    ...

Viewing 15 posts - 1 through 15 (of 254 total)