Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)

  • RE: Index error

    You have to put single quotes around that value, otherwise it will be treated as integer and the leading 0 will be removed

  • RE: write result in excel file.

    1. check your rights.

    2.make sure that the spreadsheet name is unique, and noone has it open.

    3.Try to delete the file you already created and run the sp again

    4. If you...

  • RE: write result in excel file.

    here is an example with pubs DB

     

    DECLARE @SQL varchar(8000)

     BEGIN 

      SET @SQL =

      'select au_lname,   au_fname,  phone,  address,   city, state, zip  from dbo.authors '

    --   select @SQL

    --   exec (@SQL)

      exec HPSP_UT_ExcelReport 'Test_XLS', @SQL, 'Test_XLS',...

  • RE: write result in excel file.

    Sure, you have to supply all the params.

    hese is the way I am running it:

    exec HPSP_UT_ExcelReport 'FileName', @SQL, 'SpreadsheetName', 'COL1_Name text, COL2_Name text'

       ,'\\ServerName\path\'

     

     

    @SQL - this is a sql...

  • RE: How to convert sql server default date value to NULL

    in the insert use case statement

     

    insert my_table(col1)

    select case when len(date1_char) = 0 THEN NULL ELSE cast(date1_char as smalldatetime)

  • RE: write result in excel file.

    You can use this stored proc.

    Just supply file name, path, and SQL query

     

    /******************************************************************************************

    '              

    '  PROCEDURE:      dbo.HPSP_UT_ExcelReport

    '

    '  Author:     Leah Kats

    '  Created Date:      05/25/2005 

    '    This utility stored procedure will ALTER  xls spreassheet...

  • RE: Searching Stored Procedures & User Defined Functions

    A while ago I posted Strored Procedure for this kind of searches.

     

    http://www.sqlservercentral.com/scripts/contributions/1234.asp

  • RE: IDENTITY, insert and order-by

    Here is your problem:

    You have a table with 3 columns. In the insert statement you put values only for 2 columns. In such cases you have to explicitly indicate what...

  • RE: How to export structure of view

    SELECT distinct   o.name, c.colid, c.name ColumnName, t.name, c.length

       FROM  sysobjects o

        JOIN sysdepends d

         ON depid = o.id

        JOIN syscolumns c

         ON o.id = c.id  

        JOIN systypes t

          ON c.xtype = t.xtype 

        WHERE  o.xtype = 'V'

     

     

  • RE: Casting Date/Time as string, padding empty chars with 0.

    You can use Replicate function. Look into BOL

  • RE: OPENXML and non-ascii characters

    If you  use <!CDATA> for any data it should work.

Viewing 11 posts - 1 through 11 (of 11 total)