Forum Replies Created

Viewing 15 posts - 466 through 480 (of 684 total)

  • RE: Primary key Violation Error In Cursor

    Hi Rama,

    You can use the procedure, sp_msforeachtable. In fact, you can probably use it in place of your cursor.

    declare @cmd nvarchar(4000)

    --disable all table constraints

    exec sp_msforeachtable 'alter table ? nocheck...

  • RE: Restore records

    You'll have to restore the backup from a week ago to another database. Find the records that were deleted and insert them into the table in the original database.

    Hope...

  • RE: Multiple result sets

    If what you want to do is insert the resultset of stored procedure into a table you could do:

    insert into #mytable

    exec server.database.dbo.sp_call

    What you cannot do is treat it as...

  • RE: Multiple result sets

    Ah, I see.

    Do you have to use OPENQUERY? I'm assuming you've got a linked server set up, in which case can't you execute the stored procedure with four-part naming?

    exec...

  • RE: Multiple result sets

    I've tried to use a temp table with openquery and it works fine for me.

    I just did:

    insert into #mytemp

    select * from openquery (server, 'exec sp_help')

    And that worked fine. I'm...

  • RE: Multiple result sets

    You'd need to use a temp table or table variable. Is there any reason why you don't want to use one?

    I must admit that the use of a While...

  • RE: SQL 2K5 installe with SQL 2000 on same OS?

    Yes,

    Both instances can be running at the same time.

  • RE: SQL 2K5 installe with SQL 2000 on same OS?

    Hi,

    this is possible. You just install SQL 2005 and set it up as a seperate instance. That's all there is to it.

  • RE: Duplicate tables...

    Hi Carl,

    When you create the tables you can create them by explicitly stating that you want the dbo user to be its owner. So, if you want to create...

  • RE: stored procedure vs view

    Hi,

    I'd advise that you use stored procedures - for a variety of reasons.

    Essentially, by using stored procedures you can more effectively handle security, network traffic is reduced, execution plan is...

  • RE: Indexes that will not defrag -

    Hi Randy,

    How big are the tables? If there are few rows in the table then the fragmentation level can appear to be high. With small tables though the...

  • RE: Composite primary key autoincrement from 1

    Hi Nick,

    I'm not sure I understand your question. If you're going to use an identity column then you don't need to worry about selecting the MAX(OrderLineId) - it's done...

  • RE: How to know procedure called by which SQL Job?

    Mahesh, try this:

    declare @proc_name sysname

    set @proc_name = 'enter proc name in here'

    select j.name as job_name

    from msdb..sysjobs j

    join msdb..sysjobsteps s on s.job_id = j.job_id

    where command like '%' + @proc_name + '%'

    hope...

  • RE: How to know which user is having Exec permissions on my procedure?

    Mahesh,

    Use the system proc, sp_helprotect:

    exec sp_helprotect 'dbo.MyProc'

  • RE: SQL Source Safe

    Hi,

    Unfortunately, this is the case with all source control - even with source control for regular files. There is nothing to stop a developer updating the file outside of...

Viewing 15 posts - 466 through 480 (of 684 total)