Question: Here is code of room.coffee :

```
App.room = App.cable.subscriptions.create "RoomChannel",
  connected: -> 
  disconnected: -> 

  received: (data) ->
    $('#messages').append "<p>#{data}</p>"    

  speak: (message) ->
    @perform 'speak' , message: message

```

cable.coffee :

```
@App ||= {}
App.cable = ActionCable.createConsumer()

```

rooms.coffee:

```
$ ->
    $messages = $('messages')
    $messages.scrollTop $messages.prop('scrollHieght')
    $('#message_input').focus()

$(document).on 'keypress','message_input','e'->
    if e.keycode == 13 and e.target.value
    App.room.speak(e.target.value)
    e.target.value = ''
    e.preventDefault()

```

roomchannel:

```
class RoomChannel < ApplicationCable::Channel
  def subscribed
     stream_from "room_channel"
  end

  def unsubscribed
    # Any cleanup needed when channel is unsubscribed
  end

  def speak(data)
    message.create content: data['message']
  end
end

```

Broadcostmessage:

```
 def perform(message)
    Actioncable.server.broadcast 'room_channel',render_message(message)
  end
  private
  def render_message(message)
    ApplicationController.renderer.render_message
  end

```

when create the new message it will not automatically load all the messages of my browser untill the page in not reload.

Answer: 
You can turn `ON` or `OFF` the `IDENTITY_INSERT`

```
SET IDENTITY_INSERT test34 ON

insert into test34(seq,name,dept) values 
(1,(select name from test12),
(select case when dept='cse' then 'Y' else 'N' end as dept from test12))

SET IDENTITY_INSERT test34 OFF

```
There is no need to insert value for auto increment column automatically it will generate values.

```
insert into test34(name,dept) 
select name, Case when dept='cse' then 'Y' else 'N' end as dept from test12

```