473,623 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Server 2005

1 New Member
Please, how to create a table with SQL statement in SQL Server 2005 including an ID number for the first field as well as an incrementation?

Thank you.
Jul 20 '07 #1
1 890
Clanguage
12 New Member
[HTML]GO
CREATE TABLE [dbo].[MyTable](
[id] [uniqueidentifie r] NOT NULL,
[AgentID] [int] NOT NULL,
[BusinessName] [varchar](25) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,
[Address1] [varchar](30) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,
[Address2] [varchar](30) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NULL,
[City] [varchar](20) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,
[State] [char](2) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,
[Zip] [varchar](10) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,
[County] [varchar](15) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_ID] PRIMARY KEY NONCLUSTERED
(
[AgentID] ASC
) ON [PRIMARY]
) ON [PRIMARY][/HTML]
This SQL statement should give you an idea of what to do. The uniqueIdentifie r will automatically increase by one for each record. Just change the table name and the columns names and their datatypes and run the query. If you need to modify the table after it is created just change the CREATE to ALTER.
Good luck
Jul 20 '07 #2

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

Similar topics

0
4119
by: AlessanBar | last post by:
Hello Friends !! I have a strange problem, and I need to know what would be the source of this. I have a laptop computer with the following configuration: Pentium III Brand : Toshiba Speed : 500 Mhz RAM : 192 MB Hard Disk : 6 GB
2
2250
by: Kevin R | last post by:
I'm trying to get asp.net 1.1 running on my home PC. When I try creating a new ASP.NET Web Application in 'Visual Studio .NET 2003' I get the following error: "Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services" Thanks for any help in advance. Kevin ===============================
17
9216
by: Danieltbt05 | last post by:
just installed SQL server 2000 and using my client , i can't locate the server. I used SQL query analyzer to search but no servers were found. Error message is as below Server : Msg17,level 16, state1 SQL server does not exist or denied access.
1
6615
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an unexpected value. ***EndOfSession***? Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an...
16
2313
by: Jeremy S. | last post by:
I'm about to install VS.NET 2005 and SQL Server 2005 on a new/clean development machine (XP Pro/SP2 etc). Is the order of installation important (i.e., which product should I install first)? Thanks!
10
2094
by: amjad | last post by:
how to connection sql server table with aspx like pulling data from table to grid view.... simple example to start .... thanks
2
6944
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
3
6424
by: Steve | last post by:
Hi All I downloaded Sql server 2005 express SP2 and attempted to modify the Bootstrapper package files as I did with SP1 When i try to install SQL server as part of my VS 2005 deployment app I get an error at the end of the SQL server install phase 'Invalid endpoint'. (Note SQL server express gets installed OK) If I run SQL server express SP2 setup directly it I don't get the error
3
3254
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual Studio 2005 SP1 and had it working perfectly on my Windows XP machine on SQL Server 2005 Express. I decided to publish this application to a test development server (with both the SQL and IIS servers on the same box) running on: Windows Server...
0
8224
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8469
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7145
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6104
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1471
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.