Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)

  • RE: dynamic sql

    DECLARE @DB varchar(25)

    SET @DB = 'tempdb'

    DECLARE @Tablename varchar(50)

    SET @TableName = 'test12'

    DECLARE @strSQL nvarchar(4000)

    SET @strSQL = 'Create table '+@DB+'.dbo.'+@TableName+' ([clmnt_idno] varchar (255) NULL)'

    exec sp_executesql @strSQL

     

    This may solve ur problem.

  • RE: Need to calculate %

    Hi,

    IIF(Fields!Sales.Value>0,                        

    Fields!Margin.Value)/ IIF(Max(Fields!Sales.Value),

    0)

     

    Try with this.

     

    Thanks & Regards,

    Kumar KP.

  • RE: Message box in sql reports

    Hi,

    if u r hectic with msgbox remove the msgbox and keep the action what u want to commit over there.

     

    Thanks & Regards,

    Kumar kP

  • RE: select query- invalid characters

    Hi,

    This function may helpful  u  to retrieve the data without cleansing the data.

    Create FUNCTION INTCHECK

    (@addressno varchar(20)) returns integer

    as

    begin

     declare @intIncr  integer , @bool integer

     set @intIncr = 1

     

     while  @intIncr  < = len(@addressno)

     Begin

      if not (ascii(substring(ltrim(rtrim(@addressno)),@intIncr,1 ))...

  • RE: query to find tables with indexes

     

    Pls. check whether this query may help u or not.

     

    select so.name,

    si.name from sysobjects so

       join sysindexes si on  so.id = si.id where so.xtype !='S'

     

    Thanks & Regards,

    Kumar KP

  • RE: Having problems calling a procedure which returns output variables from another proc.

    Use Northwind

    Go

    CREATE PROC TEST(

    @DATABASENAME VARCHAR(30),

    @COUNTOUT INT OUTPUT

    )

    AS

    BEGIN

    DECLARE @v_SQL nVARCHAR(4000)

    DECLARE @COUNT INT

    SET @V_SQL='SELECT @COUNT=COUNT(*) FROM '+@DATABASENAME+'..Authors'

    EXEC SP_EXECUTESQL @V_SQL,N'@COUNT INT OUTPUT',@COUNT OUTPUT

    SET @COUNTOUT=@COUNT

    END

    CREATE PROC CALL

    AS

    BEGIN

    DECLARE @SQL NVARCHAR(100)

     

    SET @SQL= 'DECLARE...

Viewing 7 posts - 1 through 7 (of 7 total)