sql server 2000 : leading zeros for IDs and db upl

Results 1 to 2 of 2

Thread: sql server 2000 : leading zeros for IDs and db upl

  1. #1
    Join Date
    Dec 1969

    Default sql server 2000 : leading zeros for IDs and db upl

    Please need a solution asap<BR>thanks<BR><BR><BR>I have generated IDs in SQL Server 2000: Data Type = Int, size = 4, seed =1 , seed increment by = 1, precision is 10 digits, scale = 0 digits.<BR>Now i need to format it in 10 digits like if id is 1 then it should be stored and generated in sql server in 10 digits like 0000000001 or 0000000555<BR><BR>----------------------------------<BR>Another problem : in uploading db to sql server 2000 with hosting company. On my machine its working fine with sql server 2000 locally but with the below instructions to upload i cannot connect.<BR><BR>The Server IP address is:<BR><BR>You will need to setup an alias in your SQL Server Client Network Utility,<BR>You can name the alias "SQL2K1". Set it to use TCP/IP on port 1433. You can<BR>then set up the new registration in Enterprise Manager. The server name <BR>would be "SQL2K1". The username and password would be the the username and<BR>password you gave when you requested your sql database. <BR><BR>If you have a problem with not being able to connect to the sql server, <BR>you need to verify that you are not behind a firewall, or that your ISP<BR>is not blocking ports 137-139, and 1433. You might also try increasing<BR>the default timeout to 30 seconds. You can find this setting by going to<BR>tools then options, and clicking on the advanced tab.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: sql server 2000 : leading zeros for IDs and db

    1. Select replace(str(1,10),&#039; &#039;,&#039;0&#039;) where 1 in str(1,10) is the actual value. Try this Query analyzer. <BR><BR>If datatype is Int, I dont think, you can pad it with 0&#039;s in front.<BR><BR>2. I think, the message is pretty clear........ or rather, I am unable to grasp the problem exactly... Anyone out there ?

Posting Permissions

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