Forum Replies Created

Viewing 15 posts - 46 through 60 (of 87 total)

  • RE: Script to Create SQL Server Logins. Not the Database Users

    Right click on any DB -> All Tasks -> Generate SQL Script

    goto tab "options" and check "Script SQL Server logins (Windows Ans SQL Server logins)"

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Parsing error on stored procedure

    try change

    set @sql = 'SELECT TABLE_NAME = NAME FROM ' + @dbname + '..SYSOBJECTS WHERE XTYPE =' + '''' + 'U' + ''''with

    set @sql = 'SELECT TABLE_NAME = NAME FROM...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Sum rows of data from various tables in single column

    SELECT

    [Salesperson]

    , [Cust ID]

    , [Customer]

    , MAX([Sales1]) [Sales1]

    , MAX([Sales2]) [Sales2]

    , MAX([Sales3]) [Sales3]

    FROM (

    SELECT

    OSLP.SlpName AS [Salesperson]

    , OINV.CardCode AS [Cust ID]

    , OINV.CardName AS [Customer]

    , SUM(INV1.LineTotal) AS [Sales1]

    , NULL AS [Sales2]

    , NULL AS[Sales3]

    FROM

    OSLP...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Copy rows from one table to another with identity columns

    I see only one solution is to add another column to TableA of destination server

    Copy from DB1 to DB2

    Insert Into TableA(... , DB1_ItemID )

    Select ..., ItemID From DB1..dbo.TableA

    Insert Into...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Copy rows from one table to another with identity columns

    if

    Both will have some rows in them already

    it will throw an error

    I Have Nine Lives You Have One Only
    THINK!

  • RE: sql commando to see the 5 greater tables (size) in a database

    modified code of sp_spaceusage

    select

    t.name,

    rows = convert(char(11), rows),

    --reserved: reserved

    reserved = ltrim(str(reserved * d.low / 1024.,15,0) +

    ' ' + 'KB'),

    --data: dpages+ used

    data = ltrim(str((dpages + used) * d.low / 1024.,15,0) +

    ' '...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Copy rows from one table to another with identity columns

    SET IDENTITY_INSERT

    Allows explicit values to be inserted into the identity column of a table.

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Pivot with possible multiple rows

    select

    DFES

    , MAX(CASE WHEN PHASE='1' THEN ACTIVITYNAME END) as [PHASE_1]

    , MAX(CASE WHEN PHASE='2' THEN ACTIVITYNAME END) as [PHASE_2]

    , MAX(CASE WHEN PHASE='3' THEN ACTIVITYNAME END) as [PHASE_3]

    , MAX(CASE WHEN PHASE='4' THEN...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Crosstab query in SQL 2000

    SELECT

    ID

    , MAX(CASE WHEN SEQ = 1 THEN CODE ELSE NULL END) CODE1

    , MAX(CASE WHEN SEQ = 2 THEN CODE ELSE NULL END) CODE2

    , MAX(CASE WHEN SEQ = 3 THEN CODE...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    Last row

    [CompanyID] - EF

    [ItemCode] - 123456

    [Description] - 2 x Tennis balls, Rackets and bags

    [SupplierAccount] - TNSRCKBL

    [PONumber] - T763781

    [POLineNumber] - 3

    [OutstandingQty]...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    Just that the last row has a comma in item description and I need to insert the data with the comma that is in there. The problem is it considers...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    Hi, dcs09

    I have changed fmt-file and received result (see attachments)

    CREATE TABLE [dbo].[Out_orders_Table2](

    [CompanyID] [nchar](3) NULL,

    [ItemCode] [nchar](9) NULL,

    [Description] [nchar](38) NULL,

    [SupplierAccount] [nchar](9) NULL,

    [PONumber] [nchar](8) NULL,

    [POLineNumber] [numeric](3, 0) NULL,

    [OutstandingQty] [numeric](6, 0) NULL,

    [DueDate] [nchar](30) NULL,

    [StockRoom]...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    can you upload csv-file to the forum?

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    open it as a delimited file with both commas and tab as delimiters

    is there both commas and tab as delimiters in each line in the file?

    in this case? you...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    try to use simple "bulk insert"

    bulk insert [dbo].[Out_orders_Table2] from 'path to file' with (fieldterminator = ',')

    I Have Nine Lives You Have One Only
    THINK!

Viewing 15 posts - 46 through 60 (of 87 total)