Showing posts with label analyzer. Show all posts
Showing posts with label analyzer. Show all posts

Monday, March 26, 2012

How can I Query Analyze DB Greater than 128MG

I have a 300MG DB and Query Analyzer gives me the "... DB larger than configured..." error when I try to connect to it...

What is the work around?

Thanks in advance

JEK

If you have sql server 2005 you can use the sql server management studio to connect to your sql ce (.sdf) database.
|||In SQL Server Management Studio, in the Connect To Server dialog, click "Options >>", and you will be able to increase the max db size from the default of 128 MB.|||I need to use Query Analyzer 3.0 on the Handheld|||There is no workaround this "bug". Await the next version or move the SDF file to your desktop and use one of the tools mentioned above.

How can I Query Analyze DB Greater than 128MG

I have a 300MG DB and Query Analyzer gives me the "... DB larger than configured..." error when I try to connect to it...

What is the work around?

Thanks in advance

JEK

If you have sql server 2005 you can use the sql server management studio to connect to your sql ce (.sdf) database.
|||In SQL Server Management Studio, in the Connect To Server dialog, click "Options >>", and you will be able to increase the max db size from the default of 128 MB.|||I need to use Query Analyzer 3.0 on the Handheld|||There is no workaround this "bug". Await the next version or move the SDF file to your desktop and use one of the tools mentioned above.

Friday, March 23, 2012

How can i output result to a log file?

Hi all,
In case i have a script file containt tables, functions, ... when i use Query Analyzer to run this file, the result output in a window. Now i want this result output to a file named logfile.txt. How can i do that?
Thanks first.qa has this capability. Options -> Results -> Defaul results to: FILE.

if you want to do it from command line, you can use OSQL. See book online for details.

How can I obtain the tine via Query Analyzer?

I know that that is a stupid thing but I can't remember it.
thanks thousandsIf you meant, time, then:
SELECT CURRENT_TIMESTAMP
or
SELECT GETDATE()
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:0B99C351-23F4-42CC-8B7B-F7B671B84569@.microsoft.com...
I know that that is a stupid thing but I can't remember it.
thanks thousands|||Cheers,
"Narayana Vyas Kondreddi" wrote:

> If you meant, time, then:
> SELECT CURRENT_TIMESTAMP
> or
> SELECT GETDATE()
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Enric" <Enric@.discussions.microsoft.com> wrote in message
> news:0B99C351-23F4-42CC-8B7B-F7B671B84569@.microsoft.com...
> I know that that is a stupid thing but I can't remember it.
> thanks thousands
>
>|||Hi Enric
Vyas answered the question, but this is just an extension for the answer you
might be interested in it:
SELECT CONVERT(varchar(8),getdate(),108)
this will give you present time
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Enric" wrote:
> Cheers,
> "Narayana Vyas Kondreddi" wrote:
>

Friday, February 24, 2012

How can I get back the lost view?

Hi,

I am a newbie working on MS Sql Server 2000 for a while. I accidentally deleted a view through Query Analyzer and want to get it back. All data are backed-up every day but there are a lot of red tapes I have to go through in order to draw the lost view from the backup. Indeed, a different division is taking care of backups in our organization and they don't want to spend time on my issue.

I'm wondering if there is an automatic logging capability of sql server showing modified/ deleted/ updated data objects on daily basis with their contents that can be accessed later on. Or is there another recovery mechanism that can be used to get back the lost view?

Thanks for your attention to this matter,

Batuhan

Hi,

as this is your first post in here, welcome to the groups :-)

Actions are logged within the tranaction log of SQL Server, but if you did not change the view (with an alter or create command) there will be no information in the log to rely on, in addition you would need to have the last backup for applying the transaction (log) to this version. i guess you will have to go the hard way and let the backup division restore the database for you to an older version. Thats why I keep a script of my database as a "small" backup to restore the object that are just scriptable Perhaps you should add this as a best practise to your daily work.


HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

I'd like to second Jens's suggestion to keep track of the T-SQL that was used to generate any database object - think of it as the database source code. You can manage that as you manage your application code, using SourceSafe, for example.

Thanks
Laurentiu

|||

Thanks for replying my post.

I'm really curious about the content of transaction-log. Does it record every change we made in the database or just 'transactions'?
Does it cover logging of update, insert, delete operations that were executed in the database? Another question is how I can view the transaction log. Do you know any free software tool to read transaction log?

Batuhan

|||Statements are wrapped in transactions to ensure the ACID of databases. You can either use explicit transactions using BEGIN TRANSACTIONS or the appropiate functionality of the provider like the ADO.NET implementation or implicit while doing a regular DML operation which is not wrapped up in a explicit transaction. The transactionlog cannot be viewed easily, there are special (non-free tools) for viewing these like this from L**igent (you will propably find the name searching on the internet).

There is an undocumented way to read the log, but this is sort a cryptic to investigate:

DBCC Log('tempdb',1) --use the appopiate parameters to read the log

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Sunday, February 19, 2012

How can I get a count of all records in each table in my DB?

Hoping you can help me here... I have a situation where I need to provide
a
script that can be run through query analyzer to return the number of record
s
in each table in my DB.
I would like it to be dynamic, as the number of tables in the DB changes.
Pretty simple query (Select count(*) from tblXXX), but I can't seem to find
where the actual table names are stored within the system tables so that I
can run through all of them.
I know that I could use Enterprise Manager and view the DB as a TaskPad to
see the number of records in each table, but the person who will be doing
this only has permissions to view the DB through QA.
Any thoughts on a script that will do this?
Thanks in advance...
gTry,
use northwind
go
-- undocumented sp
exec sp_msforeachtable 'select ''?'', count(*) from ?'
go
-- using sysindexes
dbcc updateusage (0)
select object_name([id]), rowcnt
from sysindexes
where indid in (0, 1) and objectproperty([id], 'IsUserTable') = 1
order by 1
go
-- using a cursor and dyanmic sql
create table #t (
table_name sysname,
rowcnt int,
)
declare @.sql nvarchar(4000)
declare @.ts sysname
declare @.tn sysname
declare my_cursor cursor
local
fast_forward
for
select
table_schema,
table_name
from
information_schema.tables
where
table_type = 'BASE TABLE'
open my_cursor
while 1 = 1
begin
fetch next from my_cursor into @.ts, @.tn
if @.@.error != 0 or @.@.fetch_status != 0 break
set @.sql = N'select ''' + @.tn + ''' as table_name, count(*) as rowcnt from
[' + @.ts + '].[' + @.tn + ']'
insert into #t
exec sp_executesql @.sql
end
close my_cursor
deallocate my_cursor
select * from #t order by table_name
drop table #t
go
AMB
"Greg Toronto" wrote:

> Hoping you can help me here... I have a situation where I need to provid
e a
> script that can be run through query analyzer to return the number of reco
rds
> in each table in my DB.
> I would like it to be dynamic, as the number of tables in the DB changes.
> Pretty simple query (Select count(*) from tblXXX), but I can't seem to fin
d
> where the actual table names are stored within the system tables so that I
> can run through all of them.
> I know that I could use Enterprise Manager and view the DB as a TaskPad to
> see the number of records in each table, but the person who will be doing
> this only has permissions to view the DB through QA.
> Any thoughts on a script that will do this?
> Thanks in advance...
> g|||In SQL Server 2000:
DBCC UPDATEUSAGE(0);
select o.name, i.rowcnt
from sysobjects o
inner join sysindexes i
on o.id = i.id
WHERE i.indid IN (0,1)
AND OBJECTPROPERTY(o.id, 'IsMsShipped') = 0
ORDER BY o.name
In SQL Server 2005, it's a little more complex, accounting for table
partitions:
SELECT
t.name,
[RowCount] = SUM
(
CASE
WHEN (p.index_id < 2) AND (a.type = 1) THEN p.rows
ELSE 0
END
)
FROM
sys.tables t
INNER JOIN sys.partitions p
ON t.object_id = p.object_id
INNER JOIN sys.allocation_units a
ON p.partition_id = a.container_id
GROUP BY
t.name;
"Greg Toronto" <GregToronto@.discussions.microsoft.com> wrote in message
news:1AEB569D-DA79-4B7B-9892-932B37D4823E@.microsoft.com...
> Hoping you can help me here... I have a situation where I need to
> provide a
> script that can be run through query analyzer to return the number of
> records
> in each table in my DB.
> I would like it to be dynamic, as the number of tables in the DB changes.
> Pretty simple query (Select count(*) from tblXXX), but I can't seem to
> find
> where the actual table names are stored within the system tables so that I
> can run through all of them.
> I know that I could use Enterprise Manager and view the DB as a TaskPad to
> see the number of records in each table, but the person who will be doing
> this only has permissions to view the DB through QA.
> Any thoughts on a script that will do this?
> Thanks in advance...
> g