Forum Replies Created

Viewing 15 posts - 511 through 525 (of 529 total)

  • RE: DB design; what is wrong?

    For your question with user permissions, I am not sure how you should solve that.

    Your solution using the session object is one possibility (probably the simplest).

    Another possibility I can think...

  • RE: DB design; what is wrong?

    App looks good.

    You shouldn't worry about the performance of the queries. One of the apps we have built (in ASP) is using a 'filter' function on at least 15 fields....

  • RE: URGENT - moving tempdb

    To put a database in single user mode use the query analyzer.

    ALTER DATABASE tempdb

    SET SINGLE_USER

    To put it back in normal mode use

    ALTER DATABASE tempdb

    SET...

  • RE: DB design; what is wrong?

    Hi,

    Difficult to grasp the ideas behind your design completely. I guess your biggest problem is the 'multiple answers for one request'.

    If I understand it correctly, you add records to the...

  • RE: multiple columns and IN

    I don't believe you can do this using the IN syntax. Two possibilities exist :

    1. try 'concatenating' the two values of your PK in a single value. For strings, it...

  • RE: resultset merging

    Simplest solution is probably a cursor loop , but below you can find a set-based approach.

    This solution uses only a single temptable. Probably just a starting point...

  • RE: breaking out repeating groups

    You could use a construct like the following, extending the UNION subquery to all the different types.

    select p1.user_name, case p2.type when 1 then 'Puller' when 2 then 'Stocker' end

    from persons...

  • RE: Calling a stored procedure within a cursor loop

    Again, too late for a solution, however the cause of your problem could be found in the fact that the @@fetch_status is not checked after the FETCH statement.

    From BOL :

    "Because...

  • RE: Slow SQL 2000 performace over SQL7

    In SQL2K there is a table scan on the 'sitesecurity' table, whereas in SQL7 it's a seek.

    I do not know what the exact cause is (let alone the solution), but...

  • RE: Stored Proc Question

    Use WITH ENCRYPTION when creating the stored procedure.

    Just check the syntax of 'CREATE PROCEDURE' in BOL.

  • RE: Calculate SUM of time durations in hh:mm:ss format

    Try using the following function to calculate the duration (in seconds). timechar is the column holding the duration in the 'hh:mm:ss' format.

    DATEDIFF(second, '00:00:00', timechar)

    You can easily sum the result...

  • RE: Last Day of the Month

    Following line returns the last day of the current month as a datetime

    DATEADD(day, -1,

    cast(MONTH(DATEADD(month,1,getdate())) as varchar)

    +'/01/'

    + cast(YEAR(DATEADD(month,1,getdate ())) as varchar)

    )

    First...

  • RE: Scheduling an application stored procedure

    Just create a new job, and add a single step.

    Set the step to type 'Transact-SQL Script' and add as command 'exec <the_name_of_the_procedure>', like you would do when running the user...

  • RE: For T-SQL Guru

    This is a short piece of T-SQL I read here some time ago. I tried to reproduce it quickly from memory. It is not perfect, but it might set you...

  • RE: Strategy? Performing UNIONs, etc., on 10+ dbs...

    If the aggregated DB has to be kept up to date in real-time, you could use triggers on the segregated DB's on every action. Should work fine, provided there aren't...

Viewing 15 posts - 511 through 525 (of 529 total)