Forum Replies Created

Viewing 15 posts - 2,431 through 2,445 (of 2,894 total)

  • RE: Export to excel errors

    The length of "'COPY /Y D:\TEST.xls /B D:\'+ @XPRACTICE +'.XLS'" when @XPRACTICE = 'SQLSERVERCENTRALFORUM' will be 51.

    Therefore you have cut-off in result. Don't be greedy :-D, declare @FILENAME as VARCHAR(255)...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Export to excel errors

    andyc209 (8/10/2010)


    i am creating a proc that exports data to excel then emails it using database mail but have stumbled on a couple of errors.

    first when i COPY a template...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Changing Non-ANSI Standard JOINS to ANSI Standards

    I wonder what you expect from your current query?

    It is kind of LEFT JOIN, but you filtering results for A.COL2 = B.COL2, why bother to have A.COL1 *= B.COL1?

    Your...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Can T-SQL be used for reporting on Surface Area Configuration properties for Analysis Service and Reporting Services?

    I believe that Surface Area Configuration settings are stored in the Windows registry, or, may be some in config files but not in the Database.

    Theoretically speaking you can use T-SQL...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Procedure to select and insert

    transfering (8/9/2010)


    I'd like to write a procedure that will take the data from an 'Import' table with Select (Id, Name, City, Salary) and update / insert that data in another...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: generate insert statements with data

    You can generate INSERT script using VARBINARY datatype. Read the article by Oleg Netchaev:

    http://www.sqlservercentral.com/articles/T-SQL/66987/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: update

    I need to know more details in order to help you!

    1. Are values in revno column unique in OBBEAVER.USPA_check.dbo.RevID table? PK or Unique index? DDL of OBBEAVER.USPA_check.dbo.RevID whould help.

    2. What...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: update

    Tara-1044200 (8/6/2010)


    I still doubt if my query is correct for the logic i have given because i tried this query on a table of 50k records keeping them in transaction...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: update

    If only the possible values in yuor dpaid column are 0 or 1 then you can do:

    update TOP (10000) dbo.Adm_History2

    set fixpaid = abs(rc.dpaid-1)

    from dbo.Adm_History2 as ht inner join

    OBBEAVER.USPA_check.dbo.RevID rc...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to Write automatic trigger on a specified time in sql server 2005 Express

    You write a query you want (or you can wrap it into stored proc), then,

    using SQL Server Management Studio, you can create a job in SQL Server Agent, which will...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to Write automatic trigger on a specified time in sql server 2005 Express

    That will not be called a "trigger"!

    You need to look into SQL Server Agent. You can create SQL Job which can be scheduled to run with requested frequency...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: generate the header after every unique rows

    I also recommend to change

    select name, 2 grp, DENSE_RANK() OVER(ORDER .....

    to:

    select DISTINCT name, 2 grp, DENSE_RANK() OVER(ORDER ...

    the above should make smaller cross joins

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Rolling 3 Weeks

    drew.allen (8/5/2010)


    ...

    From the following link: http://msdn.microsoft.com/en-us/library/ms180878.aspx#UsingOperatorswithDateandTimeDataTypes

    Date and Time Arithmetic Operators

    To add and subtract for all date and time data types, use DATEADD and DATEDIFF.

    ...

    You should read this article in full!

    You...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Too many CASE statements...how to avoid??

    Chris Morris-439714 (8/5/2010)


    CELKO (8/4/2010)


    ...Also, start using COALESCE() instead of ISNULL() ...

    Why is that, Joe? I use COALESCE() if I want to return the first non-null value from a comma-delimited list...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Rolling 3 Weeks

    drew.allen (8/4/2010)


    Even though dates are stored as real numbers, you really should be using DateAdd().

    Drew

    Why? Is it faster (for three rows)? Is any condition where code will produce wrong results?

    Looking...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 2,431 through 2,445 (of 2,894 total)