Forum Replies Created

Viewing 15 posts - 406 through 420 (of 427 total)

  • RE: What if we dont end the conversation on the initiator side??

    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...

  • RE: What if we dont end the conversation on the initiator side??

    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...

  • RE: Using Waitfor\Receive in a Dynamic Sql Statement

    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...

  • RE: Using Waitfor\Receive in a Dynamic Sql Statement

    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...

  • RE: patindex problem

    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...

  • RE: select count

    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...

  • RE: Managing Large Data Sets in SQL Server 2005 and 2008

    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,...

  • RE: Dynamic WHERE clause

    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....

  • RE: Dynamic WHERE clause

    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...

  • RE: Sending multiple rows to the Database from an Application: Part I

    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...

  • RE: execute sp with parameter

    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.

  • RE: display 0.00 when no records found

    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...

  • RE: aagghh! More XQuery trouble

    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...

  • RE: How to get distinct records

    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 (

    ...

  • RE: Problem in Query

    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...

Viewing 15 posts - 406 through 420 (of 427 total)