473,419 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Increasing field sizes in Microsoft SQL

Hi,

I hired a programmer to create a simple database system for my office.

I now need to extend a character field within the database table, from 60 to 1000, but are unable to comtact him.

When i tried to do it myself (using tutorials from google) I realised he did not install any administrative tools etc...

I have no ideas how he entered the data and now have no idea how to edit the field length.

This is a matter of the utmost urgency as i have a meeting tomorrow and need to have this working properly.

I would be very grateful if anyone could help me with this matter.

Many thanks
Dee
Mar 12 '07 #1
2 5030
bergy
89
I usually modify data types like so:

Change Datatypes:
ALTER TABLE table_name ALTER COLUMN some_column char(1000);

Run that query in your database and it should do the trick.

As far as being able to execute the query - if you're on the machine that the database is on first thing to check is to see if by some chance you have OSQL installed.

1. Goto Start > Run
2. Type "CMD" in the box (without quotes) and press enter
3. Type "osql" and press enter (again without quotes)

If you don't get "Bad command or filename" you should be able to use osql to pass the above SQL statement to your database. The OSQL command would look something like this:

osql -E -S ServerName -Q "ALTER TABLE table_name ALTER COLUMN some_column char(1000)"

That line may or may not work (after you've changed the table and column info as well as the server name which probably isn't necessary if you're running this on the same computer the database is stored on - maybe just remove the -S ServerName). Maybe someone who is more familiar with osql can help you/me make sure that command is correct.

If it doesn't work and you don't get a swift response from some one else consult Microsoft's site for the reference on the osql command: http://msdn2.microsoft.com/en-us/lib...8(SQL.80).aspx

Hope that helps!

Hi,

I hired a programmer to create a simple database system for my office.

I now need to extend a character field within the database table, from 60 to 1000, but are unable to comtact him.

When i tried to do it myself (using tutorials from google) I realised he did not install any administrative tools etc...

I have no ideas how he entered the data and now have no idea how to edit the field length.

This is a matter of the utmost urgency as i have a meeting tomorrow and need to have this working properly.

I would be very grateful if anyone could help me with this matter.

Many thanks
Dee
Mar 12 '07 #2
bergy
89
One other option that you may have is the SQL Server Management Studio Express application available for free from Microsoft. It's made to work with SQL Server 2005 and SQL Server 2005 Express, however I noticed it also allowed me to connect to my MSDE and SQL Server 2000 servers.

It's a little more graphical so you can change the column field that way and also be able to change things in the future. You can also run the query I gave you above in here instead of OSQL.

Check: http://msdn.microsoft.com/vstudio/express/sql/download/

And in Step 3 under the left, SQL Server 2005 Express Edition SP2, select the second download link called SQL Server Management Studio Express.
Mar 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Bryan Rickard | last post by:
I wrote a simple program in VB6 to copy all the files from a directory on a CD-ROM to my hard disk. There are about 10 files, each about 30MB. The program uses Get and Put to get data from the...
2
by: bob | last post by:
I am trying to find a simple way to determine the field size of a field in an Access table. I am writing a VB.NET Windows application. I would like a code snippet that I can get to work. I found...
0
by: mrwoopey | last post by:
Hi, My OLAP data cube is giving me the following error when I am manipulating OLAP data cube views: "the data being processed is over the allowed limit" I know that this message is caused by...
3
by: Brian | last post by:
Can any one direct me to sources for best practices of field types and sizes to use for commonly used information such as address, names, city, business names .... Thanks, Brian
1
by: Nigel Robbins | last post by:
Hi There, I get SQL0670N when altering a table to add an extra colum. Can an SMS tablespace be changed to have a larger page size ? Many thanks, Nigel Robbins
1
by: marko | last post by:
Here is my problem. How can i make a field in a form change to a value 1 every morning when I turn access on, when the date changes? And how can i make a button on a form which would open another...
60
by: deko | last post by:
As I understand it, most browser manufacturers have agreed on 16px for their default font size. So, this should be an accurate conversion for percentages: px % 16 = 100 14 = 87.5 13 =...
1
by: savvy | last post by:
I am developing a Garments shopping cart. On the single product page where the customer selects size and colour of a garment and if its ok for him, then adds to his basket, so every time he checks...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
Visual Studio 2005, C# WinForms application: Here’s the question: How can I increase the standard 1 MB stack size of the UI thread in a C# WinForms application? Here’s why I ask: I’ve...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.