Forum Replies Created

Viewing 15 posts - 541 through 555 (of 691 total)

  • RE: Import Question

    To expand on Indu Jakhar's response, in order to eliminate non-numerics -

    create table #t1 (a int)

    create table #t2 (b varchar(2))

    insert into #t2 select 1

    insert into #t2 select 'a'

    insert into #t2...

  • RE: can i specify optional parameters in stored proc

    Sure you can!  Just set default values, and execute the procedure sending the parameters by name. 

    CREATE PROCEDURE Parm_Example

     @Parm1 varchar(100) = NULL,

     @Parm2 varchar(4000) = 'Parm2 value',

     @Parm3 varchar(100)= 'Parm3 value',

     @Parm4 varchar(100) =...

  • RE: Query Help

    Looks to me like you've got a great solution!

    Steve

  • RE: sp_executesql with large query Str

    If EXECUTE converts to unicode under the hood, it apparently doesn't have the maximum characters restriction that sp_executesql does.  If it did, sqlSushi's query wouldn't have worked!

    Steve

  • RE: Transaction log will not shrink

    To take what SQLBill said a step further, you can force the inactive portions to the end.  I don't remember where I found this stored procedure.  It may have been...

  • RE: xp_cmdshell...echo... generates several files instead of 1

    I have a number of jobs which perform file operations via xp_cmdshell and have never experienced anything like this.  I would suggest that you take a long, hard look at...

  • RE: sp_executesql with large query Str

    You could use 'EXECUTE', which doesn't have to be nvarchar.

    Steve

  • RE: Indexes

    dbcc showcontig will show you all the indexes, and even which ones should be rebuilt.  Based on the results of showcontig, you can then use dbcc dbreindex or dbcc indexdefrag...

  • RE: Help coverting varchar to date-time

    create table #test (#char varchar(10), #date smalldatetime)

    insert #test (#char)

     values ('1/1/2000')

    insert #test (#char)

     values ('2/2/2000')

    insert #test (#char)

     values ('3/3/2000')

    update #test

     set #date = cast(#char as datetime)

    select * from #test

    drop table #test

    Something else to consider...

  • RE: Copy and Paste rows into table in Enterprise Mgr?

    I'm not sure, but the import data wizard works quite well.  Right click on the table, select all tasks, then import data.

    Steve

  • RE: Table Reference In Query

    Like this???

    Select SX.Status

     From StatusXref SX

     join ITRegInfo ITRI

     on SX.StatusId = ITRI.Status

    Steve

  • RE: Cant drop user - Help!!

    Make sure the user isn't defined as an owner of any objects in the database.  If so, execute sp_changeobjectowner 'object_name', 'new_owner' to change the owner to a valid database user,...

  • RE: How to handle ¦ character in query

    Given your example,

    declare @column varchar(20)

    set @column = 'FOOD\r¦ BOX 2'

    select  ascii(substring(@column, 7, 1))

    -- or --

    select ascii(substring(column_name, 7, 1))

     from my_table

     where -- other record identifying stuff here

     

    Good luck!

    Steve

  • RE: Transaction log not truncated on backup

    A full database backup does not truncate the transaction log.  Log truncates only occur when a transaction log backup is done.  The alternative would be to set the recovery model...

  • RE: DBCC Showcontig results

    I have a stored procedure which does exactly what you are looking for, plus reindexing based on scandensity, and a "factor" based on number of pages.

    I can post it if...

Viewing 15 posts - 541 through 555 (of 691 total)