User Profile

Collapse

Profile Sidebar

Collapse
gfajardo
gfajardo
Last Activity: Jan 17 '08, 08:24 PM
Joined: Nov 16 '07
Location: Bogotá
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • gfajardo
    replied to how to Calcullate Two Dates
    Hi
    here any sample for datediff function and adding days
    run all script in query analyzer

    Code:
    declare @date1 datetime
    declare @date2 datetime
    
    set @date1='20070101'
    set @date2=getdate()
    
    --datediff returns an int
    select datediff(day,@date1,@date2)
    
    --adding days to date type variable only
    select  @date1 + 30
    Good luck
    See more | Go to post

    Leave a comment:


  • gfajardo
    replied to Ms Sql Stored Procedure
    Hi
    I think that must be the procedure calling.
    try


    Code:
    declare @counter int
    exec prcWorker @counter output
    print @counter
    You should consider another strategy for the table
    For example an identity ID


    Code:
    CREATE TABLE [dbo].[worker] (
    	[id] [int] IDENTITY (1, 1) NOT NULL ,
    	[wid] [char] (5) NULL ,
    	[wfname] [varchar] (15) NULL ,
    	[wlname]
    ...
    See more | Go to post

    Leave a comment:


  • gfajardo
    replied to export from sql to excel
    Only you need use Bcp on query analyzer

    Code:
    [B]bcp [/B]"Select * from Northwind.dbo.orders" queryout c:\output.xls -c -S"nameserver" -U"sa" -P"password"
    ...
    See more | Go to post

    Leave a comment:


  • Most easy and fast.
    Aply only for duplicate rows in all columns.
    be carefully with the indexes and foreign key before to drop the original table.

    In Code sql server 2000:

    [code=sql]
    select distinct * into temp_table from <original_table >
    drop <OrigionalTable >
    sp_rename temp_table, original_table
    [/code]
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...