Thursday, March 29, 2012
How restore BAK file?
Server and Database Server Supervisor and backed up with SDX Archiver.
Avaya says it's using Microsoft's SQL database.
Question: How do I restore a database? I have a .BAK file that I need to
restore, to try to retreive some data. Avaya says it's a standard Microsoft
SQL backup.
Can someone tell me how to restore this backup? I know Windows, but I've
never used any flavor of SQL.
thanks,
BillYou can read about the RESTORE DATABASE command in Books Online. If you are totally new on SQL
Server, I suggest you pick up a book at appropriate level, that will save you lots of time.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Bill" <Bill@.discussions.microsoft.com> wrote in message
news:01FB537F-9227-485F-9A4D-D23CB8EB3718@.microsoft.com...
> We use Avaya IP Office. Call records are stored in programs such as Delta
> Server and Database Server Supervisor and backed up with SDX Archiver.
> Avaya says it's using Microsoft's SQL database.
> Question: How do I restore a database? I have a .BAK file that I need to
> restore, to try to retreive some data. Avaya says it's a standard Microsoft
> SQL backup.
> Can someone tell me how to restore this backup? I know Windows, but I've
> never used any flavor of SQL.
> thanks,
> Bill|||Hi Bill,
If you don't know SQL Server, then you must be unawared of Books Online...
Here, you can find info regarding to Backup and Restore in SQL Server 2005
under this topic.
http://msdn2.microsoft.com/en-us/library/ms187048.aspx (This is Books
Online)
If you need further help, we are around here.
Ekrem Ã?nsoy
"Bill" <Bill@.discussions.microsoft.com> wrote in message
news:01FB537F-9227-485F-9A4D-D23CB8EB3718@.microsoft.com...
> We use Avaya IP Office. Call records are stored in programs such as Delta
> Server and Database Server Supervisor and backed up with SDX Archiver.
> Avaya says it's using Microsoft's SQL database.
> Question: How do I restore a database? I have a .BAK file that I need to
> restore, to try to retreive some data. Avaya says it's a standard
> Microsoft
> SQL backup.
> Can someone tell me how to restore this backup? I know Windows, but I've
> never used any flavor of SQL.
> thanks,
> Billsql
How output all Stored Procedures to a table or file
Thanks,
PeterRight-click your database in Enterprise Manager, select All tasks, Generate Sql script, there you can choose All stored procedures and other objects/options. mojza|||Fantastic Mojza - thanks for the help!
Peter|||Along this same line, this is what we do in order to generate script files that we then place into SourceSafe for version control. I am just learning that end of the department's process, but it seems to me I see stored procs at the system level for version control stuff, but need to look farther into that to see what other stuff we might use.
The script-to-VSS solution seems cheesy to me, but without taking this to be a "How do I do it" question, I'd just like to ask, is there an easier way? I can go look in BOL, but just saw the thread and was reminded of our local cheese factory, so thought I'd ask for quick-n-dirty impressions.|||Use VBA with SQL-DMO (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqldmo/dmoref_con01_2yi7.asp), possibly within DTS (http://msdn.microsoft.com/library/en-us/dtssql/dts_basic_5zg3.asp)?
-PatP
Wednesday, March 28, 2012
how much storage does a null xml data type column use if...
1) it is in the same filegroup as the rest of the table?
2) it is stored in a filegroup separately from the rest of the table (I think this is allowed)?
moving this over to the database engine forum.sqlMonday, March 26, 2012
How much performance gained by qualifying tables with dbo. in the database?
The great majority of our queries and stored procedures do not
reference the tables with the dbo.table_name format. Due to some
production issues, we're not facing a situation that is forcing us to
redo our database by scripting it out, making a few modificationsm, and
importing the data right back into it. (please don't aske me why!)
I believe now is a perfect opportunity to owner-qualify all references
to the tables with dbo.table_name in the database scripts, and I
strongly believe the performance gain will be significant.
I need to sell this idea to my boss who thinks the risks of
manupulating the production database scripts is far graver than its
benefits, and he wants to now "how much" performance is gained by doing
this.
What do you folks think is a good answer to him? How can I show some
tangible benefits in terms of "gained performance"?
Thanks for you help!Hi Dan
Using the dbo prefix should help cache hits, and the performance gain will
depend on how busy your server is, it could be very little, but then I would
implement it regardless as it is "using best practices". Check out the
current cache misses using SQL profiler. You would also need to add prefixes
for stored procedures, views etc... At the same time you may want to check
the case being consistent.
If you don't use source code control then maybe this is the time start using
it!!
You can gain confidence in the outcome by comparing the two databases.
You should also do a full regression test, and it sounds like your superior
does not have confidence in the outcome of this.
Make sure that you cover all eventualities in the implementation plan and
have backout strategies at each stage. Do some trail runs (on copies of live
data) to get timings and proof that it works.
John
"Dan Gorrison" wrote:
> Hello Folks:
> The great majority of our queries and stored procedures do not
> reference the tables with the dbo.table_name format. Due to some
> production issues, we're not facing a situation that is forcing us to
> redo our database by scripting it out, making a few modificationsm, and
> importing the data right back into it. (please don't aske me why!)
> I believe now is a perfect opportunity to owner-qualify all references
> to the tables with dbo.table_name in the database scripts, and I
> strongly believe the performance gain will be significant.
>
> I need to sell this idea to my boss who thinks the risks of
> manupulating the production database scripts is far graver than its
> benefits, and he wants to now "how much" performance is gained by doing
> this.
>
> What do you folks think is a good answer to him? How can I show some
> tangible benefits in terms of "gained performance"?
>
> Thanks for you help!
>
Friday, March 23, 2012
How many Stored Procedure can I add to a database in SQL SERVER 2005 Express edition?
How many Stored Procedure can I add to a database in SQL SERVER 2005 Express edition?
I remember that only 32 Stored Procedure can be added to a database in SQL SERVER 2005 Express edition,
but now I can add over 32 Stored Procedure to a database from SQL Server Management Studio Express CTP!
How many Stored Procedure can I add to a database in SQL SERVER 2005 Express edition?
Wednesday, March 21, 2012
How many records can handle?
I have a replication procedure in my ASP file and also i am using the stored procedure for inserting records.
My doubt is i have 67500 records in my Text file. I am trying to insert each line into my sqlserver dB.
Sqlserver can handle this replicaton..?I don't know if this will help, but as a comparison, we have a few upload processes written in Cold Fusion that takes various files (including CSV, Excel, and Text) and inserts/updates records on the fly in one of our SQL Server databases, and the records inserted/updated are in the upper limits of 100,000 per file.
Couple things to think about:
1) Make sure that you have identified a long time-out period in your ASP script, since that will affect the processing time, meaning that if you don't increase the time threshold in your script, than the script will probably time out.
2) Make sure that you set your SQL Server for a longer time-out period for receiving requests.
Q: Are you planning on running this process in the background, like as a Scheduled Task -or- is this is a script you'll be running from the web browser?|||When i submit the form it has to be generate and save it into Database. so upto that the form should be appering in same position.|||Originally posted by buddu
When i submit the form it has to be generate and save it into Database. so upto that the form should be appering in same position.
Sorry, I don't understand your response. Could you provide more details about your end goals of this particular project?sql
Friday, March 9, 2012
how long a table blocked
rows or the table itself is locked. The only information I am
not able to get is the time when the lock occurred. The way I
want is that if I run the procedure it should show all locks
on a table which are at least 5 or x seconds old. This way I can
avoid momentary locks on a table which go away after few seconds.
Which table and column of master database has that information?
Thanks.
--
email id is bogusrkusenet (rkusenet@.sympatico.ca) writes:
> I have written a stored procedure to list out all tables in which
> rows or the table itself is locked. The only information I am
> not able to get is the time when the lock occurred. The way I
> want is that if I run the procedure it should show all locks
> on a table which are at least 5 or x seconds old. This way I can
> avoid momentary locks on a table which go away after few seconds.
> Which table and column of master database has that information?
I'm afraid that this information is not available. There is a
req_lifetime column in syslockinfo, which is carefully document,
but the essence of the documentation is that this is an internal
column.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||To my knowledge that info is not available. And maybe not so interesting (my
opinion) Technicaly what is interesting about locked table is the fact that
others have to wait because they want access to the table (or rows or keys
or whatever) in an incompatible mode.
The nice thing about this is that the time information about that fact is
available, but maybe hard to get through a stored proc. But a good sp
programmer should be able figure that out ;-)
The wait information is in sysprocesses, if the 'lastwaittype' is of type
'LCK..' a spid is waiting for a lock (if waittime > 0) (or 'waittype between
0x01 and 0x1f). 'Waitresource' will show what is being waited for TBL/KEY
etc. and waittime how long the spid is waiting now.
I hope that brings you closer to what you want..
--
regards,
Mario
http://www.sqlinternals.com
"rkusenet" <rkusenet@.sympatico.ca> wrote in message
news:bn458j$sh9a5$1@.ID-75254.news.uni-berlin.de...
> I have written a stored procedure to list out all tables in which
> rows or the table itself is locked. The only information I am
> not able to get is the time when the lock occurred. The way I
> want is that if I run the procedure it should show all locks
> on a table which are at least 5 or x seconds old. This way I can
> avoid momentary locks on a table which go away after few seconds.
> Which table and column of master database has that information?
> Thanks.
> --
> email id is bogus|||"Mario" <nospam@.sqlinternals.com> wrote in message news:3f963fc0$0$58711$e4fe514c@.news.xs4all.nl...
> To my knowledge that info is not available. And maybe not so interesting (my
> opinion) Technicaly what is interesting about locked table is the fact that
> others have to wait because they want access to the table (or rows or keys
> or whatever) in an incompatible mode.
> The nice thing about this is that the time information about that fact is
> available, but maybe hard to get through a stored proc. But a good sp
> programmer should be able figure that out ;-)
> The wait information is in sysprocesses, if the 'lastwaittype' is of type
> 'LCK..' a spid is waiting for a lock (if waittime > 0) (or 'waittype between
> 0x01 and 0x1f). 'Waitresource' will show what is being waited for TBL/KEY
> etc. and waittime how long the spid is waiting now.
> I hope that brings you closer to what you want..
thanks Mario and Erland. With your help I am able to develop the stored procedure
we require.
--
email id is bogus
Friday, February 24, 2012
how i use the N Switch in Stored Procedure
When I use Such a this syntax i am encountered and stoped with a error.
the is below(Stoerd Prdocedure Code)
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
CREATE proc sp_check_userpass(@.username nvarchar(50),@.password nvarchar(50),@.first nvarchar(50),@.last nvarchar(50),@.email nvarchar(50),@.stage int )as
declare @.cnt int
begin
select @.cnt=count(*) from member_info where (@.username=username and @.password=password)
if(@.cnt=0)
begin
insert into atable(first,last,username,password,stage) values(@.first,@.last,@.username,@.password,@.stage)
end
else
return @.cnt
end
GO
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Other thing is that when exec this store proc it must be return a value return back to the @.cnt but it is return only This( The command(s) Completed succefully).
Any One guide me how i can must be do .
i must clear it that i am using this query in ASP.NET SqlClient Object To Execute Query.
Thanx In Advance. ArQaI can't see any use of the unicode string constant prefix (i.e. N'Hello world') in your procedure. Did I miss something?
A UDF (User Defined Function) might better suit your needs than a stored procedure, although a UDF couldn't write to a table in order to log the failure for you. Very few client tools have the ability to support return values from stored procedures, although that is possible in most of the languages that support ADO.NET. You can get more information about this in KB#308051 (http://support.microsoft.com/default.aspx?scid=kb;en-us;308051).
-PatP