Forum Replies Created

Viewing 15 posts - 676 through 690 (of 1,494 total)

  • RE: t-sql to backup

    With dynamic sql enter two single quotes for each single quote in the string

    DECLARE @temp varchar(255) = 'backup database asdf to disk = ''H:\Backup\SQLTEST02\asdf.bak''';

    SELECT @temp;

    With the BACKUP command a variable...

  • RE: View or Function not updateable error with DELETE and CTEs

    I am glad you have a working solution however your test data is useless as it does not function as a test harness:

    1. At a very basic level, it does...

  • RE: View or Function not updateable error with DELETE and CTEs

    To get a good answer you should really take the time to post test data in a comsumable format (CREATE TABLE, INSERT) and the expected results.

    Your code looks far too...

  • RE: More Efficient Way For this T-SQL Query

    SELECT *

    FROM YourTable

    WHERE SnapshotDate > @from AND SnapshotDate < @to

    OR (SnapshotDate = @from AND hourkey > 2)

    OR (SnapshotDate = @to AND @to < 21)

  • RE: Generate script to restore log backups

    I have this old bit of js which may be of use:

    var fso = WScript.CreateObject("Scripting.FileSystemObject");

    var fldr = fso.GetFolder(".");

    var fenum = new Enumerator(fldr.files);

    var File_Array = new Array();

    var i = 0;

    while...

  • RE: Coalesce for a FQN?

    1. You should post test data in a consumable format:

    CREATE TABLE #t

    (

    Location_Id int NOT NULL

    ,Parent_Location_Id int NULL

    ,Location_type char(1) NOT NULL

    ,Location_name varchar(10) NOT NULL

    );

    INSERT INTO #t

    VALUES(1, NULL, 'F', 'ENGINTLAB')

    ,(33, 1, 'A',...

  • RE: Datetime conversion issue

    For casting to smalldatetime to work:

    1. The date range must be 1900-01-01 to 2079-06-06

    2. There must be no more than 3 decimal places with the seconds.

    Check you data to confirm...

  • RE: Datetime conversion issue

    I think you have to explicitly make your NULLs smalldatetime:

    CASE

    WHEN ISDATE(CAST([Inception Date] AS smalldatetime)) = 1

    THEN CAST([Inception Date] AS smalldatetime)

    ELSE CAST(NULL AS smalldatetime)

    END

  • RE: linked server

    SSIS is much more efficient.

    As I find SSIS fiddly to work with, I sometimes start development with linked servers and then move to SSIS once I have the correct logic.

  • RE: Incomplete Backups

    Run:

    RESTORE HEADERONLY FROM DISK = '<backup_file_location>';

    and see if the backups are compressed.

  • RE: sql db backup t-sql

    DECLARE @backupfile NVARCHAR(512) = N'W:\Backup\360_prod_'

    + REPLACE(REPLACE(REPLACE(CONVERT(varchar(16), CURRENT_TIMESTAMP, 120), '-', ''), ' ', ''), ':', '')

    + N'.BAK';

    BACKUP DATABASE DBName

    TO DISK = @backupfile

    WITH COPY_ONLY, INIT, SKIP, CHECKSUM, COMPRESSION, NAME = N'DBName-Full Database...

  • RE: Removing 2000 Compatibility Mode - New Problem

    Try 'ORDER BY JOB_Date' not 'ORDER BY a.JOB_Date'.

    The query should then be order by the JOB_Date expression.

  • RE: 32-bit legacy ODBC drivers vs 64-bit OS for SQL Server 2012

    Dennis Baldwin (3/11/2014)The wall I hit is marked by the "Microsoft OLE DB Provider for ODBC Drivers" when it attempts to call DSNs. So far, it look like that...

  • RE: 32-bit legacy ODBC drivers vs 64-bit OS for SQL Server 2012

    You should be able to setup 32bit DSNs by using the ODBCAD32.exe in the C:\Windows\SysWOW64 folder.

  • RE: SQL Backups not working

    I recently had a problem with some maintenance plans on a machine I sort of look after but do not control the access rights on.

    The problem was fixed by:

    SP_CONFIGURE 'ALLOW...

Viewing 15 posts - 676 through 690 (of 1,494 total)