SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create tables and indexes with a Store Procedure


Create tables and indexes with a Store Procedure

Author
Message
DarioP
DarioP
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 23
Comments posted to this topic are about the item Create tables and indexes with a Store Procedure
j day
j day
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 43
Hi

I'm afraid it doesn't seem to work for smallint columns or table names with spaces in them...

Jeff
Sector7G
Sector7G
SSC-Enthusiastic
SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)

Group: General Forum Members
Points: 152 Visits: 838
It looks like a useful script after a little debugging. It's not returning a valid format for date fields. Here is an example that was created using the script. The script is adding a length value to the date field.


CREATE TABLE [dbo].[Claims_Report]
(
[MonthEndDate] [date] (3) NULL
,[Initial_Closed] [float] (8) NULL
,[Initial_Received] [float] (8) NULL
,[Initial_Percentage] [float] (8) NULL
,[Final_Closed] [float] (8) NULL
,[Final_Received] [float] (8) NULL
,[Final_Percentage] [float] (8) NULL
) ON [PRIMARY]
GO



result:

Msg 2716, Level 16, State 1, Line 4
Column, parameter, or variable #1: Cannot specify a column width on data type date.
DarioP
DarioP
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 23
If you look at the script you figure out that some data type must be implemented to fit all your needs. Unfortunately, I did not need to use other data type for my needs but it is quite simple to implement those I missed.
Just check the script and add data type you need.
As soon as I'll get some spare time, I'll update the script for you all.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search