











|  |
| Author |
create an id field for each row
|
dam
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
create an id field for each row
I need to create few txt files from an existing MSS db
using some scripts. In the txt file, I need to create a
new id column for each row. I like to use some function
in my SQL scripts so it will create a unique id for each
row. Any ideas?
Id column needs to be less that 18 characters.(I cannot
use NEWID() function)
THNNKS
Report this post to a moderator
|
|
12-06-02 03:24 AM
|
|
Oleg Deshin
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
Re: create an id field for each row
Hi,
Create a temporary table with IDENTITY field and all fields from your table
that you want to export.
Feed the data from your source table into the temporary table.
The Identity field will contain unique values.
Export data from temporary table into text file.
Oleg.
> I need to create few txt files from an existing MSS db
> using some scripts. In the txt file, I need to create a
> new id column for each row. I like to use some function
> in my SQL scripts so it will create a unique id for each
> row. Any ideas?
>
> Id column needs to be less that 18 characters.(I cannot
> use NEWID() function)
>
> THNNKS
Report this post to a moderator
|
|
12-06-02 04:23 AM
|
|
BP Margolin
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
Re: create an id field for each row
Please do not post the same question independently to multiple newsgroups.
Please see my reply in .dts
-------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.
"dam" <ddesilva@accela.com> wrote in message
news:0b1c01c29cd2$479f4280$cef
82ecf@TK2MSFTNGXA08...
> I need to create few txt files from an existing MSS db
> using some scripts. In the txt file, I need to create a
> new id column for each row. I like to use some function
> in my SQL scripts so it will create a unique id for each
> row. Any ideas?
>
> Id column needs to be less that 18 characters.(I cannot
> use NEWID() function)
>
> THNNKS
Report this post to a moderator
|
|
12-06-02 06:23 AM
|
|
|
Forum Rules: Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author.
Posts: HTML code is OFF. Smilies are ON. vB code is ON. [IMG] code is OFF. |
|
ExamNotes forum archive
|