Author |
Topic |
satya068
Posting Yak Master
233 Posts |
Posted - 2010-03-17 : 10:28:59
|
Hi..i was trying to insert data into a new table and i wondering any one could help me how to turn 'ON'select into option in SP_dboption in the model database.when i chek the stored procedure it was already set to ON but when i run sql script it was throwing me an error message. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-17 : 10:35:27
|
whats the error message?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-03-17 : 10:43:02
|
hi..herego my scriptselect * into NEW_TABLE1 from(SELECT tab.name AS table_name,ind.rows as row_countFROM sys.tables tab INNER JOINsys.sysindexes ind ON tab.object_id = ind.id AND ind.indid < 2)now i want to insert that 2 columns into NEW_TABLE1 in the same database.is there anyother way to insert these record into NEW_TABLE1?thanxsatya |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-17 : 11:03:40
|
SELECT tab.name AS table_name,ind.rows as row_countINTO NEW_TABLE1FROM sys.tables tab INNER JOIN sys.sysindexes ind ON tab.object_id = ind.id AND ind.indid < 2 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-17 : 11:04:44
|
But you have not answered Visakh's question!Posting the error message is always important. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-03-17 : 11:08:03
|
hi.. i am unable to access my database due to connection problem ..that the reason i am unable to paste my error to visakh's..reply.i ill try ur script once i got connection to database.thanx againsamitee |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-17 : 11:18:42
|
Ah - ok.But think about it: SELECT INTO needs the destination table isn't already present. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-03-17 : 11:38:55
|
thanx i got expected result.quote: Originally posted by webfred SELECT tab.name AS table_name,ind.rows as row_countINTO NEW_TABLE1FROM sys.tables tab INNER JOIN sys.sysindexes ind ON tab.object_id = ind.id AND ind.indid < 2 No, you're never too old to Yak'n'Roll if you're too young to die.
Satya |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-03-17 : 11:41:09
|
DESTINATION TABLEwhic i already created manually with datatype varchar(100) n row_count as intquote: Originally posted by webfred Ah - ok.But think about it: SELECT INTO needs the destination table isn't already present. No, you're never too old to Yak'n'Roll if you're too young to die.
Satya |
 |
|
|