ExamNotes.net  -  IT certification portal

ForumsCertResearchTop sitesNewslettersFree email
HomeRegister


Exams Notes
Practice exams
Exam games
Questions by email
Online training
Training videos
College degrees
Boot camps
Book store
Links directory
Tell a friend
For webmasters




General discussions > Public newsgroups > microsoft.public.sqlserver.server > create an id field for each row

Show a Printable Version
Email This Page to Someone!
Receive updates to this thread



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

Old Post 12-06-02 03:24 AM
Reply w/Quote Edit/Delete Message IP: Logged
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

Old Post 12-06-02 04:23 AM
Reply w/Quote Edit/Delete Message IP: Logged
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

Old Post 12-06-02 06:23 AM
Reply w/Quote Edit/Delete Message IP: Logged
All times are GMT.
Post new thread   Post reply


Forum Jump:
Rate This Thread:
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


Powered by: vBulletin 2.2.8
Copyright ©2000, Jelsoft Enterprises Limited.

  Free Braindumps | mcse braindumps