Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
esteiner97
Starting Member
3 Posts |
Posted - 2011-12-02 : 13:14:30
|
| I am looking for a way to automate this data entry.SQL 2008 r2.I have five columns in my table we care about.1. Table_Name = Will reamin static through all entrys.2. Value = Will increment up from only a set ### value.3. Description = Row will increment up from a name and set ### value 4. Inactive = Will remain static5. Related = Will remain staticExampleTABLE1 > 1 > Data 1 > N > Reference TABLE1 > 2 > Data 2 > N > Reference TABLE1 > 3 > Data 3 > N > Reference TABLE1 > 4 > Data 4 > N > Reference TABLE1 > 5 > Data 5 > N > Reference Will need to be able to set the start and stop values as well as be able to set the word "data" to other values.Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-02 : 13:18:18
|
| [code]DECLARE @Start int,@End intSELECT @Start=1,@End = 5 ;With CTE (N)AS(SELECT @StartUNION ALLSELECT @Start + 1FROM CTEWHERE @Start + 1<= @End)SELECT 'TABLE1',N,'Data ' + CAST(N AS varchar(10)),'N','Reference'FROM CTEOPTION (MAXRECURSION 0)[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
esteiner97
Starting Member
3 Posts |
Posted - 2011-12-02 : 13:30:10
|
| I have a sql assigned GUID in the first column for the Primary Key. How do I configure that in? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-03 : 00:21:16
|
| where's the GUID stored currently?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|