Forum Replies Created

Viewing 15 posts - 841 through 855 (of 907 total)

  • RE: help with stored procedure

    Print out your dynamice sql string just prior to having it executed. Take that string and try to run it in QA. Sound like your dynamic SQL is...

  • RE: Changing IP Addresses

    That's what I thought, just wanted to confirm. Thank you for the information.

    -------------------------

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

  • RE: Data file full

    Straight from BOL (see below). Also if I remember correctly you can drop the clustered index, and then recreate it on the new filegroup. This will move the...

  • RE: help with stored procedure

    Here is one that is works a little better:

    ALTER procedure proc_name

    @name as char(30),

    @address as char(30),

    @date datetime

    as

    declare @cmd varchar(100)

    set @cmd = 'insert into mytable ' +

    ...

  • RE: help with stored procedure

    You need to build some dynamic sql. Try something like this:

    create procedure proc_name

    @name as char(30)

    @address as char(30)

    @date datetime

    as

    declare @cmd varchar(100)

    set @cmd = 'insert into mytable ' +

    ...

  • RE: Global Variables

    One way to accomplish this is to create dynamic sql that is sets a local variable via sp_executesql using the out parm, then use that variable in the next dynamic...

  • RE: Name of current database?

    See I told you there was an easier way, then my method. Thanks Diane

    -------------------------

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

  • RE: Name of current database?

    Here is one way but not very simple. I'm guessing there is an easier way:

    -- What is the database name?????

    create table #tmp_sfs (

    fileid int,

    filegroup int,

    ...

  • RE: Who Is Running The Query ?

    Provided the user is running the select query as part of some batch of code, like a SP, then you could use something like this to capture the user connection...

  • RE: Auditing Tables (What to do?)

    Possible Log Explore by Lumigent might work for you. I have not used the tool, but I'm sure someone might know whether it can do what you are asking....

  • RE: Vchar to date time conversion

    This example worked for me. I'm wondering what value you might have in your varchar(12) column. Would you send a couple of values that don't work?

    declare @date_closed_date as...

  • RE: checking dependent objects before execution

    Here is a recursive procedure I wrote to calculate a factorial. You might be able to try something like this:

    http://www.geocities.com/sqlserverexamples/#math1

    -------------------------

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check...

  • RE: Changing IP Addresses

    From this thread looks like there are no worries about changing IP address for W2K servers, what about 7.0 servers?

    We are moving to a new building and will need to...

  • RE: delete duplicates

    Here is an example that will do that:

    -- this example shows a method to get rid of duplicates in a table

    create table temp_table (a char(1))

    insert into temp_table values('a')

    insert into temp_table...

  • RE: insert fails with primary key constraint

    Possibly then you could try something like this:

    Create table yyy(x char(1), y char(1), z char(1)

    primary key (x,y))

    create table ddd(x char(1), y char(1), z char(1))

    insert into yyy values('A','B','C')

    insert into ddd...

Viewing 15 posts - 841 through 855 (of 907 total)