Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    10

    Unanswered: changing case of input parameters

    hi all,

    i am using SQL 2005 and executing a SQL script via a sqlcmd cmd file. the input params are as follows

    division Month Year

    01 08 2009

    when i use these params within SQL server the leading 0 is dropped thus making the scripts fail

    i am using the following code to set the params

    Code:
    SET @DIV = $(div) 
    SET @mth = $(mth)
    SET @year = $(year)
    how can i make the @div and @mth = 01 etc and not change to 1?

    I have set the datatype of @div and @mth to be nvarchar(10)

    your help would be appreciated.

    cheers

    chappo

  2. #2
    Join Date
    Sep 2003
    Location
    Vietnam
    Posts
    10
    hi chappo,

    Can you use function built-in SQLServer, with 'substring', get 2 first characters...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •