Forum Replies Created

Viewing 15 posts - 121 through 135 (of 154 total)

  • RE: Need Help with SQL statement

    try this query

    SELECT p.sku, p.name, p.Quantities, p.price, M2.QTY, M2.Cost, M2.UpdateDate

    FROM product p

    (

    SELECT Sku ,

    MAX(UpdateDate) As UpdateDate,

    FROM MonthlyInv

    WHERE UpdateDate <= CONVERT(datetime,'9/20/2001 2:26:57 AM')

    GROUP...

  • RE: Creating view dynamically ?

    That Should be SET @cmd = @cmd + <string>

  • RE: Rounding Question???

    not sure whether this is what you need but , for rounding off amounts in my systems i keep a field which stores how many decimals to round of to...

  • RE: Select into #temp_table and deadlocks...

    never had any problems with creating temp tables explicitly , i prefer it to the select into method , as Steve pointed out this was a problem with 6.5

    personally i...

  • RE: Passing a value from a stored procedure

    CREATE PROCEDURE SP_SMTPSTATS @RETCODE INT OUTPUT

    AS

    SELECT @RETCODE = COUNT (*)

    FROM smtpstats

    Where clienthost = "10.0.0.64" AND Operation = "Data" AND bytesrecvd > 200 AND

    bytesrecvd < 2000

    you can call this using...

  • RE: Drop Temp. Table

    doesnt DROP TABLE #123 work???

    usually if you're using temp tables in a proc - they are automatically dropped as soon as the execution is complete

  • RE: triggers problem

    oh and you would also need to loop thru all records in inserted . currently the trigger is geared to manage single records only.. read up on triggers in BOL

    ...

  • RE: triggers problem

    this query is the problem

    select @city = city

    from testcity --

    This should be

    select @city = city

    from inserted

    also it would be better if you replaced this

    if @city in (select city...

  • RE: Encrypting Stored Procedures

    i've not heard of any "tools" as such but the encryption algorithm for version 7 and 6.5 are pretty straightforward to crack. 2000 uses a different encryption algorithm and has...

  • RE: Ident_current and Dynamic SQL

    This should work

    declare @qry nvarchar(500)

    declare @qry1 nvarchar(500)

    declare @tabName nvarchar(50)

    declare @x int

    set @tabName= 'tblCenters'

    set @qry = ('select @ident = ident_current('''+@tabName+''')')

    set @qry1 = ('@ident int output')

    exec sp_executesql @qry , @qry1 ,...

  • RE: Sending SP output to a text file

    you can use the osql utility

    here's a example of how to call it from Sql Server

    xp_cmdshell 'osql /U [User] /P [Password] /d [Database] /S [Server] /Q "sp_helpdb" -o C:\HelpDb.txt'

    you can...

  • RE: using (use)

    only way to reference objects of another database in a proc is to use the full name of the object i.e server.database.user.object

    you can possibly use dynamic sql .. i don't...

  • RE: Dynamic TSQL in trigger using values from inserted

    why don't you take the values from the inserted table into variables and build the insert statement with these variables instead of selecting from inserted

  • RE: Calling Stored procedure having cursor from ASP pa

    how about using a temporary table or a table variable .. insert the values in this table and at the end of the procedure just run a select on the...

  • RE: decryption

    have not tested this code for decrypting encrypted objects - this should work for sql 7.0 ,it uses the decrypt function .pass the object name and the proc should print...

Viewing 15 posts - 121 through 135 (of 154 total)