Hi All,
I installed one truetype fonts "Bar Code 39" in my PC under folder
c:\windows\fonts. I used this font for bar code print purpose. It can work
perfect if I print the report direct to printer, or export it into
TIFF/EXCEL format. However, if i want to convert the report into PDF file,
then I could not find the bar code in the PDF file.
Any idea?
Thanks in advance.
LukeTry installing the font on the server as well.
"news.microsoft.com" wrote:
> Hi All,
> I installed one truetype fonts "Bar Code 39" in my PC under folder
> c:\windows\fonts. I used this font for bar code print purpose. It can work
> perfect if I print the report direct to printer, or export it into
> TIFF/EXCEL format. However, if i want to convert the report into PDF file,
> then I could not find the bar code in the PDF file.
> Any idea?
> Thanks in advance.
> Luke
>
>|||Yes, I did. But it doesn't work. I have already put the font under
c:\windows\fonts in the reporting server side.
"FredG" <FredG@.discussions.microsoft.com> wrote in message
news:1F071C4C-B8F8-44D7-AF1C-17A70F6B4514@.microsoft.com...
> Try installing the font on the server as well.
> "news.microsoft.com" wrote:
>> Hi All,
>> I installed one truetype fonts "Bar Code 39" in my PC under folder
>> c:\windows\fonts. I used this font for bar code print purpose. It can
>> work
>> perfect if I print the report direct to printer, or export it into
>> TIFF/EXCEL format. However, if i want to convert the report into PDF
>> file,
>> then I could not find the bar code in the PDF file.
>> Any idea?
>> Thanks in advance.
>> Luke
>>|||You must have the font on the server to support rendering the
report correctly - sometimes, after you put a new font on a server,
you need to both:
= OPEN the font from the fonts control panel AND
= REBOOT the server before it 'knows' about the new font.
Reporting Services does not embed fonts in PDF files (which is a
great
lack).
Anyone viewing the report must have the same fonts you designed it
with, or you will see some font substitution.|||Reporting service does not embed fonts. So you need fonts on every
computer that the PDF is going to open.
For a decent barcode font, visit http://www.morovia.com/font/
Showing posts with label code. Show all posts
Showing posts with label code. Show all posts
Thursday, March 22, 2012
Tuesday, March 20, 2012
BAFFLED! Why won't this code work?!?!
Aaron and Tibor - Thank you for your replys.
Aaron, the tbl-vs-tblname issue and data type were silly mistakes -
thank you.
Tibor, so then making the entire table name a variable (rather than
just part of it) should solve the problem, right? The below code
attempts to make this change. Now getting the following error:
"Syntax error converting the varchar value 'tblIR_LB_' to a column of
data type smallint."
CREATE PROC CreateIRTables ( @.tblname varchar(50))
AS
DECLARE @.SQL varchar(999)
SET @.SQL = 'CREATE TABLE [dbo].[' + @.tblname + '] (
[dteDate] [smalldatetime] NULL ,
[sglSTDEV(upper)] [float] NULL ,
[sglSTDEV(lower)] [float] NULL ,
[intMA] [smallint] NULL ,
[dblPL] [float] NULL ,
[dblSTDEV] [float] NULL ,
[dblIR] [float] NULL ,
[intTotalDays] [int] NULL ,
[intExposure] [int] NULL ) ON [PRIMARY]'
EXEC (@.SQL)
DECLARE @.i smallint
DECLARE @.tblname varchar(50)
SET @.i = 1
WHILE (@.i <= 32)
BEGIN
SET @.tblname = 'tblIR_LB_' + @.i
EXECUTE CreateIRTables @.tblname
SET @.i = @.i + 1
ENDEXACT SAME PROBLEM, you've just moved it to a different place! You're
trying to add an integer to a string. You can't do this!
> SET @.tblname = 'tblIR_LB_' + @.i
Should be
SET @.tblname = 'tblIR_LB_' + CONVERT(VARCHAR(12),@.i)|||i think you are chasing a red herring, but I wil point out this error :)
SET @.tblname = 'tblIR_LB_' + @.i
^ @.I is a small int
SET @.tblname = 'tblIR_LB_' + CAST(@.i As varchar)
My suggestion to see what is happening .... return your @.SQL as an output
paramer and print it each time.
if it *was* giving you the error on tblIR_LB_2 then I assume tblIR_LB_1
worked? So, see what is happening by looking at the @.SQL. PRINT it as an
output variable and run the code directly.
Good luck.
John Scragg
"Butaambala" wrote:
> Aaron and Tibor - Thank you for your replys.
> Aaron, the tbl-vs-tblname issue and data type were silly mistakes -
> thank you.
> Tibor, so then making the entire table name a variable (rather than
> just part of it) should solve the problem, right? The below code
> attempts to make this change. Now getting the following error:
> "Syntax error converting the varchar value 'tblIR_LB_' to a column of
> data type smallint."
> CREATE PROC CreateIRTables ( @.tblname varchar(50))
> AS
> DECLARE @.SQL varchar(999)
> SET @.SQL = 'CREATE TABLE [dbo].[' + @.tblname + '] (
> [dteDate] [smalldatetime] NULL ,
> [sglSTDEV(upper)] [float] NULL ,
> [sglSTDEV(lower)] [float] NULL ,
> [intMA] [smallint] NULL ,
> [dblPL] [float] NULL ,
> [dblSTDEV] [float] NULL ,
> [dblIR] [float] NULL ,
> [intTotalDays] [int] NULL ,
> [intExposure] [int] NULL ) ON [PRIMARY]'
> EXEC (@.SQL)
>
> DECLARE @.i smallint
> DECLARE @.tblname varchar(50)
> SET @.i = 1
> WHILE (@.i <= 32)
> BEGIN
> SET @.tblname = 'tblIR_LB_' + @.i
> EXECUTE CreateIRTables @.tblname
> SET @.i = @.i + 1
> END
>
Aaron, the tbl-vs-tblname issue and data type were silly mistakes -
thank you.
Tibor, so then making the entire table name a variable (rather than
just part of it) should solve the problem, right? The below code
attempts to make this change. Now getting the following error:
"Syntax error converting the varchar value 'tblIR_LB_' to a column of
data type smallint."
CREATE PROC CreateIRTables ( @.tblname varchar(50))
AS
DECLARE @.SQL varchar(999)
SET @.SQL = 'CREATE TABLE [dbo].[' + @.tblname + '] (
[dteDate] [smalldatetime] NULL ,
[sglSTDEV(upper)] [float] NULL ,
[sglSTDEV(lower)] [float] NULL ,
[intMA] [smallint] NULL ,
[dblPL] [float] NULL ,
[dblSTDEV] [float] NULL ,
[dblIR] [float] NULL ,
[intTotalDays] [int] NULL ,
[intExposure] [int] NULL ) ON [PRIMARY]'
EXEC (@.SQL)
DECLARE @.i smallint
DECLARE @.tblname varchar(50)
SET @.i = 1
WHILE (@.i <= 32)
BEGIN
SET @.tblname = 'tblIR_LB_' + @.i
EXECUTE CreateIRTables @.tblname
SET @.i = @.i + 1
ENDEXACT SAME PROBLEM, you've just moved it to a different place! You're
trying to add an integer to a string. You can't do this!
> SET @.tblname = 'tblIR_LB_' + @.i
Should be
SET @.tblname = 'tblIR_LB_' + CONVERT(VARCHAR(12),@.i)|||i think you are chasing a red herring, but I wil point out this error :)
SET @.tblname = 'tblIR_LB_' + @.i
^ @.I is a small int
SET @.tblname = 'tblIR_LB_' + CAST(@.i As varchar)
My suggestion to see what is happening .... return your @.SQL as an output
paramer and print it each time.
if it *was* giving you the error on tblIR_LB_2 then I assume tblIR_LB_1
worked? So, see what is happening by looking at the @.SQL. PRINT it as an
output variable and run the code directly.
Good luck.
John Scragg
"Butaambala" wrote:
> Aaron and Tibor - Thank you for your replys.
> Aaron, the tbl-vs-tblname issue and data type were silly mistakes -
> thank you.
> Tibor, so then making the entire table name a variable (rather than
> just part of it) should solve the problem, right? The below code
> attempts to make this change. Now getting the following error:
> "Syntax error converting the varchar value 'tblIR_LB_' to a column of
> data type smallint."
> CREATE PROC CreateIRTables ( @.tblname varchar(50))
> AS
> DECLARE @.SQL varchar(999)
> SET @.SQL = 'CREATE TABLE [dbo].[' + @.tblname + '] (
> [dteDate] [smalldatetime] NULL ,
> [sglSTDEV(upper)] [float] NULL ,
> [sglSTDEV(lower)] [float] NULL ,
> [intMA] [smallint] NULL ,
> [dblPL] [float] NULL ,
> [dblSTDEV] [float] NULL ,
> [dblIR] [float] NULL ,
> [intTotalDays] [int] NULL ,
> [intExposure] [int] NULL ) ON [PRIMARY]'
> EXEC (@.SQL)
>
> DECLARE @.i smallint
> DECLARE @.tblname varchar(50)
> SET @.i = 1
> WHILE (@.i <= 32)
> BEGIN
> SET @.tblname = 'tblIR_LB_' + @.i
> EXECUTE CreateIRTables @.tblname
> SET @.i = @.i + 1
> END
>
BAFFLED! Why won't this code work?!?!
Hello,
The below code is intended to create a sp, then loop through a set of
values, each time running the sp with the new value. The CREATE PROC
executes fine, but I get an error when attempting the loop: "Invalid
column name 'tblIR_LB_2'."
Your help appreciated!
CREATE PROC sp_CreateIRTables ( @.tbl smallint)
AS
DECLARE @.SQL varchar(999)
SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
[dteDate] [smalldatetime] NULL ,
[sglSTDEV(upper)] [float] NULL ,
[sglSTDEV(lower)] [float] NULL ,
[intMA] [smallint] NULL ,
[dblPL] [float] NULL ,
[dblSTDEV] [float] NULL ,
[dblIR] [float] NULL ,
[intTotalDays] [int] NULL ,
[intExposure] [int] NULL ) ON [PRIMARY]'
EXEC (@.SQL)
DECLARE @.i smallint
SET @.i = 1
WHILE (@.i <= 32)
BEGIN
EXECUTE sp_CreateIRTables @.i
SET @.i = @.i + 1
END> CREATE PROC sp_CreateIRTables ( @.tbl smallint)
DON'T USE sp_ PREFIX!
> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
Is it @.tbl or @.tblname? Pick one.|||> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
@.tblname is, for some reason, a SMALLINT, not any kind of string.
First, I suggest not using this kind of unmanageable scheme.
But to solve your issue in the short term, you can convert to a character
type, e.g.
SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + CONVERT(VARCHAR(12), @.tblname)
+ '] (|||You can't have a variable in the table name of a CREATE TABLE unless you use
dynamic SQL to create
the table. Why not create a temp table instead?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Butaambala" <brogers75@.yahoo.com> wrote in message
news:1131645127.077192.239150@.f14g2000cwb.googlegroups.com...
> Hello,
> The below code is intended to create a sp, then loop through a set of
> values, each time running the sp with the new value. The CREATE PROC
> executes fine, but I get an error when attempting the loop: "Invalid
> column name 'tblIR_LB_2'."
> Your help appreciated!
>
> CREATE PROC sp_CreateIRTables ( @.tbl smallint)
> AS
> DECLARE @.SQL varchar(999)
> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
> [dteDate] [smalldatetime] NULL ,
> [sglSTDEV(upper)] [float] NULL ,
> [sglSTDEV(lower)] [float] NULL ,
> [intMA] [smallint] NULL ,
> [dblPL] [float] NULL ,
> [dblSTDEV] [float] NULL ,
> [dblIR] [float] NULL ,
> [intTotalDays] [int] NULL ,
> [intExposure] [int] NULL ) ON [PRIMARY]'
> EXEC (@.SQL)
>
> DECLARE @.i smallint
> SET @.i = 1
> WHILE (@.i <= 32)
> BEGIN
> EXECUTE sp_CreateIRTables @.i
> SET @.i = @.i + 1
> END
>
The below code is intended to create a sp, then loop through a set of
values, each time running the sp with the new value. The CREATE PROC
executes fine, but I get an error when attempting the loop: "Invalid
column name 'tblIR_LB_2'."
Your help appreciated!
CREATE PROC sp_CreateIRTables ( @.tbl smallint)
AS
DECLARE @.SQL varchar(999)
SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
[dteDate] [smalldatetime] NULL ,
[sglSTDEV(upper)] [float] NULL ,
[sglSTDEV(lower)] [float] NULL ,
[intMA] [smallint] NULL ,
[dblPL] [float] NULL ,
[dblSTDEV] [float] NULL ,
[dblIR] [float] NULL ,
[intTotalDays] [int] NULL ,
[intExposure] [int] NULL ) ON [PRIMARY]'
EXEC (@.SQL)
DECLARE @.i smallint
SET @.i = 1
WHILE (@.i <= 32)
BEGIN
EXECUTE sp_CreateIRTables @.i
SET @.i = @.i + 1
END> CREATE PROC sp_CreateIRTables ( @.tbl smallint)
DON'T USE sp_ PREFIX!
> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
Is it @.tbl or @.tblname? Pick one.|||> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
@.tblname is, for some reason, a SMALLINT, not any kind of string.
First, I suggest not using this kind of unmanageable scheme.
But to solve your issue in the short term, you can convert to a character
type, e.g.
SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + CONVERT(VARCHAR(12), @.tblname)
+ '] (|||You can't have a variable in the table name of a CREATE TABLE unless you use
dynamic SQL to create
the table. Why not create a temp table instead?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Butaambala" <brogers75@.yahoo.com> wrote in message
news:1131645127.077192.239150@.f14g2000cwb.googlegroups.com...
> Hello,
> The below code is intended to create a sp, then loop through a set of
> values, each time running the sp with the new value. The CREATE PROC
> executes fine, but I get an error when attempting the loop: "Invalid
> column name 'tblIR_LB_2'."
> Your help appreciated!
>
> CREATE PROC sp_CreateIRTables ( @.tbl smallint)
> AS
> DECLARE @.SQL varchar(999)
> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
> [dteDate] [smalldatetime] NULL ,
> [sglSTDEV(upper)] [float] NULL ,
> [sglSTDEV(lower)] [float] NULL ,
> [intMA] [smallint] NULL ,
> [dblPL] [float] NULL ,
> [dblSTDEV] [float] NULL ,
> [dblIR] [float] NULL ,
> [intTotalDays] [int] NULL ,
> [intExposure] [int] NULL ) ON [PRIMARY]'
> EXEC (@.SQL)
>
> DECLARE @.i smallint
> SET @.i = 1
> WHILE (@.i <= 32)
> BEGIN
> EXECUTE sp_CreateIRTables @.i
> SET @.i = @.i + 1
> END
>
Monday, March 19, 2012
bad querry - with very slow response
Can someone please tell me why this code is returning results after too much
time and can you please tell me how I can fix it? Thank you for your help.
SELECT * FROM CASE WHERE
LTRIM(RTRIM(DLASTNAME)) like 'rumfield%'
AND LTRIM(RTRIM(FIRSTNAME)) like 'nunu%' order by C_codes
James
asked and answered...
time and can you please tell me how I can fix it? Thank you for your help.
SELECT * FROM CASE WHERE
LTRIM(RTRIM(DLASTNAME)) like 'rumfield%'
AND LTRIM(RTRIM(FIRSTNAME)) like 'nunu%' order by C_codes
James
asked and answered...
bad querry - with very slow response
Can someone please tell me why this code is returning results after too much
time and can you please tell me how I can fix it? Thank you for your help.
SELECT * FROM CASE WHERE
LTRIM(RTRIM(DLASTNAME)) like 'rumfield%'
AND LTRIM(RTRIM(FIRSTNAME)) like 'nunu%' order by C_codes
Jamesasked and answered...
time and can you please tell me how I can fix it? Thank you for your help.
SELECT * FROM CASE WHERE
LTRIM(RTRIM(DLASTNAME)) like 'rumfield%'
AND LTRIM(RTRIM(FIRSTNAME)) like 'nunu%' order by C_codes
Jamesasked and answered...
bad querry - with very slow response
Can someone please tell me why this code is returning results after too much
time and can you please tell me how I can fix it? Thank you for your help.
SELECT * FROM CASE WHERE
LTRIM(RTRIM(DLASTNAME)) like 'rumfield%'
AND LTRIM(RTRIM(FIRSTNAME)) like 'nunu%' order by C_codes
Jamesasked and answered...
time and can you please tell me how I can fix it? Thank you for your help.
SELECT * FROM CASE WHERE
LTRIM(RTRIM(DLASTNAME)) like 'rumfield%'
AND LTRIM(RTRIM(FIRSTNAME)) like 'nunu%' order by C_codes
Jamesasked and answered...
Bad parsing?
Dear all,
I have an xml code to parse automatically using sp_xml_preparedocument. It's
seemed to be correct, but there're some incomprehensible errors when it's
parsed.
XML:
<Body>
<sen:SigEnvelope xmlns:sen="urn:www-com:dsig:env:v1.0">
<sen:PrimarySig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0">RpxoZ6vnUXn9/nTSC9rkqeWtlNYTc+RxWZ5JbdFW6Vlg+ULhx7uDJFPRIdqxXJn IugF2xzlpgjCtmh4hz9tLAg==</dsig:SigValue>
</sen:PrimarySig>
<sen:ControlSig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0">i01zjNFRrTgxMbwnCmfHRE+MFmA6dq53xKt FPCQ9JBKI8YLPaCiSRL97WDe761bEELFtlFQ3O/H9GSmOCx+siw==</dsig:SigValue>
</sen:ControlSig>
<sen:Object>
<PacketEPD xmlns="urn:www-com:ed:v1.0" EDNo="1" EDDate="2003-04-14"
EDAuthor="4525545000" EDQuantity="2" Sum="1">
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="7" EDDate="2003-04-14">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="8" EDDate="2003-04-15">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="9" EDDate="2003-04-16">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
</PacketEPD>
</sen:Object>
</sen:SigEnvelope>
</Body>
SQL:
DECLARE @.ns VARCHAR(200)
SET @.ns = '<ROOT
xmlns:sen="urn:cbr-ru:dsig:env:v1.0"
xmlns:dsig="urn:cbr-ru:dsig:v1.0"
xmlns:obj="urn:cbr-ru:ed:v1.0"
/>'
exec sp_xml_preparedocument @.idoc OUTPUT, @.doc , @.ns
SELECT * FROM OPENXML (@.idoc, '//obj:ED101',8)
WITH (
PrimarySigvarchar(10) '//sen:PrimarySig',
ControlSigvarchar(10) '//sen:ControlSig' ,
PEPD_EDNovarchar(10)'//obj:PacketEPD/@.EDNo',
PEPD_EDAuthorvarchar(10)'//obj:PacketEPD/@.EDAuthor',
ED101_EDDatevarchar(10)'@.EDDate' ,
ED101_EDNovarchar(10)'@.EDNo'
)
exec sp_xml_removedocument @.idoc
When executing I got an error :
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 35
XML parsing error: The following tags were not closed: Body,
sen:SigEnvelope, sen:Object, PacketEPD, ED101.
But when I remain 2 <ED101 ...> blocks intead of 3 query runs correctly.
What is wrong?!
Thank you in advance,
alex
I am not seeing that error running against Microsoft SQL Server 2000 -
8.00.760.
What version of Sql Server are you using? And can you please send the
exact TSql script you are using?
Andrew Conrad
Microsoft Corp
http://blogs.msdn.com/aconrad
I have an xml code to parse automatically using sp_xml_preparedocument. It's
seemed to be correct, but there're some incomprehensible errors when it's
parsed.
XML:
<Body>
<sen:SigEnvelope xmlns:sen="urn:www-com:dsig:env:v1.0">
<sen:PrimarySig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0">RpxoZ6vnUXn9/nTSC9rkqeWtlNYTc+RxWZ5JbdFW6Vlg+ULhx7uDJFPRIdqxXJn IugF2xzlpgjCtmh4hz9tLAg==</dsig:SigValue>
</sen:PrimarySig>
<sen:ControlSig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0">i01zjNFRrTgxMbwnCmfHRE+MFmA6dq53xKt FPCQ9JBKI8YLPaCiSRL97WDe761bEELFtlFQ3O/H9GSmOCx+siw==</dsig:SigValue>
</sen:ControlSig>
<sen:Object>
<PacketEPD xmlns="urn:www-com:ed:v1.0" EDNo="1" EDDate="2003-04-14"
EDAuthor="4525545000" EDQuantity="2" Sum="1">
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="7" EDDate="2003-04-14">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="8" EDDate="2003-04-15">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="9" EDDate="2003-04-16">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
</PacketEPD>
</sen:Object>
</sen:SigEnvelope>
</Body>
SQL:
DECLARE @.ns VARCHAR(200)
SET @.ns = '<ROOT
xmlns:sen="urn:cbr-ru:dsig:env:v1.0"
xmlns:dsig="urn:cbr-ru:dsig:v1.0"
xmlns:obj="urn:cbr-ru:ed:v1.0"
/>'
exec sp_xml_preparedocument @.idoc OUTPUT, @.doc , @.ns
SELECT * FROM OPENXML (@.idoc, '//obj:ED101',8)
WITH (
PrimarySigvarchar(10) '//sen:PrimarySig',
ControlSigvarchar(10) '//sen:ControlSig' ,
PEPD_EDNovarchar(10)'//obj:PacketEPD/@.EDNo',
PEPD_EDAuthorvarchar(10)'//obj:PacketEPD/@.EDAuthor',
ED101_EDDatevarchar(10)'@.EDDate' ,
ED101_EDNovarchar(10)'@.EDNo'
)
exec sp_xml_removedocument @.idoc
When executing I got an error :
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 35
XML parsing error: The following tags were not closed: Body,
sen:SigEnvelope, sen:Object, PacketEPD, ED101.
But when I remain 2 <ED101 ...> blocks intead of 3 query runs correctly.
What is wrong?!
Thank you in advance,
alex
I am not seeing that error running against Microsoft SQL Server 2000 -
8.00.760.
What version of Sql Server are you using? And can you please send the
exact TSql script you are using?
Andrew Conrad
Microsoft Corp
http://blogs.msdn.com/aconrad
Bad parsing?
Dear all,
I have an xml code to parse automatically using sp_xml_preparedocument. It's
seemed to be correct, but there're some incomprehensible errors when it's
parsed.
XML:
<Body>
<sen:SigEnvelope xmlns:sen="urn:www-com:dsig:env:v1.0">
<sen:PrimarySig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0">RpxoZ6vnUXn9/nTSC9rkqeWtlNYTc+RxWZ5JbdFW6
Vlg+ULhx7uDJFPRIdqxXJnIugF2xzlpgjCtmh4hz
9tLAg==</dsig:SigValue>
</sen:PrimarySig>
<sen:ControlSig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0"> i01zjNFRrTgxMbwnCmfHRE+MFmA6dq53xKtFPCQ9
J
BKI8YLPaCiSRL97WDe761bEELFtlFQ3O/H9GSmOCx+siw==</dsig:SigValue>
</sen:ControlSig>
<sen:Object>
<PacketEPD xmlns="urn:www-com:ed:v1.0" EDNo="1" EDDate="2003-04-14"
EDAuthor="4525545000" EDQuantity="2" Sum="1">
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="7" EDDate="2003-04-14">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="8" EDDate="2003-04-15">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="9" EDDate="2003-04-16">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
</PacketEPD>
</sen:Object>
</sen:SigEnvelope>
</Body>
SQL:
DECLARE @.ns VARCHAR(200)
SET @.ns = '<ROOT
xmlns:sen="urn:cbr-ru:dsig:env:v1.0"
xmlns:dsig="urn:cbr-ru:dsig:v1.0"
xmlns:obj="urn:cbr-ru:ed:v1.0"
/>'
exec sp_xml_preparedocument @.idoc OUTPUT, @.doc , @.ns
SELECT * FROM OPENXML (@.idoc, '//obj:ED101',8)
WITH (
PrimarySig varchar(10) '//sen:PrimarySig',
ControlSig varchar(10) '//sen:ControlSig' ,
PEPD_EDNo varchar(10) '//obj:PacketEPD/@.EDNo',
PEPD_EDAuthor varchar(10) '//obj:PacketEPD/@.EDAuthor',
ED101_EDDate varchar(10) '@.EDDate' ,
ED101_EDNo varchar(10) '@.EDNo'
)
exec sp_xml_removedocument @.idoc
When executing I got an error :
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line
35
XML parsing error: The following tags were not closed: Body,
sen:SigEnvelope, sen:Object, PacketEPD, ED101.
But when I remain 2 <ED101 ...> blocks intead of 3 query runs correctly.
What is wrong?!
Thank you in advance,
alexI am not seeing that error running against Microsoft SQL Server 2000 -
8.00.760.
What version of Sql Server are you using? And can you please send the
exact TSql script you are using?
Andrew Conrad
Microsoft Corp
http://blogs.msdn.com/aconrad
I have an xml code to parse automatically using sp_xml_preparedocument. It's
seemed to be correct, but there're some incomprehensible errors when it's
parsed.
XML:
<Body>
<sen:SigEnvelope xmlns:sen="urn:www-com:dsig:env:v1.0">
<sen:PrimarySig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0">RpxoZ6vnUXn9/nTSC9rkqeWtlNYTc+RxWZ5JbdFW6
Vlg+ULhx7uDJFPRIdqxXJnIugF2xzlpgjCtmh4hz
9tLAg==</dsig:SigValue>
</sen:PrimarySig>
<sen:ControlSig>
<dsig:SigValue
xmlns:dsig="urn:www-com:dsig:v1.0"> i01zjNFRrTgxMbwnCmfHRE+MFmA6dq53xKtFPCQ9
J
BKI8YLPaCiSRL97WDe761bEELFtlFQ3O/H9GSmOCx+siw==</dsig:SigValue>
</sen:ControlSig>
<sen:Object>
<PacketEPD xmlns="urn:www-com:ed:v1.0" EDNo="1" EDDate="2003-04-14"
EDAuthor="4525545000" EDQuantity="2" Sum="1">
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="7" EDDate="2003-04-14">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="8" EDDate="2003-04-15">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
<ED101 xmlns="urn:www-com:ed:v1.0" EDNo="9" EDDate="2003-04-16">
<AccDoc AccDocNo="4" AccDocDate="2003-04-15" />
</ED101>
</PacketEPD>
</sen:Object>
</sen:SigEnvelope>
</Body>
SQL:
DECLARE @.ns VARCHAR(200)
SET @.ns = '<ROOT
xmlns:sen="urn:cbr-ru:dsig:env:v1.0"
xmlns:dsig="urn:cbr-ru:dsig:v1.0"
xmlns:obj="urn:cbr-ru:ed:v1.0"
/>'
exec sp_xml_preparedocument @.idoc OUTPUT, @.doc , @.ns
SELECT * FROM OPENXML (@.idoc, '//obj:ED101',8)
WITH (
PrimarySig varchar(10) '//sen:PrimarySig',
ControlSig varchar(10) '//sen:ControlSig' ,
PEPD_EDNo varchar(10) '//obj:PacketEPD/@.EDNo',
PEPD_EDAuthor varchar(10) '//obj:PacketEPD/@.EDAuthor',
ED101_EDDate varchar(10) '@.EDDate' ,
ED101_EDNo varchar(10) '@.EDNo'
)
exec sp_xml_removedocument @.idoc
When executing I got an error :
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line
35
XML parsing error: The following tags were not closed: Body,
sen:SigEnvelope, sen:Object, PacketEPD, ED101.
But when I remain 2 <ED101 ...> blocks intead of 3 query runs correctly.
What is wrong?!
Thank you in advance,
alexI am not seeing that error running against Microsoft SQL Server 2000 -
8.00.760.
What version of Sql Server are you using? And can you please send the
exact TSql script you are using?
Andrew Conrad
Microsoft Corp
http://blogs.msdn.com/aconrad
Sunday, March 11, 2012
Bad code clogs replication
I am using Transaction replication on sql2005 SP2.
When deploying a new stored procedure that is supposed to be tested, I
got an error stateing that the number of columns in the select did not
match the number in the insert. I checked the SP and it was fine.
1) Was this really relating to the code, or was there an error in
replication?
2) How do you clear 'bad' transactions from replication?
Thanks,
Peter Cwik
Use the skiperror parameter on the distribution agent to skip these
errors for transactional replication.
Can you provide me with the code for the proc in question. I have not
encountered such an error yet in SQL Server.
I normally deploy changes to procs using sp_addscriptexec.
On Jan 8, 2:15 pm, PeterCwik <pjc...@.gmail.com> wrote:
> I am using Transaction replication on sql2005 SP2.
> When deploying a new stored procedure that is supposed to be tested, I
> got an error stateing that the number of columns in the select did not
> match the number in the insert. I checked the SP and it was fine.
> 1) Was this really relating to the code, or was there an error in
> replication?
> 2) How do you clear 'bad' transactions from replication?
> Thanks,
> Peter Cwik
When deploying a new stored procedure that is supposed to be tested, I
got an error stateing that the number of columns in the select did not
match the number in the insert. I checked the SP and it was fine.
1) Was this really relating to the code, or was there an error in
replication?
2) How do you clear 'bad' transactions from replication?
Thanks,
Peter Cwik
Use the skiperror parameter on the distribution agent to skip these
errors for transactional replication.
Can you provide me with the code for the proc in question. I have not
encountered such an error yet in SQL Server.
I normally deploy changes to procs using sp_addscriptexec.
On Jan 8, 2:15 pm, PeterCwik <pjc...@.gmail.com> wrote:
> I am using Transaction replication on sql2005 SP2.
> When deploying a new stored procedure that is supposed to be tested, I
> got an error stateing that the number of columns in the select did not
> match the number in the insert. I checked the SP and it was fine.
> 1) Was this really relating to the code, or was there an error in
> replication?
> 2) How do you clear 'bad' transactions from replication?
> Thanks,
> Peter Cwik
Backward Compatability in Yukon using backup devices?
My peers have informed me that I should no longer code my backup routine
using a backup alias via sp_addumpdevice because it is 1) Provided only for
backward compatability and 2) Will not be supported in the future.
Should I not be using a backup alias for these reasons? Yukon provides the
commands but no where have I seen where it's only there to support backward
compatability and that it is targeted to be phased out. Can someone show me
this?
Thanks.
-Cqlboy
I know nothing of dump devices going away any time soon.
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> My peers have informed me that I should no longer code my backup routine
> using a backup alias via sp_addumpdevice because it is 1) Provided only
> for
> backward compatability and 2) Will not be supported in the future.
> Should I not be using a backup alias for these reasons? Yukon provides
> the
> commands but no where have I seen where it's only there to support
> backward
> compatability and that it is targeted to be phased out. Can someone show
> me
> this?
> Thanks.
> -Cqlboy
|||Thanx. Thought so. My fellow peers
are misinformed.
-Cqlboy
"Andrew J. Kelly" wrote:
> I know nothing of dump devices going away any time soon.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
>
>
|||I'm with Andrew. Ask your colleagues for a reference. It is easy to make claims you can't back up...
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:B4044417-68A3-401F-B1AF-7BCE37AE1BC9@.microsoft.com...[vbcol=seagreen]
> Thanx. Thought so. My fellow peers
> are misinformed.
> -Cqlboy
> "Andrew J. Kelly" wrote:
using a backup alias via sp_addumpdevice because it is 1) Provided only for
backward compatability and 2) Will not be supported in the future.
Should I not be using a backup alias for these reasons? Yukon provides the
commands but no where have I seen where it's only there to support backward
compatability and that it is targeted to be phased out. Can someone show me
this?
Thanks.
-Cqlboy
I know nothing of dump devices going away any time soon.
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> My peers have informed me that I should no longer code my backup routine
> using a backup alias via sp_addumpdevice because it is 1) Provided only
> for
> backward compatability and 2) Will not be supported in the future.
> Should I not be using a backup alias for these reasons? Yukon provides
> the
> commands but no where have I seen where it's only there to support
> backward
> compatability and that it is targeted to be phased out. Can someone show
> me
> this?
> Thanks.
> -Cqlboy
|||Thanx. Thought so. My fellow peers
are misinformed.
-Cqlboy
"Andrew J. Kelly" wrote:
> I know nothing of dump devices going away any time soon.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
>
>
|||I'm with Andrew. Ask your colleagues for a reference. It is easy to make claims you can't back up...
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:B4044417-68A3-401F-B1AF-7BCE37AE1BC9@.microsoft.com...[vbcol=seagreen]
> Thanx. Thought so. My fellow peers
> are misinformed.
> -Cqlboy
> "Andrew J. Kelly" wrote:
Backward Compatability in Yukon using backup devices?
My peers have informed me that I should no longer code my backup routine
using a backup alias via sp_addumpdevice because it is 1) Provided only for
backward compatability and 2) Will not be supported in the future.
Should I not be using a backup alias for these reasons? Yukon provides the
commands but no where have I seen where it's only there to support backward
compatability and that it is targeted to be phased out. Can someone show me
this?
Thanks.
-CqlboyI know nothing of dump devices going away any time soon.
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> My peers have informed me that I should no longer code my backup routine
> using a backup alias via sp_addumpdevice because it is 1) Provided only
> for
> backward compatability and 2) Will not be supported in the future.
> Should I not be using a backup alias for these reasons? Yukon provides
> the
> commands but no where have I seen where it's only there to support
> backward
> compatability and that it is targeted to be phased out. Can someone show
> me
> this?
> Thanks.
> -Cqlboy|||Thanx. Thought so. My fellow peers
are misinformed.
-Cqlboy
"Andrew J. Kelly" wrote:
> I know nothing of dump devices going away any time soon.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
>
>|||I'm with Andrew. Ask your colleagues for a reference. It is easy to make cla
ims you can't back up...
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:B4044417-68A3-401F-B1AF-7BCE37AE1BC9@.microsoft.com...[vbcol=seagreen]
> Thanx. Thought so. My fellow peers
> are misinformed.
> -Cqlboy
> "Andrew J. Kelly" wrote:
>
using a backup alias via sp_addumpdevice because it is 1) Provided only for
backward compatability and 2) Will not be supported in the future.
Should I not be using a backup alias for these reasons? Yukon provides the
commands but no where have I seen where it's only there to support backward
compatability and that it is targeted to be phased out. Can someone show me
this?
Thanks.
-CqlboyI know nothing of dump devices going away any time soon.
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> My peers have informed me that I should no longer code my backup routine
> using a backup alias via sp_addumpdevice because it is 1) Provided only
> for
> backward compatability and 2) Will not be supported in the future.
> Should I not be using a backup alias for these reasons? Yukon provides
> the
> commands but no where have I seen where it's only there to support
> backward
> compatability and that it is targeted to be phased out. Can someone show
> me
> this?
> Thanks.
> -Cqlboy|||Thanx. Thought so. My fellow peers
are misinformed.
-Cqlboy
"Andrew J. Kelly" wrote:
> I know nothing of dump devices going away any time soon.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
>
>|||I'm with Andrew. Ask your colleagues for a reference. It is easy to make cla
ims you can't back up...
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:B4044417-68A3-401F-B1AF-7BCE37AE1BC9@.microsoft.com...[vbcol=seagreen]
> Thanx. Thought so. My fellow peers
> are misinformed.
> -Cqlboy
> "Andrew J. Kelly" wrote:
>
Backward Compatability in Yukon using backup devices?
My peers have informed me that I should no longer code my backup routine
using a backup alias via sp_addumpdevice because it is 1) Provided only for
backward compatability and 2) Will not be supported in the future.
Should I not be using a backup alias for these reasons? Yukon provides the
commands but no where have I seen where it's only there to support backward
compatability and that it is targeted to be phased out. Can someone show me
this?
Thanks.
-CqlboyI know nothing of dump devices going away any time soon.
--
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> My peers have informed me that I should no longer code my backup routine
> using a backup alias via sp_addumpdevice because it is 1) Provided only
> for
> backward compatability and 2) Will not be supported in the future.
> Should I not be using a backup alias for these reasons? Yukon provides
> the
> commands but no where have I seen where it's only there to support
> backward
> compatability and that it is targeted to be phased out. Can someone show
> me
> this?
> Thanks.
> -Cqlboy|||Thanx. Thought so. My fellow peers
are misinformed.
-Cqlboy
"Andrew J. Kelly" wrote:
> I know nothing of dump devices going away any time soon.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> > My peers have informed me that I should no longer code my backup routine
> > using a backup alias via sp_addumpdevice because it is 1) Provided only
> > for
> > backward compatability and 2) Will not be supported in the future.
> >
> > Should I not be using a backup alias for these reasons? Yukon provides
> > the
> > commands but no where have I seen where it's only there to support
> > backward
> > compatability and that it is targeted to be phased out. Can someone show
> > me
> > this?
> >
> > Thanks.
> >
> > -Cqlboy
>
>|||I'm with Andrew. Ask your colleagues for a reference. It is easy to make claims you can't back up...
:-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:B4044417-68A3-401F-B1AF-7BCE37AE1BC9@.microsoft.com...
> Thanx. Thought so. My fellow peers
> are misinformed.
> -Cqlboy
> "Andrew J. Kelly" wrote:
>> I know nothing of dump devices going away any time soon.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
>> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
>> > My peers have informed me that I should no longer code my backup routine
>> > using a backup alias via sp_addumpdevice because it is 1) Provided only
>> > for
>> > backward compatability and 2) Will not be supported in the future.
>> >
>> > Should I not be using a backup alias for these reasons? Yukon provides
>> > the
>> > commands but no where have I seen where it's only there to support
>> > backward
>> > compatability and that it is targeted to be phased out. Can someone show
>> > me
>> > this?
>> >
>> > Thanks.
>> >
>> > -Cqlboy
>>
using a backup alias via sp_addumpdevice because it is 1) Provided only for
backward compatability and 2) Will not be supported in the future.
Should I not be using a backup alias for these reasons? Yukon provides the
commands but no where have I seen where it's only there to support backward
compatability and that it is targeted to be phased out. Can someone show me
this?
Thanks.
-CqlboyI know nothing of dump devices going away any time soon.
--
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> My peers have informed me that I should no longer code my backup routine
> using a backup alias via sp_addumpdevice because it is 1) Provided only
> for
> backward compatability and 2) Will not be supported in the future.
> Should I not be using a backup alias for these reasons? Yukon provides
> the
> commands but no where have I seen where it's only there to support
> backward
> compatability and that it is targeted to be phased out. Can someone show
> me
> this?
> Thanks.
> -Cqlboy|||Thanx. Thought so. My fellow peers
are misinformed.
-Cqlboy
"Andrew J. Kelly" wrote:
> I know nothing of dump devices going away any time soon.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
> > My peers have informed me that I should no longer code my backup routine
> > using a backup alias via sp_addumpdevice because it is 1) Provided only
> > for
> > backward compatability and 2) Will not be supported in the future.
> >
> > Should I not be using a backup alias for these reasons? Yukon provides
> > the
> > commands but no where have I seen where it's only there to support
> > backward
> > compatability and that it is targeted to be phased out. Can someone show
> > me
> > this?
> >
> > Thanks.
> >
> > -Cqlboy
>
>|||I'm with Andrew. Ask your colleagues for a reference. It is easy to make claims you can't back up...
:-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:B4044417-68A3-401F-B1AF-7BCE37AE1BC9@.microsoft.com...
> Thanx. Thought so. My fellow peers
> are misinformed.
> -Cqlboy
> "Andrew J. Kelly" wrote:
>> I know nothing of dump devices going away any time soon.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
>> news:4332439A-418D-450F-BD94-5579374C40F3@.microsoft.com...
>> > My peers have informed me that I should no longer code my backup routine
>> > using a backup alias via sp_addumpdevice because it is 1) Provided only
>> > for
>> > backward compatability and 2) Will not be supported in the future.
>> >
>> > Should I not be using a backup alias for these reasons? Yukon provides
>> > the
>> > commands but no where have I seen where it's only there to support
>> > backward
>> > compatability and that it is targeted to be phased out. Can someone show
>> > me
>> > this?
>> >
>> > Thanks.
>> >
>> > -Cqlboy
>>
Thursday, February 16, 2012
backup, restore commands for db with multiple data files and fileg
I use the below code to backup the database with multiple datafiles, and the
n
try to restore with the command below, but it throws error.
How do I perform backup/restore of database with multiple data files and log
files?
BACKUP DATABASE abc
FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
RESTORE DATABASE abc
FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
WITH
MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
MOVE 'abc_DataLOB' TO
'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
MOVE 'abc_dat2' TO
'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
MOVE 'abc_Log1' TO
'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
RECOVERY, STATS = 10
GOBackup the entire db instead of backing up specific files or filegroups.
BACKUP DATABASE abc
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
AMB
"Pari" wrote:
> I use the below code to backup the database with multiple datafiles, and t
hen
> try to restore with the command below, but it throws error.
> How do I perform backup/restore of database with multiple data files and l
og
> files?
> BACKUP DATABASE abc
> FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
> FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
> FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
> FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
> FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
> TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
> WITH INIT, STATS = 10
> go
> RESTORE DATABASE abc
> FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
> WITH
> MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
> MOVE 'abc_DataLOB' TO
> 'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
> MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
> MOVE 'abc_dat2' TO
> 'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
> MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
> MOVE 'abc_Log1' TO
> 'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
> MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
> RECOVERY, STATS = 10
> GO
>
n
try to restore with the command below, but it throws error.
How do I perform backup/restore of database with multiple data files and log
files?
BACKUP DATABASE abc
FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
RESTORE DATABASE abc
FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
WITH
MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
MOVE 'abc_DataLOB' TO
'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
MOVE 'abc_dat2' TO
'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
MOVE 'abc_Log1' TO
'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
RECOVERY, STATS = 10
GOBackup the entire db instead of backing up specific files or filegroups.
BACKUP DATABASE abc
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
AMB
"Pari" wrote:
> I use the below code to backup the database with multiple datafiles, and t
hen
> try to restore with the command below, but it throws error.
> How do I perform backup/restore of database with multiple data files and l
og
> files?
> BACKUP DATABASE abc
> FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
> FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
> FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
> FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
> FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
> TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
> WITH INIT, STATS = 10
> go
> RESTORE DATABASE abc
> FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
> WITH
> MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
> MOVE 'abc_DataLOB' TO
> 'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
> MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
> MOVE 'abc_dat2' TO
> 'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
> MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
> MOVE 'abc_Log1' TO
> 'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
> MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
> RECOVERY, STATS = 10
> GO
>
backup, restore commands for db with multiple data files and fileg
I use the below code to backup the database with multiple datafiles, and then
try to restore with the command below, but it throws error.
How do I perform backup/restore of database with multiple data files and log
files?
BACKUP DATABASE abc
FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
RESTORE DATABASE abc
FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
WITH
MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
MOVE 'abc_DataLOB' TO
'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
MOVE 'abc_dat2' TO
'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
MOVE 'abc_Log1' TO
'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
RECOVERY, STATS = 10
GOBackup the entire db instead of backing up specific files or filegroups.
BACKUP DATABASE abc
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
AMB
"Pari" wrote:
> I use the below code to backup the database with multiple datafiles, and then
> try to restore with the command below, but it throws error.
> How do I perform backup/restore of database with multiple data files and log
> files?
> BACKUP DATABASE abc
> FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
> FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
> FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
> FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
> FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
> TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
> WITH INIT, STATS = 10
> go
> RESTORE DATABASE abc
> FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
> WITH
> MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
> MOVE 'abc_DataLOB' TO
> 'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
> MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
> MOVE 'abc_dat2' TO
> 'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
> MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
> MOVE 'abc_Log1' TO
> 'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
> MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
> RECOVERY, STATS = 10
> GO
>
try to restore with the command below, but it throws error.
How do I perform backup/restore of database with multiple data files and log
files?
BACKUP DATABASE abc
FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
RESTORE DATABASE abc
FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
WITH
MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
MOVE 'abc_DataLOB' TO
'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
MOVE 'abc_dat2' TO
'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
MOVE 'abc_Log1' TO
'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
RECOVERY, STATS = 10
GOBackup the entire db instead of backing up specific files or filegroups.
BACKUP DATABASE abc
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
AMB
"Pari" wrote:
> I use the below code to backup the database with multiple datafiles, and then
> try to restore with the command below, but it throws error.
> How do I perform backup/restore of database with multiple data files and log
> files?
> BACKUP DATABASE abc
> FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
> FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
> FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
> FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
> FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
> TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
> WITH INIT, STATS = 10
> go
> RESTORE DATABASE abc
> FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
> WITH
> MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
> MOVE 'abc_DataLOB' TO
> 'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
> MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
> MOVE 'abc_dat2' TO
> 'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
> MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
> MOVE 'abc_Log1' TO
> 'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
> MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
> RECOVERY, STATS = 10
> GO
>
backup, restore commands for db with multiple data files and fileg
I use the below code to backup the database with multiple datafiles, and then
try to restore with the command below, but it throws error.
How do I perform backup/restore of database with multiple data files and log
files?
BACKUP DATABASE abc
FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
RESTORE DATABASE abc
FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
WITH
MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
MOVE 'abc_DataLOB' TO
'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
MOVE 'abc_dat2' TO
'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
MOVE 'abc_Log1' TO
'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
RECOVERY, STATS = 10
GO
Backup the entire db instead of backing up specific files or filegroups.
BACKUP DATABASE abc
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
AMB
"Pari" wrote:
> I use the below code to backup the database with multiple datafiles, and then
> try to restore with the command below, but it throws error.
> How do I perform backup/restore of database with multiple data files and log
> files?
> BACKUP DATABASE abc
> FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
> FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
> FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
> FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
> FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
> TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
> WITH INIT, STATS = 10
> go
> RESTORE DATABASE abc
> FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
> WITH
> MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
> MOVE 'abc_DataLOB' TO
> 'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
> MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
> MOVE 'abc_dat2' TO
> 'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
> MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
> MOVE 'abc_Log1' TO
> 'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
> MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
> RECOVERY, STATS = 10
> GO
>
try to restore with the command below, but it throws error.
How do I perform backup/restore of database with multiple data files and log
files?
BACKUP DATABASE abc
FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
RESTORE DATABASE abc
FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
WITH
MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
MOVE 'abc_DataLOB' TO
'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
MOVE 'abc_dat2' TO
'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
MOVE 'abc_Log1' TO
'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
RECOVERY, STATS = 10
GO
Backup the entire db instead of backing up specific files or filegroups.
BACKUP DATABASE abc
TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
WITH INIT, STATS = 10
go
AMB
"Pari" wrote:
> I use the below code to backup the database with multiple datafiles, and then
> try to restore with the command below, but it throws error.
> How do I perform backup/restore of database with multiple data files and log
> files?
> BACKUP DATABASE abc
> FILE = 'abc_Data', FILEGROUP = 'PRIMARY',
> FILE = 'abc_DataLOB', FILEGROUP = 'FG_abc_DataLOB',
> FILE = 'abc_dat', FILEGROUP = 'FG_abc_dat',
> FILE = 'abc_dat2', FILEGROUP = 'FG_abcdat2',
> FILE = 'abc_dat3', FILEGROUP = 'FG_abcdat3',
> TO DISK = 'd:\SQLBackups\abc_200507121535.BAK'
> WITH INIT, STATS = 10
> go
> RESTORE DATABASE abc
> FROM DISK ='d:\SQLBackups\abc_200507121535.BAK'
> WITH
> MOVE 'abc_Data' TO 'd:\MSSQL\MSSQL\data\abc_Data.MDF',
> MOVE 'abc_DataLOB' TO
> 'd:\MSSQL\MSSQL\data\abc_DataLOB.NDF',
> MOVE 'abc_dat' TO 'd:\MSSQL\MSSQL\data\abc_dat.NDF' ,
> MOVE 'abc_dat2' TO
> 'd:\MSSQL\MSSQL\data\abc_dat2.NDF' ,
> MOVE 'abc_dat3' TO 'd:\MSSQL\MSSQL\data\abc_dat3.NDF',
> MOVE 'abc_Log1' TO
> 'D:\MSSQL\MSSQL\Data\abc_Log1.LDF',
> MOVE 'abc_Log2' TO 'D:\MSSQL\MSSQL\Data\abc_Log2.LDF',
> RECOVERY, STATS = 10
> GO
>
Subscribe to:
Posts (Atom)