Forum Replies Created

Viewing 15 posts - 121 through 135 (of 254 total)

  • RE: Date Calculations

    declare

    @date smalldatetime,

    @days int

    set @date = '07/16/1998'

    select

    @days = datediff(dd, @date, getdate())

    print

    cast(

  • RE: HOw do I get a user count?

    Bob,

    I may be wrong, but as far as I know server permissions are granted to logins, not to procedures. In your case he will have to grant VIEW SERVER STATE...

  • RE: HOw do I get a user count?

    use master

    grant view server state to your_non_sa_user

    go

  • RE: Select data as columns

    You may try to use pivot feature :

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/extran9/html/55f5db6e-6777-435f-8a06-b68c129f8437.htm

  • RE: No database context

    In order to find out more useful information about your deadlocks at the moment they occur, create 3 alerts for error numbers 1205 ( SPID # was deadlocked), 3928 (transaction...

  • RE: HOw do I get a user count?

    This is right query (except that you don't have to group it by database sinse you restrict it in your Where clause).

    If you don't want to grant sa role, you...

  • RE: Help required urgently cleaning a database

    Yes, and if db is huge he has to create 3 dynamic scripts:

    1. Disable FKs

    2. Truncate tables

    3. Enable FKs

    If to properly write these scripts, executing them in a batch will...

  • RE: char or nchar ?

    Yes, that's between char or nchar (or English and International). I've also noticed that some replyes were about (n)char and (n)varchar, but that's not a problem.

    If the difference only about...

  • RE: SQL Stored Procedure - From Insert to Update

    update PollResults

    set  Rating  = @Rating,

     Weight  = @Weight

    WHERE

     UserID   = @user-id

     AND CustomerID  = @CustomerID

     AND PollOptionID= @PollOptionID;

    update  PollComments

    set  PollComment  = @PollComment,

     IsAnon  = @IsAnon

    where  PollResultID  = @PollResultID;

  • RE: Help required urgently cleaning a database

    Clean means what ?

    Empty database without any objects? In this case:

    1. Generate database creation script including all data and log files and secutity objects.

    2. Drop existing database

    3. Run script generated...

  • RE: How to script objects separately ?

    No problem, you did not offend me.

    So it looks like I have to "upgrade" from Enterprice to Standard edition ?

    And on what screen this option should be, on...

  • RE: Sysprocesses monitoring

    You can also use SQL Server profiler. You can choose security audit/ audit login event and filter it to Loginname=sa.

  • Viewing 15 posts - 121 through 135 (of 254 total)