Forum Replies Created

Viewing 15 posts - 3,931 through 3,945 (of 6,397 total)

  • RE: Adding/subtracting columns to get total

    One or more of the columns must be null.

    You can handle it by using ISNULL

    Something like below

    (ISNULL(Vehicle.value,0) + ISNULL(Vehicle.Extras_Value,0) + ISNULL(Vehicle.Expenses,0) + ISNULL(Vehicle.Another_Tax,0) + ISNULL(Vehicle.Other_Extras_Value,0)) AS NetCost

  • RE: .csv format from ssms

    Make your inserts into your tempoary table a sub query

    something like this

    declare @CurrentSchoolYear int,

    @dtBeginDateIA3 datetime,

    @dtEndDateIA3 datetime,

    @dtBeginDateIA2 datetime,

    @dtEndDateIA2 datetime,

    @dtBeginDateIA1 datetime,

    @dtEndDateIA1 datetime,

    @dtBeginDateIA datetime,

    @dtEndDateIA datetime

    select @CurrentSchoolYear = iCurrentSchoolYearCode from tblSysVariables

    SELECT @dtBeginDateIA3 =...

  • RE: .csv format from ssms

    please provide your query

  • RE: .csv format from ssms

    select column1,',',column2,',',column3 from #temp

    then export query results to file using ssms

  • RE: Down grade from sql 2008r2 Enterprise to Standard

    Jobs, logins, linked servers, server side DDL triggers, logon triggers, SSIS packages, database mail etc etc will all be lost.

    I have attached a powershell script which will export all SSIS...

  • RE: Error: 18456, Severity: 14, State:38

    Does the user have access to master

    Remembers you detailed error exists if grant SA rights.

    What is the default database for the user? Does that exist?

  • RE: Error: 18456, Severity: 14, State:38

    Run a trace for failed logins and see what database the failure is on.

    Then check to see if the DB exists or if the user has access to the DB.

  • RE: .csv format from ssms

    You can use the wizard to run a query to export to a flat file.

    You can also run the query to file, but to save it as CSV, you would...

  • RE: create new database

    Speak to your DBA and ask them to create you a database and grant you the nessesary access to the database to perform your duties.

    Your permissions are not high enough...

  • RE: only get data with special pattern

    So the first 4 will always be ABCD, then anything after that should be numeric?

    DECLARE @Codes TABLE (Code VARCHAR(100))

    INSERT INTO @Codes VALUES

    ('ABCD000000001'),

    ('ABCD000000002'),

    ('ABCD000000003'),

    ('ABCDT000000001'),

    ('ABCD00000000T1'),

    ('ABCD00000T0001')

    SELECT

    Code

    FROM

    @Codes

    WHERE

    ISNUMERIC(RIGHT(Code,(LEN(Code)-4))) = 1

    ORDER BY

    Code DESC

  • RE: convert row to column in plsql

    raghuldrag (8/16/2012)


    its k tell in server 2000 style

    What you want in T-SQL is a cross tab or pivot query.

    Two good articles for T-SQL Cross-Tabs and pivot queries in my signature.

    If...

  • RE: convert row to column in plsql

    erics44 (8/16/2012)


    the output would be the same using sql or plsql

    Output would be the same yes you are correct.

    The syntax to get the output will not be the same.

    PLSQL <>...

  • RE: create new database

    You need SysAdmin, explicit permissions to run CREATE DATABASE or the dbcreator fixed server roles assigned to the login trying to create the database in order for it to be...

  • RE: Maintenance Plan

    Problem is that your appending to the same backup file which never gets purged.

    Change the backup task to backup to a single file each time it runs, then you can...

  • RE: Successful logging Auditing

    Logon trigger logging to the event log.

    Login auditing changed from "Both failed and successful logins" to "Failed Logins only" without restarting the SQL server.

Viewing 15 posts - 3,931 through 3,945 (of 6,397 total)