|
-
February 13th, 2004, 12:05 PM
#1
How to INSERT INTO a temp table the value of a SQL variable
I don't get where my syntax is goig wrong here, I am hoping someone can help me out?
declare @pLevel varchar
set @pLevel = (select cast(serverproperty('productlevel') as varchar(8000)))
print @pLevel
print len(pLevel)
The output is:
S
1
I believe that cast is cutting out the return value, but I am not certain why.
At any rate, all I want to do is INSERT INTO a temp table the value of:
SELECT ServerProperty('productlevel')
Thanks in advance for the help,
Bob
-
February 18th, 2004, 01:42 AM
#2
Code:
create table #myTemp (prop varchar(8000))
insert into #mytemp
select cast(serverproperty('productlevel') as varchar(8000))
select prop from #mytemp
drop table #mytemp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|