Showing posts with label sequence. Show all posts
Showing posts with label sequence. Show all posts

Monday, March 26, 2012

How to append a new values like uniqueidentifiers, sequence numbers to data flow?

Hi,

I would like to know different possible ways in appending extra values like new uniqueidentifiers, sequence numbers, random number. Can you please tell what type of data flow components helps us ?

Append what to where? Do you want to add new columns with such vaues to a path within the data flow task?

Derived Column Transform?

Script Transform?

Row Number Transform ? (http://www.sqlis.com/default.aspx?77)

|||

yes..i want to append values to a path with in the data flow task.

If i use Derived Column Transformation, how can i generate uniqueidentifiers and sequence numbers for each row?

Thanks

Gopi

|||

For GUIDs you would need to use the script task, as there is no "New Guid" function in the expression syntax.

For sequence numbers or row numbers I assume, then again the script task is required. For an easier life you can use the cunningly named Row Number Transform I mentioned previously, which does just that, and comes as a simple MSI to install.

|||

Darren,

Thank you very much.

sql

Wednesday, March 7, 2012

How to add a newline sequence

I have a SQL 2005 stored procedure to generate an email when passed parameters such as receipient, subject etc

One of the paramteres passed to it is @.body which is the body text of the message. I want to be able to add a couple of blank lines and then some footer information. This is working right now except I can't find the right way to add newlines into the string within the store procedure, so my footer information just tags right on after the bodytext.

I have tried \n but that literally adds the two characters \ and n

Can anyone advise how to generate newlien sequences in T-SQL.

Regards

Clive

Use the CHAR function e.g. CHAR(13) + CHAR(10)

Seehttp://doc.ddart.net/mssql/sql70/ca-co_4.htm