Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)

  • RE: Easily delete database objects

    That's a useful SP!

    To give it extra benefit you could add some checking for constraints on the object (e.g. FK on the table to be dropped) and add an option...

  • RE: tricky question... getting the job name to appear in the job step.

    I also had some difficulty finding the solution to this problem, not helped by [JOBID] only working in SQL 2000, not in SQL 2005.

    See link (http://msdn2.microsoft.com/en-us/library/ms175575.aspx or search for 'Using...

  • RE: Source Control in SQL Server

    I agree with Noel wholeheartedly, the lack of alphabetical sorting is extremely annoying and wastes precious time.

    However I much prefer to have source control integrated into the 1 piece of s/w...

  • RE: Setting up job that runs on all databases

    Alternatively you could use dynamic SQL to set the DB and also execute the SP. You'd need to exec the SP in the same context as the DB you've specified...

  • RE: SQL Server equivalent of Oracle''''s "MINUS" operator?

    Response to stax - some nice code there!

    Just for completeness I've got a set version of the penumbra, although it seems to be a bit more expensive to execute:-

  • RE: Complex Computed Columns

    It was an interesting article, but I don't see why you would store the logic for the calculation in the table definition rather than in the SQL you use to...

  • RE: Import from text file problem

    To list the names of files in a directory you can use the 'dir' command. Execute it using xp_cmdshell.

    There might be an extended procedure to do it for you too....

  • RE: bulk insert error

    I think it's actually a double quote that's missing. Try this:-

    set @cad='BULK INSERT webmisco.dbo.wr_primero FROM ''d:\transferencia$\web\reports\'+@Fichero+' with (DATAFILETYPE = ''char'', FIELDTERMINATOR = '','',CODEPAGE=''850'')'

    should be

    set @cad='BULK INSERT webmisco.dbo.wr_primero FROM ''d:\transferencia$\web\reports\'+@Fichero+'"...

  • RE: Double Update

    Why not try something like this, it uses 2 updates but doesn't require a select to get the value of nextticket from #ytable:-

     

    CREATE TABLE #xtable (ticket int)

    CREATE TABLE #ytable (nextticket...

  • RE: Changing "Order By" in a stored procedure

    Why not just use different code for each known sort param, e.g.

    Declare @SortOrder as varchar(10)

    Set @SortOrder = 'myString'
    IF @SortOrder = 'My_ID'
    Select My_ID_Int, My_Date, My_String
    From MyTable
    Order By My_ID_Int
    ELSE IF @SortOrder =...
  • RE: ADO.Net executing Stored Procedure containing dynamic SQL

    This may not be a problem but have you tried executing an SP that does not have spaces in the name?

    I know the [square brackets] should allow spaces to be...

  • RE: Using Triggers

    Ok guys, this might seem like a strange question but how about creating an SP with a lot more logic that retrieves data from a smaller subset of tables in...

  • RE: Save Your Stored Procedures

    Just a warning note about the EXCLUDE list - you should probably add start and end delimiters to your excluded DB names to prevent a custom DB called My_master being...

  • RE: DTS for delete and insert in SQL Tables

    Alternatively, once you've unzipped the file containing SQL statements you can load them into a temp table with a single field using a BULK INSERT command (look in BOL).

    Then process each...

  • RE: help on ODS!!!

    You could try looking at the sp_addtrace and related system s procs.

    These will let you save info on queries, in a similar way to profiler does but more flexibly, to a...

Viewing 15 posts - 1 through 15 (of 19 total)