Forum Replies Created

Viewing 15 posts - 16 through 30 (of 38 total)

  • RE: Backup script from 2K not creating files on 2K8

    Yes, but you need to run that too, not just the print. If you execute the proc in SSMS then you will see the output of the PRINT statement...

  • RE: Backup script from 2K not creating files on 2K8

    You can't just run the print statement as it's referencing a variable. It's the variable @SQLStatement that the error says you must declare. How are you executing this...

  • RE: Backup script from 2K not creating files on 2K8

    You have a PRINT statement after the SET statement:

    SET @SQLSTATEMENT = 'BACKUP '+@BTYPE+ @DBNAME+' TO DISK ='''+@BAKPATH+@@SERVERNAME+'_'+@DBNAME+'_'+@TIMESTAM+'_AUTO'+@BTYPEEXT+''''

    PRINT 'SQL STATEMENT'

    PRINT '-------------'

    PRINT @SQLSTATEMENT

    If you aren't seeing this statement, then one of...

  • RE: Backup script from 2K not creating files on 2K8

    What is the value of @SQLSTATEMENT before it is executed?

  • RE: Profiler Stop Time at 11:59PM

    SET @StopTime = DATEADD(MINUTE,-1,CAST(CAST(GETDATE() AS date) AS datetime)+1);

  • RE: Backup script from 2K not creating files on 2K8

    The parameter @BAKPATH will be NULL if unassigned, not a blank space. Change the following line:

    if @BAKPATH=''

    to

    if @BAKPATH IS NULL

    The same will need to be done for @ZIPPATH.

  • RE: get max id in sql with xml

    Try the following:

    --Using a table variable.

    DECLARE @data table(col1 XML);

    INSERT @data

    SELECT

    '<data>

    <test>

    <ID>1</ID>

    <Value>100</Value>

    </test>

    <test>

    <ID>2</ID>

    <Value>200</Value>

    </test>

    <test>

    <ID>3</ID>

    <Value>300</Value>

    </test>

    </data>';

    WITH Result

    AS

    (SELECT a.col.value('ID[1]','int') AS ID,

    a.col.value('Value[1]', 'int')...

  • RE: Metrics to determine switch to Enterprise

    If you're considering upgrading to SQL 2012, be aware that the licensing model is changing to per core. Another factor you may want to look at apart from maximum...

  • RE: Table Partitioning

    Can you post the DDL for the original table and the new table without the partitioning and with a CSV file with the record in question? Are you doing...

  • RE: Table Partitioning

    From the DDL you posted, the STUDENT_ATTENDANCE table doesn't have a primary key, only the backup table does. Let's assume it does though and I suggest creating the PK...

  • RE: Table Partitioning

    What happens if you try to create the primary key on the backup table?

    What is the result of the following query?

    SELECT AbcID, COUNT(*) FROM backuptable

    GROUP BY AbcID

    HAVING COUNT(*) > 1;

    Can...

  • RE: Table Partitioning

    It depends on the growth projection for the table really. If it is going to stay at 23m rows then a clustered index is fine but if it's a...

  • RE: Table Partitioning

    Where are you loading the data from? Does the source table not have the same unique index? Are you loading into an empty table? What is the...

  • RE: Execution Plan what to look for

    Can you post the execution plans?

  • RE: Restore from "Backup" Table

    You can just do a "select * into" to create the backup tables then script the PK and FK and create them on the backup tables. If you need...

Viewing 15 posts - 16 through 30 (of 38 total)