jaferreira Posted December 30, 2009 at 11:18 AM Report Share #303159 Posted December 30, 2009 at 11:18 AM Bom dia tenho um typed dataset e no datatable no command insert de uma tabela eu queria colocar um valor num campo atraves de um select ou seja o campo Numero vai ser = ao Select de uma tabela Where .... mas se meto um select no comando insert ele diz que nao se pode colocar um select dentro do insert alguem me consegue ajudar? Link to comment Share on other sites More sharing options...
abYsmo Posted December 30, 2009 at 11:35 AM Report Share #303165 Posted December 30, 2009 at 11:35 AM Não estaras a escrever mal o comando? Coloca aqui como estas a fazer isso. Link to comment Share on other sites More sharing options...
jaferreira Posted December 30, 2009 at 11:40 AM Author Report Share #303167 Posted December 30, 2009 at 11:40 AM Declare @proximoNumero int Select Top 1 @proximoNumero = isnull(Numero,0) from TABELA Where ARG=@Arg Depois tenho o insert que ele cria na tabela normal que e algo do genero INSERT into (........) Values (.........,@proximoNumero) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now