Forum Replies Created

Viewing 15 posts - 76 through 90 (of 422 total)

  • RE: Get date only and order by in correct way

    If the original data is a DATETIME (or other date datatype) there's no need to convert it to a varchar until after the sort. CAST the date value as DATE...

  • RE: Calculate tables in a schema

    Also available under System Views is the INFORMATION_SCHEMA collection which can give you all the information you need for any metadata in the the database.

    For listing out your table collection...

  • RE: Sum Negative Numbers

    See if any of this helps. I had to make a lot of guesses and changes to the sample data to get it to work.

    ;WITH

    cteGeneralLedger

    (GNLID,GNLCLIID,GNLCOAID,GNLFSMID,GNLBalanceBase)

    AS (

    ...

  • RE: Sql Server - Generate Scripts

    Minnu (7/15/2013)


    Hi Team,

    i want to generate Table with Data Scripts with Tasks > Generate Scritps,

    but i dont to all the records, i want only few records scripts based on...

  • RE: Error on Restore

    ramanathan.raman88 (7/15/2013)


    Hi,

    The file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\sample.mdf' cannot be overwritten. It is being used by database 'sample'.

    File 'sample' cannot be restored to 'C:\Program...

  • RE: How to take backup of Single table and how to restore?

    gaddamshiva (7/13/2013)


    Hi...

    How to take backup of Single table and how to restore? is there any query like database backup?

    shivakumar...

    This is a procedure I've been working on...it's...

  • RE: Find The Similar Matching String

    See article by Dwain Camps 2012/11/29

    http://www.sqlservercentral.com/articles/String+Manipulation/94365/[/url]

    His article on pattern matching may provide a solution. Based on your limited example, I came up with this

    script that works on that limited...

  • RE: GetDate() 5 Years ago without time formated 'YYYY-MM-DD'

    I didn't invent the code use in this function so can't take credit (or blame), but it comes in handy sometimes. I did turn it into an itvf and added...

  • RE: Check series is valid or not

    Here's another approach:

    Sample data:

    IF OBJECT_ID('tempdb..#tbl') IS NOT NULL

    DROP TABLE #tbl

    CREATE TABLE #tbl

    (

    ID INT IDENTITY

    ...

  • RE: XML Formatting Using SQL

    brickpack (7/12/2013)


    I actually need to automatically generate this file on a daily basis and upload it to an FTP site. I'm hoping that I can accomplish this whole process using...

  • RE: archive process

    Script out the create table statement for the table you need to

    copy WITHOUT ANY KEYS. the target table should be a HEAP.

    Script all of the necessary keys separately then apply...

  • RE: How to maintain an incrementing row id

    dwain.c (7/12/2013)


    Steven - BTW.

    If you do it the way you suggested, which is to break it into multiple SQL statements, you should consider 2 things:

    1. Wrap the SQL statements in...

  • RE: XML Formatting Using SQL

    brickpack (7/12/2013)


    I'm also having a hard time appending this to the top of the file:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    Any suggestions...?

    I usually hard-code any header info and append it manually to the XML...

  • RE: archive process

    I've used this exceptional FREE auditing solution to create not only an audit trail but adapted it for archiving at the same time as well. Yes, it's complicated, but the...

  • RE: MIN and MAX values with a subquery.

    Something like this?

    ;WITH DH_info (C_ID,H_Type,Name,A_Name,D_Date,D_Status,D_TYPE)

    AS

    (

    SELECT 1,'22','George','Washington','2012-01-09','U','23' UNION ALL

    SELECT 2,'33','John','Adams','2013-01-09','I','29' UNION ALL

    ...

Viewing 15 posts - 76 through 90 (of 422 total)