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.
| Author |
Topic |
|
kaus
Posting Yak Master
179 Posts |
Posted - 2002-07-26 : 14:29:58
|
| Hi - I have a select into statement as follows:IF EXISTS( SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'MyTable' AND table_schema = 'GM')BEGIN drop table [MyTable]ENDSelectProj_ID ID, Proj_Name Descr into MyTablefrom dbo.Projectswhere Month_ID = 2 andMan_ID = 5Is there any way that I can insert another column into this table within this statement -- called 'Flag', and then populate it with a constant value -- say 'Project' ??I'm going to do two more inserts after this one and want to set the flag for a different value on each of the insertsThanksPete |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-26 : 14:34:02
|
| IF EXISTS( SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'MyTable' AND table_schema = 'GM')BEGIN drop table [MyTable]ENDSelectProj_ID ID, Proj_Name,'project' as flag, Descr into MyTablefrom dbo.Projectswhere Month_ID = 2 andMan_ID = 5<O>Edited by - Page47 on 07/26/2002 14:36:04 |
 |
|
|
kaus
Posting Yak Master
179 Posts |
Posted - 2002-07-26 : 14:45:00
|
| wow - not much to that -- I was trying an alter tablethanks |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-26 : 14:47:05
|
Gimme a minute, I can make it more complicated for you ... <O> |
 |
|
|
|
|
|