Viewing 15 posts - 331 through 345 (of 1,346 total)
You need to use sp_executesql instead of exec.
set @sqlstring = 'select @recIDmin = min(record_id) from ' + @TblName
--get min value of record_id in a tbl into var @recIDmin
exec...
August 30, 2007 at 10:51 am
I do believe it is because you are declaring the Elements keyword in your For XML Clause.
from BOL
Specifies that the columns are returned as subelements. Otherwise, they...
August 28, 2007 at 9:12 am
What do you mean Drill down?
What are you trying to accomplish?
you can for example call a subreport by clicking an item on your report.
select properties on item, go to Navigation,...
August 27, 2007 at 3:32 pm
Your best bet that will give you the greatest flexibility would to do formatting on the presentation layer (whatever you use to display to the user, ie crystal, MS reporting...
August 23, 2007 at 10:41 pm
you mean
Insert...Select?
Examples below
--TestTable
Create table #Mytable (pk int identity,
Foo varchar(25),
Bar varchar(25))
--Insert TestData
insert into #Mytable (Foo, Bar)
Values('One', 'Mississippi')
insert into #Mytable (Foo, Bar)
Values('Two', 'Mississippi')
insert into #Mytable (Foo, Bar)
Values('Three', 'Mississippi')
-- Can...
August 22, 2007 at 2:49 pm
In the path statement you have to put the lower level to get it to look at all the rows.
and then in the With clause indicate text() function to have...
August 21, 2007 at 4:02 pm
Here is an article that thoroughly explains dynamic sql.
http://www.sommarskog.se/dynamic_sql.html
It can possibly have Performance, and Security problems, but if used wisely, and in the correct places its okay.
August 14, 2007 at 8:58 am
changing the date to be 8/2007 should be something easily done on the presentation layer. (What are you using BTW?)
For sorting you absolutely have to return an actual date.
that little...
August 13, 2007 at 9:37 am
What are you dumping your output to?
I'm guessing Tables.
Each table is assigned to its own Dataset.
Create 2 different datasets one for each output.
then plop down 2 tables on the designer.
Edit...
August 13, 2007 at 9:30 am
Rough Example
In books online it is the Insert..Select
Insert into Mytable (col2, col3, col5)
Select SourceCol1, SourceCol2, SourceCol4
From StageTable
Where Something = Something
From BOL
The SELECT subquery in...
August 7, 2007 at 1:57 pm
declare @date1 datetime
declare @date2 datetime
set @Date1= '08/05/2007'
set @Date2 = '01/01/1900 2:11:00 PM'
select @Date1, @Date2
--
2007-08-05 00:00:00.000 1900-01-01 14:11:00.000
select @Date1 + @Date2
Result
2007-08-05 14:11:00.000
August 5, 2007 at 3:10 pm
No, if you do a ## it will not allow multiple users all the users will be dumping records into the same temp table.
Populate your temp table inside a procedure.
Create...
August 2, 2007 at 8:43 am
Then is not needed in a IF statement Remove Text in Red
IF @GroupLeader = '' THEN
SELECT GRPLDR.GLPerson FROM dbo.Main LEFT OUTER JOIN
(SELECT Person AS GLPerson, WPId FROM SigAuth WHERE Title = 'GL')...
August 1, 2007 at 11:54 am
I'm not sure why you would want to do this. Designating a value as the primary key is important to maintaining data integrity, and to have a need to Update...
July 27, 2007 at 11:37 am
-- Don't use Dynamic sql unless you have to.
-- Try a UDF
Create FUNCTION udf_list_parse_comma_string
(@String varchar(8000))
RETURNS @stringTable TABLE
(string varchar(100))
AS
BEGIN
-- Make sure last char is a comma
if right(@String,1) <> ','
...
July 27, 2007 at 10:47 am
Viewing 15 posts - 331 through 345 (of 1,346 total)