Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Wednesday, March 21, 2012

how to reduce a file (less then initial size)

Hi,
I have created a database with a 20gb initial size.
but I want to reduce this file
how to do this?
because the shrink command doesn't works.
or maybe I have missed an option?
thanks.
jerome.
DBCC SHRINKIFLE(<file id>, <target size>)
... Target size, of course, won't go beyond the size of the data in the file
(although you can set it as low as you want -- it won't give you an error
for going too low).
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
"Jj" <willgart@.AAAhotmailBBB.com> wrote in message
news:uxxcdeToFHA.572@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have created a database with a 20gb initial size.
> but I want to reduce this file
> how to do this?
> because the shrink command doesn't works.
> or maybe I have missed an option?
>
> thanks.
> jerome.
|||I think I have typed to wrong command because now this works fine !!!!
I don't understand why before the shrink has never worked...
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:uEiNdyToFHA.2904@.tk2msftngp13.phx.gbl...
> DBCC SHRINKIFLE(<file id>, <target size>)
> ... Target size, of course, won't go beyond the size of the data in the
> file
> (although you can set it as low as you want -- it won't give you an error
> for going too low).
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Jj" <willgart@.AAAhotmailBBB.com> wrote in message
> news:uxxcdeToFHA.572@.TK2MSFTNGP15.phx.gbl...
>

how to reduce a file (less then initial size)

Hi,
I have created a database with a 20gb initial size.
but I want to reduce this file
how to do this?
because the shrink command doesn't works.
or maybe I have missed an option?
thanks.
jerome.DBCC SHRINKIFLE(<file id>, <target size> )
... Target size, of course, won't go beyond the size of the data in the fil
e
(although you can set it as low as you want -- it won't give you an error
for going too low).
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Jj" <willgart@.AAAhotmailBBB.com> wrote in message
news:uxxcdeToFHA.572@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have created a database with a 20gb initial size.
> but I want to reduce this file
> how to do this?
> because the shrink command doesn't works.
> or maybe I have missed an option?
>
> thanks.
> jerome.|||I think I have typed to wrong command because now this works fine !!!!
I don't understand why before the shrink has never worked...
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:uEiNdyToFHA.2904@.tk2msftngp13.phx.gbl...
> DBCC SHRINKIFLE(<file id>, <target size> )
> ... Target size, of course, won't go beyond the size of the data in the
> file
> (although you can set it as low as you want -- it won't give you an error
> for going too low).
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Jj" <willgart@.AAAhotmailBBB.com> wrote in message
> news:uxxcdeToFHA.572@.TK2MSFTNGP15.phx.gbl...
>

how to reduce a file (less then initial size)

Hi,
I have created a database with a 20gb initial size.
but I want to reduce this file
how to do this?
because the shrink command doesn't works.
or maybe I have missed an option?
thanks.
jerome.DBCC SHRINKIFLE(<file id>, <target size>)
... Target size, of course, won't go beyond the size of the data in the file
(although you can set it as low as you want -- it won't give you an error
for going too low).
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Jéjé" <willgart@.AAAhotmailBBB.com> wrote in message
news:uxxcdeToFHA.572@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have created a database with a 20gb initial size.
> but I want to reduce this file
> how to do this?
> because the shrink command doesn't works.
> or maybe I have missed an option?
>
> thanks.
> jerome.|||I think I have typed to wrong command because now this works fine !!!!
I don't understand why before the shrink has never worked...
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:uEiNdyToFHA.2904@.tk2msftngp13.phx.gbl...
> DBCC SHRINKIFLE(<file id>, <target size>)
> ... Target size, of course, won't go beyond the size of the data in the
> file
> (although you can set it as low as you want -- it won't give you an error
> for going too low).
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Jéjé" <willgart@.AAAhotmailBBB.com> wrote in message
> news:uxxcdeToFHA.572@.TK2MSFTNGP15.phx.gbl...
>> Hi,
>> I have created a database with a 20gb initial size.
>> but I want to reduce this file
>> how to do this?
>> because the shrink command doesn't works.
>> or maybe I have missed an option?
>>
>> thanks.
>> jerome.
>

Monday, March 19, 2012

How to Redistribute sqlExpress

Hi,

I asked this question in another thread that was already going but has had no activeity for a month or so..

I have read the command line artical and the clickonce artical about installing the sqlExpress on the client as a silent install. There are alot of holes in the articals and i am in big time need to get this resolved.

I would like someone to point me in the right direction on:

1. Client install sqlExpress from a link from my site ( with only click here type prompts )

2. Client install sqlExpress from msi that is with my application

3. The absolute mininum componets for sqlExpress to run on the client

4. Is it possiable to install sqlExpress in my application directory and not under the clients G:\Program Files\Microsoft SQL Server ?

*I only need to be able to mirror the exact tables and sprocs so that my clients can work in a disconnected enviroment.

NO problem with reading what every it takes; i just need to be pointed in the right direction.\

HELP! HELP! HELP!

Erik

Hi Erik,

You might find some value in the Embedding white paper and from the Embedding web cast (source code from webcast). These don't specifically discuss web deployment, but they will provide more general information. Since you are only trying to create a local data store for working off line, you might want to consider SQL Everywhere Edition. SQL Everywhere is a light weight database engine that is designed specifically for the task you describe. It doesn't support sprocs, but you can often handle logic directly in your code rather than a sproc. It's a design decision, but you should check out the information. It's is currently in Communit Technology Preview and is available for evaluation and testing. Like SQL Express Everywhere Edition will be free for development and deployment.

I'll attempt to answer your questions below:

1. Client install sqlExpress from a link from my site ( with only click here type prompts )

ClickOnce can set this up automatically for you, so it would help to know what else you need that ClickOnce doesn't do. The smallest thing you need is a link to the installer file. When a user clicks it, the user is prompted to either Run or Save the file. If they click Run, the installer will run in full UI mode. This is effectively what happens when you click the download link on the SQL Express download page.

If you want to hid the UI, then you need to write your own wrapper that will launch the SQL Express installer using the correct command line parameters. (The Embedding white paper will help with wrapper functions.) This is actually how VS Express installation works. When you install it from the web, you are actually downloading a wrapper program that performs some system checks and then gives you some options. Based on the options, it then downloads the appropriate program installers (i.e. VS and SQL) and runs them. If fact, the VS Express wrapper runs SQL Express in quite mode.

If you go the wrapper route, you'll need to make sure your wrapper checks for pre-requisites such as .NET Framework 2.0 and Windows Installer 3.1. This means the wrapper has to be native code rather than managed code. If you can be sure that the target computers have these pre-requisites installed, then you don't have to worry about them, but most the time you can't ensure this.

2. Client install sqlExpress from msi that is with my application

This can't be done. MSI does not support calling other MSIs, hence the wrappers that we always use to call multiple MSIs in order. This is called chaining. Again, ClickOnce does this for you automatically by creating a wrapper that will chain together pre-requisite such as the framework, the SQL installer and your application installer.

3. The absolute mininum componets for sqlExpress to run on the client

The minimum requirements are the SQL Engine, you can install this using the command line:

SQLEXPR.EXE /qn /ADDLOCAL=Sql_Engine INSTANCENAME=SQLEXPRESS

Everything you need will be installed.

4. Is it possiable to install sqlExpress in my application directory and not under the clients G:\Program Files\Microsoft SQL Server ?

Yes, there is a command line argument to control this, I think it is SQLINSTALLDIRECTORY or something equally clever. You can find it in the command line topic in Books Online.

If you're intersted, here are a couple blogs that discuss SQL Everywhere Edition.

Steve Lasker's Blog

SQL Everywhere Edition team blog

Mike

|||

Thank you very much for the reply Mike....

I was not aware of the post untill today...

I have spent about two weeks now strictly windows and command line operations perparing for this sql install... Even thow it will be about three months untill i will release my programs i needed to get a heavy duty soaking in the windows world.. I have worked with the web apps for about two years and i really like the windows app... :)

Your response is going to help me very much... Thanks a lot for taking the time to write this becuase this is such a big part of my solution.

Thanks,

erik

I might have more questions in a day or so...( i posted another one earlier today about how to get the value from the win calculator... after digging deep into the win world i see the usefullyness of interop ).. Dam! can;t be satisfied with just out of the box :)

The SQL Everywhere is extreamly attractive; however, i need just a little bit more than what it has to offer....

How to Redistribute sqlExpress

Hi,

I asked this question in another thread that was already going but has had no activeity for a month or so..

I have read the command line artical and the clickonce artical about installing the sqlExpress on the client as a silent install. There are alot of holes in the articals and i am in big time need to get this resolved.

I would like someone to point me in the right direction on:

1. Client install sqlExpress from a link from my site ( with only click here type prompts )

2. Client install sqlExpress from msi that is with my application

3. The absolute mininum componets for sqlExpress to run on the client

4. Is it possiable to install sqlExpress in my application directory and not under the clients G:\Program Files\Microsoft SQL Server ?

*I only need to be able to mirror the exact tables and sprocs so that my clients can work in a disconnected enviroment.

NO problem with reading what every it takes; i just need to be pointed in the right direction.\

HELP! HELP! HELP!

Erik

Hi Erik,

You might find some value in the Embedding white paper and from the Embedding web cast (source code from webcast). These don't specifically discuss web deployment, but they will provide more general information. Since you are only trying to create a local data store for working off line, you might want to consider SQL Everywhere Edition. SQL Everywhere is a light weight database engine that is designed specifically for the task you describe. It doesn't support sprocs, but you can often handle logic directly in your code rather than a sproc. It's a design decision, but you should check out the information. It's is currently in Communit Technology Preview and is available for evaluation and testing. Like SQL Express Everywhere Edition will be free for development and deployment.

I'll attempt to answer your questions below:

1. Client install sqlExpress from a link from my site ( with only click here type prompts )

ClickOnce can set this up automatically for you, so it would help to know what else you need that ClickOnce doesn't do. The smallest thing you need is a link to the installer file. When a user clicks it, the user is prompted to either Run or Save the file. If they click Run, the installer will run in full UI mode. This is effectively what happens when you click the download link on the SQL Express download page.

If you want to hid the UI, then you need to write your own wrapper that will launch the SQL Express installer using the correct command line parameters. (The Embedding white paper will help with wrapper functions.) This is actually how VS Express installation works. When you install it from the web, you are actually downloading a wrapper program that performs some system checks and then gives you some options. Based on the options, it then downloads the appropriate program installers (i.e. VS and SQL) and runs them. If fact, the VS Express wrapper runs SQL Express in quite mode.

If you go the wrapper route, you'll need to make sure your wrapper checks for pre-requisites such as .NET Framework 2.0 and Windows Installer 3.1. This means the wrapper has to be native code rather than managed code. If you can be sure that the target computers have these pre-requisites installed, then you don't have to worry about them, but most the time you can't ensure this.

2. Client install sqlExpress from msi that is with my application

This can't be done. MSI does not support calling other MSIs, hence the wrappers that we always use to call multiple MSIs in order. This is called chaining. Again, ClickOnce does this for you automatically by creating a wrapper that will chain together pre-requisite such as the framework, the SQL installer and your application installer.

3. The absolute mininum componets for sqlExpress to run on the client

The minimum requirements are the SQL Engine, you can install this using the command line:

SQLEXPR.EXE /qn /ADDLOCAL=Sql_Engine INSTANCENAME=SQLEXPRESS

Everything you need will be installed.

4. Is it possiable to install sqlExpress in my application directory and not under the clients G:\Program Files\Microsoft SQL Server ?

Yes, there is a command line argument to control this, I think it is SQLINSTALLDIRECTORY or something equally clever. You can find it in the command line topic in Books Online.

If you're intersted, here are a couple blogs that discuss SQL Everywhere Edition.

Steve Lasker's Blog

SQL Everywhere Edition team blog

Mike

|||

Thank you very much for the reply Mike....

I was not aware of the post untill today...

I have spent about two weeks now strictly windows and command line operations perparing for this sql install... Even thow it will be about three months untill i will release my programs i needed to get a heavy duty soaking in the windows world.. I have worked with the web apps for about two years and i really like the windows app... :)

Your response is going to help me very much... Thanks a lot for taking the time to write this becuase this is such a big part of my solution.

Thanks,

erik

I might have more questions in a day or so...( i posted another one earlier today about how to get the value from the win calculator... after digging deep into the win world i see the usefullyness of interop ).. Dam! can;t be satisfied with just out of the box :)

The SQL Everywhere is extreamly attractive; however, i need just a little bit more than what it has to offer....

Monday, March 12, 2012

How to rebuild the master database.?

Installed SQLSERVER 2005 EVAL copy in my server and trying to rebuild the master database and it is not working.

I tried the following command.

start /wait setup.exe /qn INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=RAJESH

Any thoughts?

Thanks

First off, can you help me understand why you need to rebuild master instead of restoring from backup? Rebuilding master is typically done when it is too corrupt to allow the instance to start.

If the instance is running, that would probably prevent the procedure above from working. It isn't intended for running instances.

If your instance is down and it still doesn't work, please post the exact error message and we'll see what we can find out.

How to rebuild index ?

Hi,
We are using SQL Server 2000.
A developer asks us to rebuild the index of the database. However, from the
BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
a particular table.
Is there any command to do so ? So far as I know, rebuild index of the
database is part of the Database Maintenance Plan.
Thanks
DanielOne method is to generate and execute DBCC DBREINDEX commands using a script
like the example below.
DECLARE @.DBCC_Command nvarchar(4000)
DECLARE DBCC_Commands
CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'DBCC DBREINDEX(''' +
QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME) +
''')'
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = N'BASE TABLE' AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME)),
'IsMSShipped') = 0
OPEN DBCC_Commands
WHILE 1 = 1
BEGIN
FETCH NEXT FROM DBCC_Commands INTO @.DBCC_Command
IF @.@.FETCH_STATUS = -1 BREAK
RAISERROR(@.DBCC_Command, 0, 1) WITH NOWAIT
EXEC(@.DBCC_Command)
END
CLOSE DBCC_Commands
DEALLOCATE DBCC_Commands
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%23OsDDCj3GHA.1608@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from
> the BOL, I find that the command DBCC DBREINDEX can be used to rebuild
> index for a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>|||Peter wrote:
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from t
he
> BOL, I find that the command DBCC DBREINDEX can be used to rebuild index f
or
> a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
There is no index "of the database", indexes are on tables. I suspect
you were asked to rebuild all of the indexes IN the database, possibly
to remove fragmentation to address a performance problem.
Have a look here:
http://realsqlguy.com/serendipity/a...realsqlguy.com|||Peter,
to reindex all tables in a database you could use:
EXEC sp_msForEachTable 'DBCC DBREINDEX ("?")'
The maintenance plan will also give this functionality. I'd recommend
reading up on the difference between DBCC DBREINDEX and DBCC INDEXDEFRAG as
the former command is essentially an offline operation and if you have a
24/7 operation you'll need to consider the latter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

How to rebuild index ?

Hi,
We are using SQL Server 2000.
A developer asks us to rebuild the index of the database. However, from the
BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
a particular table.
Is there any command to do so ? So far as I know, rebuild index of the
database is part of the Database Maintenance Plan.
Thanks
Daniel
One method is to generate and execute DBCC DBREINDEX commands using a script
like the example below.
DECLARE @.DBCC_Command nvarchar(4000)
DECLARE DBCC_Commands
CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'DBCC DBREINDEX(''' +
QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME) +
''')'
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = N'BASE TABLE' AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME)),
'IsMSShipped') = 0
OPEN DBCC_Commands
WHILE 1 = 1
BEGIN
FETCH NEXT FROM DBCC_Commands INTO @.DBCC_Command
IF @.@.FETCH_STATUS = -1 BREAK
RAISERROR(@.DBCC_Command, 0, 1) WITH NOWAIT
EXEC(@.DBCC_Command)
END
CLOSE DBCC_Commands
DEALLOCATE DBCC_Commands
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%23OsDDCj3GHA.1608@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from
> the BOL, I find that the command DBCC DBREINDEX can be used to rebuild
> index for a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
|||Peter wrote:
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from the
> BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
> a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
There is no index "of the database", indexes are on tables. I suspect
you were asked to rebuild all of the indexes IN the database, possibly
to remove fragmentation to address a performance problem.
Have a look here:
http://realsqlguy.com/serendipity/ar...A-Wall...html
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Peter,
to reindex all tables in a database you could use:
EXEC sp_msForEachTable 'DBCC DBREINDEX ("?")'
The maintenance plan will also give this functionality. I'd recommend
reading up on the difference between DBCC DBREINDEX and DBCC INDEXDEFRAG as
the former command is essentially an offline operation and if you have a
24/7 operation you'll need to consider the latter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

How to rebuild index ?

Hi,
We are using SQL Server 2000.
A developer asks us to rebuild the index of the database. However, from the
BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
a particular table.
Is there any command to do so ? So far as I know, rebuild index of the
database is part of the Database Maintenance Plan.
Thanks
DanielOne method is to generate and execute DBCC DBREINDEX commands using a script
like the example below.
DECLARE @.DBCC_Command nvarchar(4000)
DECLARE DBCC_Commands
CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'DBCC DBREINDEX(''' +
QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME) +
''')'
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = N'BASE TABLE' AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME)),
'IsMSShipped') = 0
OPEN DBCC_Commands
WHILE 1 = 1
BEGIN
FETCH NEXT FROM DBCC_Commands INTO @.DBCC_Command
IF @.@.FETCH_STATUS = -1 BREAK
RAISERROR(@.DBCC_Command, 0, 1) WITH NOWAIT
EXEC(@.DBCC_Command)
END
CLOSE DBCC_Commands
DEALLOCATE DBCC_Commands
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%23OsDDCj3GHA.1608@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from
> the BOL, I find that the command DBCC DBREINDEX can be used to rebuild
> index for a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>|||Peter wrote:
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from the
> BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
> a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
There is no index "of the database", indexes are on tables. I suspect
you were asked to rebuild all of the indexes IN the database, possibly
to remove fragmentation to address a performance problem.
Have a look here:
http://realsqlguy.com/serendipity/archives/12-Humpty-Dumpty-Sat-On-A-Wall...html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Peter,
to reindex all tables in a database you could use:
EXEC sp_msForEachTable 'DBCC DBREINDEX ("?")'
The maintenance plan will also give this functionality. I'd recommend
reading up on the difference between DBCC DBREINDEX and DBCC INDEXDEFRAG as
the former command is essentially an offline operation and if you have a
24/7 operation you'll need to consider the latter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

How to read XML if I have no OWC?

Dear all,
I have a XML file which is generated from pivot table (using
"pivottable.xmldata" command to generate). Now, I want to read this file in
another computer. However, there is no office web component (OWC) in this
computer. I don't want to buy any commercial product to view the data. So,
how can I read the data in this file? Can I use datagrid to display the data?
Thanks!
Polly
Your best bet is probably to apply an XSLT stylesheet to render the XML data
as HTML. See
http://msdn.microsoft.com/library/de...ml/conXSLT.asp
for more information.
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Polly" <Polly@.discussions.microsoft.com> wrote in message
news:38E539D8-B5F6-4478-9277-84EC06152FAA@.microsoft.com...
Dear all,
I have a XML file which is generated from pivot table (using
"pivottable.xmldata" command to generate). Now, I want to read this file in
another computer. However, there is no office web component (OWC) in this
computer. I don't want to buy any commercial product to view the data. So,
how can I read the data in this file? Can I use datagrid to display the
data?
Thanks!
Polly

Friday, March 9, 2012

How to read the DBCC page through cleint application

Hi,
I am writing a application that require to read some DBCC Pages.
But when I execute dbcc page command through ADO, I get a page in terms of e
rror collection.
In that error collection each row of output is just a string.
I need to interpret that string value.
Is there some other way through which I can read DBCC Page.
I am interseted only in the memory dump portion of the page.
Is there some better way to read the data base page or I need to use this er
ror collection method only.
Any help is appreciated.
Thanks
PushkarHi
You may want to use DBCC BYTES but you will have to calculate the starting
address. Ken Henderson's "The Guru's Guide to Transact-SQL" ISBN
0-201-61576-2 gives some information on all these undocumented calls and
using them in production code carries the usual health warnings.
John
"Pushkar" wrote:

> Hi,
> I am writing a application that require to read some DBCC Pages.
> But when I execute dbcc page command through ADO, I get a page in terms of
error collection.
> In that error collection each row of output is just a string.
> I need to interpret that string value.
> Is there some other way through which I can read DBCC Page.
> I am interseted only in the memory dump portion of the page.
> Is there some better way to read the data base page or I need to use this
error collection method only.
> Any help is appreciated.
> Thanks
> Pushkar|||I believe that you can add WITH TABLERESULTS to get back a resultset instead
a string (messages).
Note: It is not supported or documented (but nor is DBCC PAGE, so you are on
your own anyhow :-) ).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Pushkar" <pushkartiwari@.gmail.com> wrote in message news:%23x6XXvsvFHA.1256
@.TK2MSFTNGP09.phx.gbl...
Hi,
I am writing a application that require to read some DBCC Pages.
But when I execute dbcc page command through ADO, I get a page in terms of e
rror collection.
In that error collection each row of output is just a string.
I need to interpret that string value.
Is there some other way through which I can read DBCC Page.
I am interseted only in the memory dump portion of the page.
Is there some better way to read the data base page or I need to use this er
ror collection method
only.
Any help is appreciated.
Thanks
Pushkar|||Thanks, I think this will solve my problem.
Pushkar
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OG8y%23h4vFHA.464@.TK2MSFTNGP15.phx.gbl...
>I believe that you can add WITH TABLERESULTS to get back a resultset
>instead a string (messages). Note: It is not supported or documented (but
>nor is DBCC PAGE, so you are on your own anyhow :-) ).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Pushkar" <pushkartiwari@.gmail.com> wrote in message
> news:%23x6XXvsvFHA.1256@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I am writing a application that require to read some DBCC Pages.
> But when I execute dbcc page command through ADO, I get a page in terms of
> error collection.
> In that error collection each row of output is just a string.
> I need to interpret that string value.
> Is there some other way through which I can read DBCC Page.
> I am interseted only in the memory dump portion of the page.
> Is there some better way to read the data base page or I need to use this
> error collection method only.
> Any help is appreciated.
> Thanks
> Pushkar
>

Friday, February 24, 2012

how to quit an sproc

Hi

I am doing a check and on failing, i have a raiseerror command.
I was assuming, once proc reaches raiseerror, it would stop the proc,
but i see that the proc gives me an error message, but continues to
run thru all the rest of the steps after raiseerror.
how do i make the proc quit after reading raiseerror, only thru
labels ?

IF @.CheckIFFileHasOnlyOneOutputType 1
BEGIN
RAISERROR ('Process Stopped. Input xls file is invalid, as it has more
than one output type specified in the OutputType Column', 16, 1)
END
--more proc steps are here ...

Thanks in advance :
RS(rshivaraman@.gmail.com) writes:

Quote:

Originally Posted by

I am doing a check and on failing, i have a raiseerror command.
I was assuming, once proc reaches raiseerror, it would stop the proc,
but i see that the proc gives me an error message, but continues to
run thru all the rest of the steps after raiseerror.
how do i make the proc quit after reading raiseerror, only thru
labels ?


Which version of SQL Server are you using?

In SQL 2000 you will need to use the RETURN statement. Preferrably you
return a value 0, so that the caller knows that things went wrong.

On SQL 2005 you can embed the code in BEGIN TRY END TRY, and then in
BEGIN CATCH END CATCH have some generic error handling, including a
RETURN statement.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx