datetime

rgb192
rgb192 used Ask the Experts™
on
create table shipping(
[order-id][varchar](30) NULL,
[order-item-id][varchar](30) NULL,
[purchase-date][datetime](30) NULL,
[payments-date][datetime](30) NULL,
[buyer-email][varchar](50) NULL,
[buyer-name][varchar](50) NULL,
[buyer-phone-number][varchar](30) NULL,
[sku][varchar](30) NULL,
[product-name][varchar](90) NULL,
[quantity-purchased][int] NULL,
[currency][varchar](30) NULL,
[item-price][int] NULL,
[item-tax][int] NULL,
[shipping-price][int] NULL,
[shipping-tax][int](30) NULL,
[ship-service-level][varchar](30) NULL,
[recipient-name][varchar](30) NULL,
[ship-address-1][varchar](90) NULL,
[ship-address-2][varchar](90) NULL,
[ship-address-3][varchar](90) NULL,
[ship-city][varchar](40) NULL,
[ship-state][varchar](40) NULL,
[ship-postal-code][varchar](30) NULL,
[ship-country][varchar](40) NULL,
[ship-phone-number][varchar](30) NULL,
[delivery-start-date][datetime] NULL,
[delivery-end-date][datetime] NULL,
[delivery-time-zone][datetime] NULL,
[delivery-Instructions][varchar](250) NULL
)



Msg 2716, Level 16, State 1, Line 1
Column, parameter, or variable #3: Cannot specify a column width on data type datetime.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
SQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018
Commented:
Fixed the errors:
create table shipping(
[order-id][varchar](30) NULL,
[order-item-id][varchar] NULL,
[purchase-date][datetime] NULL,
[payments-date][datetime] NULL,
[buyer-email][varchar](50) NULL,
[buyer-name][varchar](50) NULL,
[buyer-phone-number][varchar](30) NULL,
[sku][varchar](30) NULL,
[product-name][varchar](90) NULL,
[quantity-purchased][int] NULL,
[currency][varchar](30) NULL,
[item-price][int] NULL,
[item-tax][int] NULL,
[shipping-price][int] NULL,
[shipping-tax][int] NULL,
[ship-service-level][varchar](30) NULL,
[recipient-name][varchar](30) NULL,
[ship-address-1][varchar](90) NULL,
[ship-address-2][varchar](90) NULL,
[ship-address-3][varchar](90) NULL,
[ship-city][varchar](40) NULL,
[ship-state][varchar](40) NULL,
[ship-postal-code][varchar](30) NULL,
[ship-country][varchar](40) NULL,
[ship-phone-number][varchar](30) NULL,
[delivery-start-date][datetime] NULL,
[delivery-end-date][datetime] NULL,
[delivery-time-zone][datetime] NULL,
[delivery-Instructions][varchar](250) NULL
)

Open in new window

Top Expert 2010

Commented:
Change:

[purchase-date][datetime](30) NULL,
[payments-date][datetime](30) NULL,

to:

[purchase-date][datetime] NULL,
[payments-date][datetime] NULL,
AneeshDatabase Consultant
Top Expert 2009

Commented:
create table shipping(
[order-id][varchar](30) NULL,
[order-item-id][varchar](30) NULL,
[purchase-date][datetime] NULL,
[payments-date][datetime] NULL,
[buyer-email][varchar](50) NULL,
[buyer-name][varchar](50) NULL,
[buyer-phone-number][varchar](30) NULL,
[sku][varchar](30) NULL,
[product-name][varchar](90) NULL,
[quantity-purchased][int] NULL,
[currency][varchar](30) NULL,
[item-price][int] NULL,
[item-tax][int] NULL,
[shipping-price][int] NULL,
[shipping-tax][int] NULL,
[ship-service-level][varchar](30) NULL,
[recipient-name][varchar](30) NULL,
[ship-address-1][varchar](90) NULL,
[ship-address-2][varchar](90) NULL,
[ship-address-3][varchar](90) NULL,
[ship-city][varchar](40) NULL,
[ship-state][varchar](40) NULL,
[ship-postal-code][varchar](30) NULL,
[ship-country][varchar](40) NULL,
[ship-phone-number][varchar](30) NULL,
[delivery-start-date][datetime] NULL,
[delivery-end-date][datetime] NULL,
[delivery-time-zone][datetime] NULL,
[delivery-Instructions][varchar](250) NULL
)
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
data type datetime and int should not contain any scale or precision like [datetime](30) or [int](30) as in your code..
AneeshDatabase Consultant
Top Expert 2009

Commented:
b/w do you think Tax should be integer ?

Author

Commented:
can i use
-

because when I do insert command I cant do
-
in column name

Author

Commented:
for example
buyer-phone-number
Top Expert 2010

Commented:
rgb192,

You can, but then whenever you use it in queries you must enclose it in square brackets:

INSERT INTO SomeTable ([column-with-dashes]) VALUES ('foo')

Patrick
Top Expert 2010

Commented:
rgb192,

While I am glad to have helped, I really think you should have included rrjegan17 and aneeshattingal in the split.
We all posted within a few seconds of each other, and they also noticed the problem with your int declaration
as well, which I did not.

I suggest that you use the 'request attention' link to ask the Moderators to reopen this question, so you can then
split the points amongst the three of us.

Patrick
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
Thanks Patrick for being fair..
And I am clicking on Request Attention now

Author

Commented:
thank you

Author

Commented:
thank you all for helping
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
rgb192,
    Welcome..
And I agree splitting my points with aneesh and matthewspatrick since all comments were posted within fractions of second..( check out the time between those posts)

Hope you are aware of splitting points across several posts..

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial