Forum Replies Created

Viewing 15 posts - 346 through 360 (of 362 total)

  • RE: @@ERROR problems

    
    
    /*
    Two Things:
    1. Exec ([dynamicSQL]) is not a "script stopping" error if it fails.
    2. Adding "WHERE 1=2" causes the query plan to only return the result's "structure"
    ...
  • RE: Bakup with log truncation

    I do this same thing in me Full Backup scripts when my recovery model is "simple".

  • RE: Create a file from SQL Statement

    Here's a PROC I 've used to output <8K files.

    
    
    Create Procedure SyExport8KBlobToTextFile_sp
    (@Blob varchar(8000) = NULL
    ,@OutPutFile varchar(256) = NULL)
    as

    if @Blob + @OutPutFile is NULL begin
    print ' *******...
  • RE: How To Print A results During A long Batchs

    Gil, if you more timely output in the results pain of QA, instead of using PRINT,

    use

    raiserror ('[Your text here]',0,1) With Nowait

    or

    raiserror (@YourCharVariableHere,0,1) With Nowait

  • RE: xp_sendmail @query

    Try

    
    

    DECLARE @QuerySQL Varchar(200)
    SET @QuerySQL = 'exec GetEORepsByRA ' + Convert(Varchar(10), @ID)
    -- then
    exec master.dbo.xp_sendmail
    @recipients=@mail,
    @message=@body,
    @subject='E&O Coverage',
    @width=175,
    @query=@QuerySQL

    Observation: Parameters of PROCs, or for that matter Functions, can not be...

  • RE: Help: Ways of persisting the resultset from SP?

    Try

    
    
    -- Generic example ...
    If Object_ID('TempDB..#Temp') Is Not NULL Drop Table #Temp

    select * Into #Temp from OpenRowset('SQLOLEDB',
    'Server=(local);Trusted_Connection=yes',
    'Exec Master.dbo.sp_help ')

    Select * from #Temp

    If Object_ID('TempDB..#Temp') Is...
  • RE: need urgent help with relational algebra

    SELECT sname

    From Student

    Join Attendance

    On Student.Student# = Attendance.Student#

    Join Course

    On Course.Course# = Attendance.Course#

    Where Course.cname = "advance database"

    And Student.degreetype = "professional Pathway"

    SELECT sname

    From Student

    Where Student.degreetype = "professional Pathway"

    and Student.Student#...

  • RE: Dynamic Table Creation from Stored Procedure

    Try...

    -- Not recommended to use in a loop, does take a little longer to execute

    -- Generic example ...

    select * from OpenRowset('SQLOLEDB',

    'Server=(local);Trusted_Connection=yes',

    'Exec Master.dbo.sp_help ')

    -- Example with your call...

  • RE: Intercepting Bulk Insert errors

    I do not know what your "flat file" looks like, but if it contains values for your PKCheck identity column, try

    SET IDENTITY_INSERT TableName ON

    If PKCheck data is...

  • RE: Data for past one week

    Remember to look at your

    SET DATEFIRST and @@DATEFIRST. Do not assume

    Sunday - Saturday weeks in SQL.

    Also Try DateDiff(wk, ...

    instead of DateDiff(day, ...) ... 7

  • RE: Creating ASCII Text File

    -- A utilitarian SP I wrote a wile back

    -- Drop Procedure SyExport8KBlobToTextFile_sp

    Create Procedure SyExport8KBlobToTextFile_sp

    (@Blob varchar(8000) = NULL

    ,@OutPutFile varchar(256) = NULL)

    as

    if @Blob + @OutPutFile is NULL begin

    print ' ******* Procedure SyExport8KBlobToTextFile_sp...

  • RE: Tracking "dups" in a table.

    Write a SQL script something like the following:

    1. Import your "new" data into a #Temp table

    Maybe even in a disposable "temp" database

    2. Index the #Temp table...

  • RE: BULK INSERT & Text Qualifier

    You can try to set your rowterminator to '"/n'. This way, SQL will "eat" the doublequote that starts each record after the 1st record. It might be cleaner in using...

  • RE: QA and ASCII 1

    Looks like ISQLW parses the results and uses Char(1) as some kind of delimeter. I've seen this before, but as you say, this is only in "Grid" mode, not really...

Viewing 15 posts - 346 through 360 (of 362 total)