Forum Replies Created

Viewing 15 posts - 346 through 360 (of 363 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"
    ...



    Once you understand the BITs, all the pieces come together

  • RE: Bakup with log truncation

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



    Once you understand the BITs, all the pieces come together

  • 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 ' *******...



    Once you understand the BITs, all the pieces come together

  • 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



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • 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#...



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • RE: Intercepting Bulk Insert errors

    Check out

    http://www.sqlservercentral.com/forum/link.asp?TOPIC_ID=17942



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • 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



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

  • 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...



    Once you understand the BITs, all the pieces come together

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