Viewing 7 posts - 121 through 127 (of 127 total)
Hi,
I sometimes like to construct the code to execute the procedures with a script like the following, it has been very useful to me lot of times, but it has...
January 17, 2012 at 8:33 am
Hey i liked your script, i made just a litle change to make it smaller, i hope you like too. There you go:
DECLARE @SQLCode AS VARCHAR(MAX)
DECLARE @TargetSize AS VARCHAR(50)
SET @TargetSize...
December 28, 2011 at 7:50 am
i had to research cuz i'm mexican and i was not aware of it.
April 18, 2011 at 2:11 pm
Oh men, i was thinking about table valued functions and i answer incorrectly, they can be in a "from" clause. I was being very literal, surely msdn did not mean...
November 30, 2010 at 7:45 am
Im miss the first part sorry.
DECLARE @Field1 AS VARCHAR(50)
SET @Field1='''FieldOne'''
DECLARE @Field2 AS VARCHAR(50)
SET @Field2='FieldTwo'
DECLARE @Field3 AS VARCHAR(50)
SET @Field3='''ID[0]'''
DECLARE @Type3 AS VARCHAR(50)
SET @Type3='''Int'''
DECLARE @SQL AS VARCHAR(100)
SET @SQL='Select '+@Field1+','+@Field2+', cox.value('+@Field3+','+@Type3+') from ATable'
print(@SQL)
output:
Select...
November 26, 2010 at 7:25 am
sorry i did not copy the first two statemetens. Here we go again.
DECLARE @Field1 AS VARCHAR(50)
SET @Field1='''FieldOne'''
DECLARE @Field2 AS VARCHAR(50)
SET @Field2='FieldTwo'
DECLARE @Field3 AS VARCHAR(50)
SET @Field3='''ID[0]'''
DECLARE @Type3 AS VARCHAR(50)
SET @Type3='''Int'''
DECLARE @SQL...
November 26, 2010 at 7:22 am
You can try something like this for concat FieldName and/or types to a query.
DECLARE @Field2 AS VARCHAR(50)
SET @Field2='FieldTwo'
DECLARE @Field3 AS VARCHAR(50)
SET @Field3='''ID[0]'''
DECLARE @Type3 AS VARCHAR(50)
SET @Type3='''Int'''
DECLARE @SQL AS VARCHAR(100)
SET @SQL='Select...
November 26, 2010 at 7:20 am
Viewing 7 posts - 121 through 127 (of 127 total)