Toad World® Forums

Copy Cells [issue?]


#1

Hi,

  1. for this context menu item:

I chose generate text for insert statement.

And I got [there is lack of red and bold text]:
INSERT dbo.PROXY_LOG (PL_DATA, PL_CALL_QUERY) VALUES
(‘2009-11-16 00:11:12’, 'PRO_PL_ZMIEN_DANE_ABONENTA ')

  1. If I select several rows, I got:
    ( PL_DATA , PL_CALL_QUERY ) VALUES
    (‘2009-11-16 00:13:10’, ‘PRO_PL_DAJ_DANE_KLIENTA
    @NR_UMOWY=’‘1766/841/Z/05/07/TSP’’’),
    (‘2009-11-16 00:15:41’, ‘PRC_ITF_ZNACZNIKI_MKT_4DT
    @NR_UMOWY=’‘13/B507/Z/06/06/SB’’’),
    (‘2009-11-16 00:18:09’, ‘PHOBOS.DBO.PRC_ITF_PDA_POKAZ_USLUGI @LOGIN_ID=’‘846’’,
    @F_POZIOM=’‘S’’, @KONTO_ID=’‘3641711’’’),
    (‘2009-11-16 00:22:28’, ‘PHOBOS.DBO.PRC_ITF_PDA_POKAZ_USLUGI @LOGIN_ID=’‘846’’,
    @F_POZIOM=’‘S’’, @KONTO_ID=’‘3552533’’’),

This kind of sql is valid from MS SQL 2008! For previous versions it is wrong
sql [not mentioning lack of table name]

Butter

int_1.jpeg

int_2.jpeg
int_1.jpeg


#2

The idea was to provide data sensitive information only. You have to put this
text after INSERT INTO YOUR_TABLE statement

You copy cells with data but not generate SQL script.

If you need valid SQL script you may send this data to Export wizard (Right
Click -> Export\Export Wizard – chose SQL Script as output format and
so on…)

regards,

Alexander Maximov
int_1.jpeg


#3

The idea was to provide data sensitive information only. You have to put this
text after INSERT INTO YOUR_TABLE statement

You copy cells with data but not generate SQL script.

If you need valid SQL script you may send this data to Export wizard (Right
Click -> Export\Export Wizard – chose SQL Script as output format and
so on…)

regards,

Alexander Maximov
image002.jpeg


#4

The idea was to provide data sensitive information only. You have to put this
text after INSERT INTO YOUR_TABLE statement

You copy cells with data but not generate SQL script.

If you need valid SQL script you may send this data to Export wizard (Right
Click -> Export\Export Wizard – chose SQL Script as output format and
so on…)

ok. It works, but takes much more time.

Btw: generated sql has no semicolons at the end of line.

However, issue below is still active [it will work on sql 2008 an newer!]

[…]

  1. If I select several rows, I got:

( PL_DATA , PL_CALL_QUERY ) VALUES

(‘2009-11-16 00:13:10’, ‘PRO_PL_DAJ_DANE_KLIENTA
@NR_UMOWY=’‘1766/841/Z/05/07/TSP’’’),

(‘2009-11-16 00:15:41’, ‘PRC_ITF_ZNACZNIKI_MKT_4DT
@NR_UMOWY=’‘13/B507/Z/06/06/SB’’’),

(‘2009-11-16 00:18:09’, ‘PHOBOS.DBO.PRC_ITF_PDA_POKAZ_USLUGI @LOGIN_ID=’‘846’’,
@F_POZIOM=’‘S’’, @KONTO_ID=’‘3641711’’’),

(‘2009-11-16 00:22:28’, ‘PHOBOS.DBO.PRC_ITF_PDA_POKAZ_USLUGI @LOGIN_ID=’‘846’’,
@F_POZIOM=’‘S’’, @KONTO_ID=’‘3552533’’’),

This kind of sql is valid from MS SQL 2008! For previous versions it is wrong
sql [not mentioning lack of table name]

Other interested issue: button Add [and Remove & Edit] is disable.

Butter
int_1.jpeg


#5

Motyl,

I got the script from 2008 server with Export Wizard (SQL Script output) and
successfully executed it on 2005 without semicolons at the end:

What I’m doing wrong?

For about disabled buttons on Export Object step in Export Wizard – this
is correct, but looks not friendly. Agree. This is standard step on this wizard
but you can’t add or modify here any export source since you invoked the
wizard from data grid (Data tab or result set, doesn’t matter). I’ve
created CR to think about hiding this step in this particular case.

You can see how Export Wizard works from Tools\Export\Export Wizard.

regards,

Alexander Maximov
int_1.jpeg


#6

Motyl,

I got the script from 2008 server with Export Wizard (SQL Script output) and
successfully executed it on 2005 without semicolons at the end:

What I’m doing wrong?

For about disabled buttons on Export Object step in Export Wizard – this
is correct, but looks not friendly. Agree. This is standard step on this wizard
but you can’t add or modify here any export source since you invoked the
wizard from data grid (Data tab or result set, doesn’t matter). I’ve
created CR to think about hiding this step in this particular case.

You can see how Export Wizard works from Tools\Export\Export Wizard.

regards,

Alexander Maximov
image004.jpeg


#7

Using semicolon as a statement terminator is still not obligatory…

Thanks,

Igor.
int_1.jpeg


#8

Motyl,

I got the script from 2008 server with Export Wizard (SQL Script output) and
successfully executed it on 2005 without semicolons at the end:

ok. importance of semicolon is very low, It’s just good practice. Nothing more
nothing less [I mentioned it ‘by the way’]

Main issue was that general formatting like ‘(column names) Values (val_1),…
(val_n)’, which I can gain using

‘copy rows/ insert statement formatted text’ can be used only in sql2008.

Yes, I’ve heard that export wizard has to be used :wink:

But Export wizard needs 6 x click but copy rows only 2…

Butter