Forum Replies Created

Viewing 12 posts - 16 through 27 (of 27 total)

  • RE: Referential Integrity - How to handle the following sitiuation

    John Rowan (10/15/2009)


    Ok, so the proper way to represent the many-to-many relationship between Customers and Addresses is to have the associative table CustomersAddresses. Agreed. But you do not...

  • RE: Referential Integrity - How to handle the following sitiuation

    John,

    From the short description of the problem it seems like every time you change an association between a customer and an address, you have to find all the records...

  • RE: Referential Integrity - How to handle the following sitiuation

    If I am understanding it correctly you have a many-to-many relationship between customers and addresses. If that is the case you may be better off if you create a third...

  • RE: datetime 0.33 ms rounded problem

    You can use Datetime2 if you are running your database in SQL 2008. It has a 100 nanoseconds accuracy.

  • RE: Table variable in Dynamic SQL

    GilaMonster (10/8/2009)


    Al-279884 (10/8/2009)


    that is the table declaration as a parameter, not as a variable within your current session. The idea is that sp_executesql opens up a new session and runs...

  • RE: Table variable in Dynamic SQL

    Bhuvnesh (10/8/2009)


    no

    if you see my first mail

    it includes ::::::::::

    SET @ParamDef = N'

    @acct_id int,

    @tblRules table (

    idx int,

    thank_you_page_rule_stub uniqueidentifier,

    trigger_value_filter_id smallint,

    trigger_all_true_flag smallint

    ),

    @thank_you_page_stub ut_stub'

    it contains "@tblRules...

  • RE: Table variable in Dynamic SQL

    You are passing a table variable to sp_executeSQL that does not exist at the time of the call. You will need to declare the table variable first:

    DECLARE

    @ParamDef NVARCHAR(MAX),

    @redirectSQL NVARCHAR(4000),

    @acct_id...

  • RE: Run EXE from Stored Procedure

    try using full path of the executable. So instead of

    SET @sqlcmd = 'WinWSSList.exe'

    use

    SET @sqlcmd = 'C:\WinWSSList.exe'

    @sqlcmd session may open a command prompt somewhere in the binn folder of the...

  • RE: Wierd implicit casting by SQL Server

    The "ELSE" condition on your CASE statement sets the value to 0 (INT), which is probably forcing an implicit cast from varchar to int. Try changing to '0' and see...

  • RE: Pagination with ordering in SQL 2005

    You can remove the big CASE clause within the CTE and build the query dynamically. Something like below...

    Create procedure dbo.Product_SEL_PD-- 'code','desc',10,1

    @SortColumn nvarchar(255),

    @SortDirection nvarchar(4) = 'asc' ,

    @rowsPerPage int =...

  • RE: Updating Rows with same values

    maybe something like this...

    UPDATE A

    SET A.Ind = B.Ind

    FROM

    [yourTable] A inner join

    [yourTable] B ON A.Id = B.Id

    WHERE

    B.Ind = 'Yes'

  • RE: How to add "dot" after every three digits in a number in sql 2005

    Depending on how big your numbers would be you could convert to [money] and then to string. For instance:

    declare @BigNumber bigint

    set @BigNumber = 12304208483483

    select replace(replace(convert(Varchar(50), cast(@BigNumber as Money), 1), ',',...

Viewing 12 posts - 16 through 27 (of 27 total)