Viewing 15 posts - 16 through 30 (of 37 total)
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...
June 3, 2014 at 9:34 am
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...
June 3, 2014 at 8:55 am
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...
June 3, 2014 at 8:40 am
What is the value of @SQLSTATEMENT before it is executed?
June 3, 2014 at 7:53 am
SET @StopTime = DATEADD(MINUTE,-1,CAST(CAST(GETDATE() AS date) AS datetime)+1);
June 3, 2014 at 6:59 am
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.
June 3, 2014 at 6:49 am
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')...
June 3, 2014 at 6:29 am
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...
April 17, 2014 at 9:57 am
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...
April 11, 2014 at 2:36 am
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...
April 9, 2014 at 9:09 am
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...
April 5, 2014 at 2:19 am
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...
April 4, 2014 at 10:33 am
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...
April 4, 2014 at 8:48 am
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...
March 30, 2014 at 11:32 am
Viewing 15 posts - 16 through 30 (of 37 total)