Viewing 15 posts - 406 through 420 (of 427 total)
I hope you're not ending the conversations at the initiator side right after you've sent your message(s). If so, do yourself a favor and read Remus' explanation why you should...
June 28, 2010 at 7:00 am
Both the target and the initiator have to call "end conversation @handle;" on each conversation. When either end does the 1st 'end conversation' that will make service broker deliver an...
June 23, 2010 at 4:32 pm
And you'll probably want to include the line "set @nRows = @@rowcount;" into the dynamic sql too. Just add another output parameter ', @nRows int output' in the parameter list...
June 23, 2010 at 3:52 pm
You have to specify the parameters, their types and the output clause to your dynamic sql, like this:
declare @dbnamenvarchar(60);
declare @cmd nvarchar(max);
declare @message_type_name nvarchar(256);
declare @message_body varbinary(max);
declare @dialog uniqueidentifier;
set @dbname = (select...
June 23, 2010 at 3:41 pm
Using a common table expression you can also do neat tricks. I've interpreted your task as "return the next-to-last word from each of the /-separated list of words". In these...
June 23, 2010 at 2:58 pm
Of course it's possible:
use tempdb
go
create table dbo.testresults (
username nvarchar(128)not null,
answer1 varchar(10) null,
answer2 varchar(10) null,
answer3 varchar(10) null,
answer4 varchar(10) null,
answer5 varchar(10) null,
answer6 varchar(10) null,
answer7 varchar(10) null,
answer8 varchar(10) null,
answer9 varchar(10) null,
answer10 varchar(10) null
);
insert...
March 1, 2010 at 7:18 am
Adding a top clause to the sub query will break the intended functionality: only the first page will return data. You could put a top clause in the outer query,...
January 4, 2010 at 5:42 am
You don't need any dynamic sql for this as I already demonstrated. You just give your procedure 1 parameter; the xml string with the names that you are looking for....
August 24, 2009 at 12:13 am
create table test
(
EmpID int,
EmpName varchar(20)
);
create table TempEmployee
(
EmpID int,
EmpName varchar(20)
);
insert into test
select 1,'Ashly'
union all
select 2,'Bob'
union all
select 3,'Charles'
declare @xmlNames xml;
select @xmlNames = '
Bob
Charles';
insert dbo.TempEmployee( empID, empName)
select tbl.empID, tbl.empName
from dbo.test tbl
where tbl.empName in...
August 18, 2009 at 5:41 pm
SQL provides us with a very powerfull tool to do this too: the union all statement. You can use this to generate, for example, a single statement that inserts multiple...
August 18, 2009 at 5:11 pm
have a look at sp_executesql in BOL. That will give you all the information you need.
Just a tip: prefix your strings with an N to get nvarchar string constants.
August 2, 2009 at 1:02 am
Something like this?
(A word of free advice: Be carefull converting the createdate column, this will often make the engine use a table scan to answer your questions.)
use tempdb
go
create table...
May 6, 2009 at 8:04 am
I ran in the exact same issue and have filed it as a bug on microsoft's connect site. I found that SQL server 2008 does support datetime in sql:variable(), but...
February 25, 2009 at 8:16 am
Or using a sub query you can do this. The following will return all rows that have the top most value.
SELECT t.TheDate, t.TheGuid
FROM TheTable t
INNER JOIN (
...
January 7, 2008 at 1:06 pm
If you give us the structure of your tables we'll be able to give you the query. You can get over the 'distinct' issue easily using sub-queries. i.e. you'll be...
January 7, 2008 at 5:49 am
Viewing 15 posts - 406 through 420 (of 427 total)