Forum Replies Created

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

  • RE: Read Error Log

    Hi,

    You can specify the FromTime and EndTime in the extended stored procedure.

    see the syntax below.

    xp_readerrorlog 1,1,search1, search2, fromtime, endtime, asc/desc

    Thanks,

  • RE: Please help with SQL code

    Hi,

    Here is the example to use CTE(Common Table Expression)

    You can use CTE to get unique country codes.

    -- Lets say this sample table holds your final data with duplicate codes

    Declare...

  • RE: GENERATE INSERT QUERY

    Hi balagi,

    Are you using stored procedure? or building insert script in other programmin language.

    try this

    1. declare variables.

    2. set your values

    3. insert

    declare @Id int,@Name varchar(50),@type int,@Email varchar(100),@Versionnumber varchar(10)

    --SET YOUR...

  • RE: how to find max amount

    Hi, Change @t to your table name and your columns for id, amount, adate

    WITH cte AS

    (

    SELECT ROW_NUMBER() OVER (PARTITION BY id ORDER BY adate desc) AS ROW,...

  • RE: how to find max amount

    Hi ,

    Try this script

    Declare @t table(id int, amount varchar(10),adate datetime)

    insert into @t select 1,'120', dateadd(day,-1,getdate())

    insert into @t select 2,'121', getdate()

    insert into @t select 1,'122', dateadd(day,-2,getdate())

    insert into @t select 4,'123', getdate()

    insert...

  • RE: concatenating columns

    Hi,

    Create INSERT Trigger on the table and put previous script.

  • RE: GENERATE INSERT QUERY

    Hi,

    I dont think you can do this from sql server 2000.

    If you have 2005 management studio then do the below to generate insert query

    Right click on a table then choose...

  • RE: How to make Automated?

    Hi,

    I would suggest you to create stored procedure with your script and setup job in SQL server agent.

    For multiple database just update databasename1 --> your db name

    SELECT OBJECT_NAME(A.object_id) AS...

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