How to add rows of data in a column in SQL Server?

Asked

Viewed 143 times

1

I’m importing data from the Rais (ME). The state is Acre. I created two columns: Uf1 and Ano1. In Uf1 goes the information AC and in Ano1 receives the information 2014. Note that insert, in the first two lines, in Ano1, the 2014 information. However, this database has thousands of lines which makes it impossible to use INSERT INTO or manual insertion by the SQL Server editor itself (SSMS).

So, how do I insert these values in all lines? Note: they are equal values. That is, in the more than 1,000 lines of Uf1 will be the information AC. In Ano1 will be the information 2014.

Already adding another question. Is it possible to do this through the SSIS of Microsoft Visual Studio? I was able to create variables (columns) Uf1 and Ano1 during import but could not add the desired data.

Dados

  • Do you want to extract the data or update the table? I didn’t get it right

  • If the records already exist in your database then you should not use INSERT and yes UPDATE. If you want the same value in all records do: UPDATE sua_tabela SET Uf1 = 'AC', Ano1 = 2014;.

  • Very good. Solved my problem. Thank you!!!!!!!!!!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.