Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: get slice data of query

    mmm I was thinking too hard...u're absolutely right...

    I thought there is a specific key syntax for slicing the data, like 'union' ....

    thank you very much for your answer

  • RE: union versus where condition with "OR" operator

    thanks guys for all your response...

    In some case, the requirements need to view data like that, I mean to view data where contains a key word.

    Such as, I want to...

  • RE: union versus where condition with "OR" operator

    thanks for ur response....

    so, union is better than "where condition using OR operator" ?

  • RE: Locks Rows in Table when use View

    try to read transaction locking in BOL...

    I think the best is to use "set transaction isolation level read committed" in your query

  • RE: Deleting files in a directory

    suppose you want to delete file test.txt in directory c:\tes.txt, so just copy this code :

    exec master..xp_cmdshell 'del  C:\tes.txt'

    xp_cmdshell  --> this command is used to do any operation data like...

  • RE: query all objects by user

    try this ....

    declare @name sysname

    set @name = 'yourUserDB'

    select * from dbo.sysobjects

    where uid = (select uid from master.dbo.sysusers

    where name like @name)

     

    cheers......

    alexia

  • RE: selecting data from another server

    The easiest ways is to query from Query Analyzer, with first connect to the server you want to query data.

    The other ways, is to add linked server in your master...

  • RE: copy rows within a table

    try this one :

    declare @colA varchar(50),@colB varchar(50),@colC varchar(50)

      select @colA=colA,@colB=colB,@colC=colC from tblX

       where id = '1' -- this is the one that you want to get the data from

    update tblX

    set...

  • RE: TO UPDATE THE VALUES IN ONE SHOT

    you should make the parameter input like this from the application code : '''101''','''103''','''105'''

    then, create a stored procedure to update using "IN" clause..

    create procedure procA (@inputParameter varchar(255))

    as

    begin

    declare

  • RE: distinct versus group by

    thanks guys...for all your inputs...

    I think I prefer  "distinct" to remove duplicate records...but when I need to count or do some aggregate...

  • RE: Web for studying Data Warehouse

    okay, I'll try that one...

    thanks...

  • RE: prompting for values when opening a view

    You should use stored procedure

    for example:

    create procedure getData

    (@dateBegin datetime,@dateEnd datetime)

    as

    begin

    select name,address,birthdaydate from tblX

     where birthdaydate between @dateBegin  and @dateEnd

     

    end

     

    execute getData '1980-01-01','1981-01-01')

  • RE: PAGINATION PLEASE HELP

    You could use this SP

    This SP is paging 20 rows per page...if you want to change how many rows in one page, just change the number '20' in this SP...

  • RE: sql

    Try this :

    USE NorthWind

    CREATE PROC GetRegions_XML

     @empdata text

    AS

    begin

    DECLARE @hDoc int

    DECLARE @tbl TABLE(state VARCHAR(20))

    exec sp_xml_preparedocument @hDoc OUTPUT, @empdata  

    INSERT @tbl

    SELECT StateName

    FROM OPENXML(@hDoc, 'root/States')  

     WITH (StateName VARCHAR(20))

    EXEC sp_xml_removedocument @hDoc  

    SELECT...

  • RE: create table as select

    maybe you could try like this in your SP or query:

    create table #temp(@field1 int,@field2 varchar(10))

    insert into #temp

           select a,b from tableFrom

     

    select * from #a

    then, when you're not using the...

Viewing 15 posts - 1 through 15 (of 16 total)