Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 building an insert statement for tables

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2007-06-20 : 10:59:06
Guys,

Is there anyway I can build a 'DML - INSERT' statement for LOV tables (_LOV) using a sql script by querying
information_schema.columns.

I will need to build the insert statements for the tables returned by the following query.

select name from sysobjects where name like '%_LOV' and xtype = 'u'

any suggestions/inputs will help

Thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-20 : 11:09:12
Search in this site

http://vyaskn.tripod.com/

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-20 : 11:46:58
See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=generate+INSERT+statement+script
Go to Top of Page

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2007-07-03 : 10:39:42
I am using following link to generate DML-INSERT statements

http://vyaskn.tripod.com/

The link above generates the statements
as
insert into test values ('smith')
insert into test values ('doe')

I want to change the stored proc to generate insert statements
as
insert into test values ('smith')
go
insert into test values ('doe')
go

The reason for this sql server compact edition will not run 2 highlighted dml-insert statements unless you have new line 'go'
between them.

Any suggestions inputs would help

Thanks


Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-07-03 : 10:49:10
"sql server compact edition will not run 2 highlighted dml-insert statements unless you have new line 'go'"

I'm surprised, but in any event it would be good to have a "GO" every 100 or so rows to break up the batch size.

Have you got a programmers editor that you can just change

INSERT INTO

to become

GO
INSERT INTO

?

Kristen
Go to Top of Page
   

- Advertisement -