显示标签为“inserting”的博文。显示所有博文
显示标签为“inserting”的博文。显示所有博文

2012年2月13日星期一

Any code for automatically inserting queries of first table into the second?

Any code for automatically inserting queries of first table into the second?
Is there a way of inserting the query of records from the first table into the second? Because I want to use the second db by deleting records that might be unnecessary.

I want to copy the searches of one table to another. Let's say I search a keyword I want the search to go through the first table and copy the records where the keyword is to be found to the second table. I find that would be easy to study. Whatever I don't want from that search I can easily delete it. And at the same time I have the original table not tampered.could u just

INSERT INTO Table2 (field1)
SELECT * FROM Table1;

i believe u can just use the INSERT cmd|||Is it before or after (I'd guess it's before) the <%rs.Open SQL%> statement?|||What does this mean?

INSERT INTO results(id, book, book_spoke, recordType, book_title, chap, chapter, chapter_spoke, vers, verse, verse_spoke, text_data) VALUES (, , , '', '', , , , , , , '')
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'execute'

/kjvresp.asp, line 280|||the problem is here: VALUES (, , , '', '', , , , , , , '')

you have to put something for each column

at worst, you could use nulls (assuming the table allows nulls)

VALUES (null, null, null, '', '', null, null, null, null, null, null, '')|||I had put && around each fieldname. But I made some changes. But this is what I got now:

INSERT INTO results SELECT * FROM bible WHERE text_data LIKE '%ezra%' AND text_data LIKE '%%' AND text_data LIKE '%%'
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

/kjvresp.asp, line 272

The insertion was found in the table but the output to the ASP page is somehow blocked.|||text_data LIKE '%%' is true for every row and should be dropped

if you have an ASP problem, you should post in the ASP forum

this forum is for generic (non-proprietary) SQL

2012年2月11日星期六

Ansi_Padding Question

Hi all,
How do you determine if ansi_padding was set to on or off when a table
was created? Aside from inserting a record with trailing blanks, I
can't seem to find an answer.
Thanks,
Terryif (@.@.OPTIONS & 16 = 16)
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Terry" <wondermutt@.sbcglobal.net> wrote in message
news:6eee4aa9.0310031300.468ccb15@.posting.google.com...
> Hi all,
> How do you determine if ansi_padding was set to on or off when a table
> was created? Aside from inserting a record with trailing blanks, I
> can't seem to find an answer.
> Thanks,
> Terry|||@.@.options only helps you figure out the current value of ANSI_PADDING.
To check the value in effect when a column was created, use COLUMNPROPERTY
SELECT COLUMNPROPERTY(table_id, column_name, 'UsesANSITrim')
Please see Books Online for more details.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Terry" <wondermutt@.sbcglobal.net> wrote in message
news:6eee4aa9.0310031300.468ccb15@.posting.google.com...
> Hi all,
> How do you determine if ansi_padding was set to on or off when a table
> was created? Aside from inserting a record with trailing blanks, I
> can't seem to find an answer.
> Thanks,
> Terry