SQL Tools :: Media Set Has 2 Media Families But Only 1 Provided

Feb 13, 2014

We are getting error and we are aware that there should be 2 files but we are able to find the second file,how to search all files(2) so that we may restore DB.

View 4 Replies


ADVERTISEMENT

The Media Set Has 2 Media Families But Only 1 Are Provided

Nov 6, 2007

Hi, I'm from Argentina. I made a backup of my database from ServerA (SQL 2000) and trying to restore it to ServerB (SQL 2005) I'm getting the following error: "The media set has 2 media families but only 1 are provided".

Any ideas? Thanks.

View 5 Replies View Related

Append To Media Vs Overwrite An Existing Media In SQL Server Database Backup

Sep 24, 2007

Dear All,

I know the basic defiinition of these two options, but i am not very clear why would someone choose one over another,
currently I am using Append to Media option, and every day backup, I see my backup files growing in size.

can someone give me nice example about these two options,

Thanks,

View 10 Replies View Related

32bit Admin Tools When The Only Media You Have Is 64 Bit

Jun 13, 2006

We have jumped straight to 64 bit SQL 2005 with no 32 bit 2005 inbetween.

However this means the tools we have cannot be installed on windows XP/2000 32 bit.

Is there some way to get the 32 bit tools as it appears strange that 32 bit tools were not provided for remote access.

Cheers

Julian

View 6 Replies View Related

Restore From Media

Jul 8, 2007

currently if I want to restore 1 db to another i do

RESTORE DATABASE userr
FROM DISK = 'd:sqlbackupsuser.bak'
WITH MOVE 'user' TO 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAuserr.mdf',
MOVE 'user_log' TO 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAuserr_log.ldf',

REPLACE


now I am backing up my db to a media - How can I do the same restore above but from that media (I don't remember what I made the media point to -- how can I find this out)

View 8 Replies View Related

Media Question

Jul 20, 2005

Hi Folks..I have a question i want's to make a website where people can upload mediafiles like movies short movies of a minut or 3 max. Can i store those mediafiles like mp3, mpg etc.. for instance in a sql-server database, or is thisnot wise to do?Thanx in advance..

View 1 Replies View Related

Media Center

Jan 30, 2006

Help, I'm trying to burn a CD using Windows Media Player 10. I keep getting the message-interface not registered. I tried to download WMP, and it says it cannot because there is already a more recent version already installed. Should I uninstall WMP, and then reinstall it. If so, how do i do that, I cannot find it on the control panel!

Thank You for your help

View 1 Replies View Related

(Can't Get) Media For SQL Server 2005

Dec 29, 2005

We have a software assurance contract, and we getour media from a Microsoft Certified Partner.Our MCP hasn't been able to provide us with media forSQL Server 2005.It's been 7 weeks since the launch; I expected the product tobe in the channel by now.Anybody else (especially software assurance customers) havingtrouble getting the goods from MCPs and/or resellers?

View 1 Replies View Related

How Well Is SQL Server 2005 Handling Media?

Dec 12, 2006

I'm thinking of storing a lot of images, Word documetns, PDF, and emails as media in SQL Server 2005. Is it equiped to handle a lot of media? Or is it still preferred to store media separately on a file server?

View 6 Replies View Related

Inserting Video From Sql Into Embedded Media

May 2, 2007

Hi i have a video file path stored in my sql database and i have an embedded media player in my web page, how can i load up a different video file into the embedded media player based on movie id or movie name, this is the code i have written so far but im unsure if im in the right direction, thanks

View 2 Replies View Related

Working With Removable Media Databases... Need Help

Apr 3, 2000

Does anyone out there work with databases created using sp_create_removable?

I am encountering a situation that is a difference between 6.5 and 7.0 handling of these types of databases. In 6.5, our product creates a removable database on a fixed hard drive. When the user is ready to move the database to a jazz or zip drive, we set the database readonly and remove the log file. No problems. We can use sp_dbinstall witout a log file and everything works just fine.

In 7.0 we do the same thing, however, when we attach the database via sp_attach_db (which replaced sp_dbinstall), SQL Server 7 creates a new log file.

Is there any way to make SQL Server NOT re-create this log file?

View 1 Replies View Related

Deleting Media Set After A Full Backup

Nov 29, 2000

We are doing a full backup at night. During the day we are doing a backup of the log every hour. How do I delete the log backups from the media without deleting the device itself. I would like to do this once we have a full backup for the day. The media we are backing up the logs to is disk.

View 3 Replies View Related

Create Backups Without Appending Media?

Jan 4, 2005

Hey All,
I am currently backing up a SQL 2000 Database by doing full backups everynight. I would like to cut this back to once a week and do differential backups during the week. BUT... How can I do differential backups without appending or overwriting the night befores backup? I'm sure this can be done through command line but im not exactly sure of the process. If anyone can help please post...

Thanks,
Jared

View 4 Replies View Related

Back Up Media , Device , Tape !!!!!

Jan 12, 2007

Hi all , hope my post finds u all well.

Currently I was reading about how to create a backup and i have some questions and i hope to find helpful answers..

what is back up media ,device and tape ?
how to initialize the media and what is the need for something like that ?
what about media headers that must be written ?


thanks in advance
Davids Maguire

View 1 Replies View Related

SQL Server 2005 Standard Media

Jan 31, 2008

I am new to the forums, so hopefully this is the correct place for this question.

Is there somewhere to download the media for SQL Server 2005 Standard? I already have my licensing, and am wondering if you can avoid purchasing the media discs. I have done this with Windows Vista and Office 2007 in the past.

View 3 Replies View Related

Help Me Connet Windows Media To MSN Video

Dec 23, 2005

  can you help me ? i want watch television on internet , good quality screen , no tracking , good audio , fast stream , can you show me ? or fix or update ,, thank you very much ,,,, have a nice day ,,,,,

View 1 Replies View Related

Windows XP Media And SQL Server 2005

Sep 11, 2006

I'm not finding a definitive answer to my question as to whether or not I can run the development edition of SQL Server 2005 on my brand new pc with this operating system. No one seems to know for sure and I can't afford to pay for tech. support. It should be supported but I don't know where to get a 'real' answer.

thx,

Kat

View 3 Replies View Related

SQL2000 / .ldf Media Failure / How To Recover

Jul 12, 2007

It was difficult to enter a subject that coveres what I want to ask and also the explanation isn't trivial.

The question is for SQL server 2000 (I can't upgrade so solutions should be feasable on 2000). If patch level is an issue it chouldn't be a problem to patch to the level needed if it isn't there already.

The database has in full logged recovery mode and its .mdf filel and .ldf files are on 2 seperate disk locations (lets name these M: for the .mdf files and L: for the .ldf files).

Now whenever I read something about media failure it's allways about a failure of M: and how you then can backup you latest log file and have an 'up to the time of distaster' recovery. And that works fine. I played around a bit by putting M: and L: on a test machine on USB sticks, so that I could simulate media failures.

When I yank L: and simulate a media failure of the .ldf files the problem starts. You can't handle that database anymore since it becomes suspect and making a backup is not possible anymore (neither dbf nor ldf backup)

What I was able to do to get as close as possible to the time of failure was this:

1. Detach the database
2. Move the current .mdf file to a different location
(3. here I do whatever is needed to get the physical system working again)
4. Restore the database from the last full backup
5. Change the database to simple recovery model (needed to perform step 8)
6. Detach the database
7. change the restored .mdf file with the one set asside in step 2
8. attach the database
9. return to full logged

I then have a (and thats the main question actually) seemingly working database again with more data in it then I would have when doing the recovery by restoring the last full backup and all transaction log backups. To emphasis this: if I would have a weekly full and daily transaction log backups, if could lose up to a day of data, with the outlined method I would have much more data.

Now I know that the data are firstly written to the .ldf files and then to the .mdf files whenever the server has time for it (at least that is how I understand it) and so I should get more data then doing it the 'traditional' way.

How correct is that assumption and if so: how consistent are the data in that 'recovered' .mdf file?

View 5 Replies View Related

Do We Get SQL2000 Media With A SQL2005 Purchase?

Mar 13, 2007



My company is planning to purchase a SQL2005 standard Processor license (unlimited users - about $5000)

Does anyone know if we can obtain SQL2000 media along with the purchase. Because of the app we are running and its stage of development, we have to install and run SQL2000 for about 6 months before we can run Sql2005. We dont want to purchase SQL2000 for such a short term use.

I asked a DELL rep to help me with this over a month ago and he still has no answers for me.

Any help with this would be greatly appreciated.

View 4 Replies View Related

Insall SSMS From 64 Bit Media On 32 Bit Workstation

Jan 8, 2007

I'm having no success install SSMS on a 32 bit workstation from 64 bit media.

I'm aware from researching that the SSMS is 32 bit, in fact I see it run as a 32 bit app on the server.

However, when i try and install from the 64 bit CD or DVD I get errors such as not a valid Win32 application, or when i tre random msi's guessing as to which is ssms I get "This installation package is not supported by this processor type. Contact yoru product vendor."

I run a Pent D 2.8 on 32 bit XP

Any assisstance on how to install SSMS on a 32 bit workstation from the 64 bit media would be greatly appreciated.

View 1 Replies View Related

Installing SQl Server 2000 (2k) On Media Center

May 16, 2006

Hi, hope someone can help...

I'm trying to install SQL Server 2000 on my XP Media Center laptop and keep getting the "this operting system is not supported message"

Any ideas?

Many thanks....

View 4 Replies View Related

Cannot Install SQL Express On XP Media Center Edition

May 30, 2008

Hi,
This is my first post. I am trying to install SQL express on my PC but it keeps on having this error:
"encountered an unexpected error in datastore. The action is setdialogs..."

I have searched far and wide for a solution to this problem. Some solutions worked for others, but none worked for me so far.
I don't have a previously installed sql version on my laptop. But just to check, I followed the steps in using msiinv.exe to detect any previously installed software. I am pretty sure that there was no sql server entry in the output file.

I have all the requirements, installed (.net framework 2.0,etc). I have all the latest Windows updates (except XP SP3).
My laptop is well above the minimum requirements for sql express ( Core 2 processor, 2 gigs ram, 7Gigs free space).

I have the Protected Storage service running (which I found out was required to install sql server).
I even followed the directions to fix Cryptograhical services.

I am runninng out of options here.

Thank you for your replies.

Here's my log:
[code]
Microsoft SQL Server 2005 Setup beginning at Fri May 30 11:20:48 2008
Process ID : 564
c:487084033731d74b14setup.exe Version: 2005.90.3042.0
Running: LoadResourcesAction at: 2008/4/30 11:20:48
Complete: LoadResourcesAction at: 2008/4/30 11:20:48, returned true
Running: ParseBootstrapOptionsAction at: 2008/4/30 11:20:48
Loaded DLL:c:487084033731d74b14xmlrw.dll Version:2.0.3609.0
Complete: ParseBootstrapOptionsAction at: 2008/4/30 11:20:48, returned false
Error: Action "ParseBootstrapOptionsAction" failed during execution. Error information reported during run:
Could not parse command line due to datastore exception.
Source File Name: utillibpersisthelpers.cpp
Compiler Timestamp: Wed Jun 14 16:30:14 2006
Function Name: writeEncryptedString
Source Line Number: 124
----------------------------------------------------------
writeEncryptedString() failed
Source File Name: utillibpersisthelpers.cpp
Compiler Timestamp: Wed Jun 14 16:30:14 2006
Function Name: writeEncryptedString
Source Line Number: 123
----------------------------------------------------------
Error Code: 0x80070002 (2)
Windows Error Text: The system cannot find the file specified.

Source File Name: cryptohelpercryptsameusersamemachine.cpp
Compiler Timestamp: Wed Jun 14 16:28:04 2006
Function Name: sqls::CryptSameUserSameMachine:rotectData
Source Line Number: 50

2
Could not skip Component update due to datastore exception.
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:27:59 2006
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "InstallMediaPath" {"SetupBootstrapOptionsScope", "", "564"} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupBootstrapOptionsScope"
Running: ValidateWinNTAction at: 2008/4/30 11:20:48
Complete: ValidateWinNTAction at: 2008/4/30 11:20:48, returned true
Running: ValidateMinOSAction at: 2008/4/30 11:20:48
Complete: ValidateMinOSAction at: 2008/4/30 11:20:48, returned true
Running: PerformSCCAction at: 2008/4/30 11:20:48
Complete: PerformSCCAction at: 2008/4/30 11:20:48, returned true
Running: ActivateLoggingAction at: 2008/4/30 11:20:48
Error: Action "ActivateLoggingAction" threw an exception during execution. Error information reported during run:
Datastore exception while trying to write logging properties.
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:27:59 2006
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "primaryLogFiles" {"SetupStateScope", "", ""} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupStateScope.primaryLogFiles
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupStateScope"
00E4CFC0Unable to proceed with setup, there was a command line parsing error. : 2
Error Code: 0x80070002 (2)
Windows Error Text: The system cannot find the file specified.

Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44

Class not registered.
Failed to create CAB file due to datastore exception
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:27:59 2006
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "HostSetup" {"SetupBootstrapOptionsScope", "", "564"} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupBootstrapOptionsScope.HostSetup
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupBootstrapOptionsScope"
Message pump returning: 2

[/code]

View 1 Replies View Related

Does SQL 2005 Purchase Come With Access To SQL 2000 Media?

Mar 13, 2007

My company is planning to purchase a SQL2005 standard Processor license (unlimited users - about $5000)

Does anyone know if we can obtain SQL2000 media along with the purchase. Because of the app we are running and its stage of development, we have to install and run SQL2000 for about 6 months before we can run Sql2005. We dont want to purchase SQL2000 for such a short term use.

I asked a DELL rep to help me with this over a month ago and he still has no answers for me.

Any help with this would be greatly appreciated.

View 3 Replies View Related

Backup Error - Not Part Of A Multiple Family Media Set

Nov 12, 2006

I am new to SQL 2005. I have setup and new maintanaince plan of making backup on to different paths but i encountered an error saying
Executing the query "BACKUP DATABASE [promis_05] TO DISK = N'E:\ERP Database\ERP Backup\Promis_05', DISK = N'\\backupsrv\ERP Backup\Promis_05' WITH NOFORMAT, INIT, NAME = N'promis_05_backup_20061111181236', SKIP, REWIND, NOUNLOAD, STATS = 10
" failed with the following error: "The volume on device 'E:\ERP Database\ERP Backup\Promis_05' is not part of a multiple family media set. BACKUP WITH FORMAT can be used to form a new media set.
BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

We did not know what to make of this.
1) Is it bcoz i am backing up the database on 2 locations same time.

2) What is BACKUP WITH FORMAT?

3) Why won't it let me add a new file that is not part of the 'family' ?

4) How does it get to be part of the family?
Thought and ideas are highly appreciated!

View 3 Replies View Related

Backup Restore - System Hangs When Changing Media (DVD)

Mar 15, 2008



My Vista system hangs immediately after I insert the second blank DVD. I'm doing a simple backup of my user files. I'm using Vista Premium, fully up to date with patches, minimal software installed because this system is 100% used as a Media Center. Hardware is off the shelf HP Media Center m8067n.

I checked Microsoft knowledgebase and no other similar cases popped up. Is anyone else experiencing this?

View 1 Replies View Related

SQL Server 2005 Standard Edition - Installation Media

Mar 30, 2007

Hiya,

We were recently let down by our software supplier who have happily provided us with a single processor license for SQL Server 2005 before the weekend.. but haven't been able to provide any installation media.

I notice on the website that there is a trial edition of the Enterprise edition for download, that can be converted into a full installation by using a valid license key.

My question is.. would I be able to use that trial edition with my license key? Or are they fundamentally different?

If that isn't an option.. is there anywhere where I can obtain installation files for standard edition?


Thanks in advance,

--
Tim

View 1 Replies View Related

SQL2005 Restore Database From Media Tape Terminate Abnormally!

Apr 11, 2007

I backup the database into tape0 using management studio and can see the contents in the backup media.

However when I tried to restore, the error "timeout expired" appears and sometimes together with the error "restore headeronly is terminated abnormally".



Please advice and thank you in advance!



Below is the error message:

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
Program Location:

at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteWithResults(String sqlCommand)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteWithResults(String query)
at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSqlWithResults(Server server, String cmd)
at Microsoft.SqlServer.Management.Smo.Restore.ReadBackupHeader(Server srv)
at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseGeneral.buttonSelectDevice_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

===================================

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-2&LinkId=20476

------------------------------
Server Name: NTSRV1
Error Number: -2
Severity: 11
State: 0


------------------------------
Program Location:

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected)
at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
at System.Data.SqlClient.TdsParserStateObject.ReadByte()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteWithResults(String sqlCommand)

View 3 Replies View Related

Setup And Upgrade :: Extract Only Client Installation Folder From Complete Media

Sep 8, 2015

Is there a way to extract only installation files to install SQL 2012 client tools from complete media set. I'm interested in SQL MGMT Studio/Profiler/Data Quality services/Configuration tools.

View 2 Replies View Related

Setup And Upgrade :: Adding Database Instance To Existing Installation - No Media

Sep 2, 2015

I have an existing, licensed installation of SQL 2008 R2, with one database instance.  I need to add a second instance, but do not currently have access to the installation media.  Can I use the Microsoft® SQL Server® 2008 Enterprise

Evaluation: Trial Experience for IT Professionals installer that's available for download from the Microsoft download site?

View 3 Replies View Related

SQL Server 2005 Trying To Restore Get Error Media Family Incorrectly Formed

Jul 30, 2007

I am trying to restore a 2005 backup to a 2005 database on another server. This has worked for me before. I have tried to take the backup 5 times now and each time I get the error media family incorrectly formed. Since I have successfully backed up and restored before between these same two databases I do not understand what is wrong now.

I found other questions with this error; however, they were taking a 2000 backup to a 2005 database. I am using a backup of a 2005 database to a 2005 restore.

How should I begin to debug this problem?

Thanks

View 3 Replies View Related

Install Developer Edition On Windows XP Media Center Edition?

May 13, 2007



Can I install SQL Server 2005 Developer Edition on XP Media Center Edition?



Thanks.

View 3 Replies View Related

How To Remove Partially Duplicate Rows From Select Query's Result Set (DB Schema Provided And Query Provided).

Jan 28, 2008

Hi, 
Please help me with an SQL Query that fetches all the records from the three tables but a unique record for each forum and topicid with the maximum lastpostdate. I have to bind the result to a GridView.Please provide separate solutions for SqlServer2000/2005. 
I have three tables namely – Forums,Topics and Threads  in SQL Server2000 (scripts for table creation and insertion of test data given at the end). Now, I have formulated a query as below :- 
SELECT ALL f.forumid,t.topicid,t.name,th.author,th.lastpostdate,(select count(threadid) from threads where topicid=t.topicid) as NoOfThreads
FROM
Forums f FULL JOIN Topics t ON f.forumid=t.forumid
FULL JOIN Threads th ON t.topicid=th.topicid
GROUP BY t.topicid,f.forumid,t.name,th.author,th.lastpostdate
ORDER BY t.topicid ASC,th.lastpostdate DESC 
Whose result set is as below:- 




forumid
topicid
name
author
lastpostdate
NoOfThreads

1
1
Java Overall
x@y.com
2008-01-27 14:48:53.000
2

1
1
Java Overall
a@b.com
2008-01-27 14:44:29.000
2

1
2
JSP
NULL
NULL
0

1
3
EJB
NULL
NULL
0

1
4
Swings
p@q.com
2008-01-27 15:12:51.000
1

1
5
AWT
NULL
NULL
0

1
6
Web Services
NULL
NULL
0

1
7
JMS
NULL
NULL
0

1
8
XML,HTML
NULL
NULL
0

1
9
Javascript
NULL
NULL
0

2
10
Oracle
NULL
NULL
0

2
11
Sql Server
NULL
NULL
0

2
12
MySQL
NULL
NULL
0

3
13
CSS
NULL
NULL
0

3
14
FLASH/DHTLML
NULL
NULL
0

4
15
Best Practices
NULL
NULL
0

4
16
Longue
NULL
NULL
0

5
17
General
NULL
NULL
0  
On modifying the query to:- 
SELECT ALL f.forumid,t.topicid,t.name,th.author,th.lastpostdate,(select count(threadid) from threads where topicid=t.topicid) as NoOfThreads
FROM
Forums f FULL JOIN Topics t ON f.forumid=t.forumid
FULL JOIN Threads th ON t.topicid=th.topicid
GROUP BY t.topicid,f.forumid,t.name,th.author,th.lastpostdate
HAVING th.lastpostdate=(select max(lastpostdate)from threads where topicid=t.topicid)
ORDER BY t.topicid ASC,th.lastpostdate DESC 
I get the result set as below:- 




forumid
topicid
name
author
lastpostdate
NoOfThreads

1
1
Java Overall
x@y.com
2008-01-27 14:48:53.000
2

1
4
Swings
p@q.com
2008-01-27 15:12:51.000

I want the result set as follows:- 




forumid
topicid
name
author
lastpostdate
NoOfThreads

1
1
Java Overall
x@y.com
2008-01-27 14:48:53.000
2

1
2
JSP
NULL
NULL
0

1
3
EJB
NULL
NULL
0

1
4
Swings
p@q.com
2008-01-27 15:12:51.000
1

1
5
AWT
NULL
NULL
0

1
6
Web Services
NULL
NULL
0

1
7
JMS
NULL
NULL
0

1
8
XML,HTML
NULL
NULL
0

1
9
Javascript
NULL
NULL
0

2
10
Oracle
NULL
NULL
0

2
11
Sql Server
NULL
NULL
0

2
12
MySQL
NULL
NULL
0

3
13
CSS
NULL
NULL
0

3
14
FLASH/DHTLML
NULL
NULL
0

4
15
Best Practices
NULL
NULL
0

4
16
Longue
NULL
NULL
0

5
17
General
NULL
NULL
0  I want all the rows from the Forums,Topics and Threads table and the row with the maximum date (the last post date of the thread) as shown above. 
The scripts for creating the tables and inserting test data is as follows in an already created database:- 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK__Topics__forumid__79A81403]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Topics] DROP CONSTRAINT FK__Topics__forumid__79A81403
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK__Threads__topicid__7C8480AE]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Threads] DROP CONSTRAINT FK__Threads__topicid__7C8480AE
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Forums]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Forums]
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Threads]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Threads]
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Topics]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Topics]
GO 
CREATE TABLE [dbo].[Forums] (
            [forumid] [int] IDENTITY (1, 1) NOT NULL ,
            [name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            [description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO 
CREATE TABLE [dbo].[Threads] (
            [threadid] [int] IDENTITY (1, 1) NOT NULL ,
            [topicid] [int] NOT NULL ,
            [subject] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            [replies] [int] NOT NULL ,
            [author] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            [lastpostdate] [datetime] NULL
) ON [PRIMARY]
GO 
CREATE TABLE [dbo].[Topics] (
            [topicid] [int] IDENTITY (1, 1) NOT NULL ,
            [forumid] [int] NULL ,
            [name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            [description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO 
ALTER TABLE [dbo].[Forums] ADD
             PRIMARY KEY  CLUSTERED
            (
                        [forumid]
            )  ON [PRIMARY]
GO 
ALTER TABLE [dbo].[Threads] ADD
             PRIMARY KEY  CLUSTERED
            (
                        [threadid]
            )  ON [PRIMARY]
GO 
ALTER TABLE [dbo].[Topics] ADD
             PRIMARY KEY  CLUSTERED
            (
                        [topicid]
            )  ON [PRIMARY]
GO  
ALTER TABLE [dbo].[Threads] ADD
             FOREIGN KEY
            (
                        [topicid]
            ) REFERENCES [dbo].[Topics] (
                        [topicid]
            )
GO 
ALTER TABLE [dbo].[Topics] ADD
             FOREIGN KEY
            (
                        [forumid]
            ) REFERENCES [dbo].[Forums] (
                        [forumid]
            )
GO  
------------------------------------------------------ 
insert into forums(name,description) values('Developers','Developers Forum');
insert into forums(name,description) values('Database','Database Forum');
insert into forums(name,description) values('Desginers','Designers Forum');
insert into forums(name,description) values('Architects','Architects Forum');
insert into forums(name,description) values('General','General Forum'); 
insert into topics(forumid,name,description) values(1,'Java Overall','Topic Java Overall');
insert into topics(forumid,name,description) values(1,'JSP','Topic JSP');
insert into topics(forumid,name,description) values(1,'EJB','Topic Enterprise Java Beans');
insert into topics(forumid,name,description) values(1,'Swings','Topic Swings');
insert into topics(forumid,name,description) values(1,'AWT','Topic AWT');
insert into topics(forumid,name,description) values(1,'Web Services','Topic Web Services');
insert into topics(forumid,name,description) values(1,'JMS','Topic JMS');
insert into topics(forumid,name,description) values(1,'XML,HTML','XML/HTML');
insert into topics(forumid,name,description) values(1,'Javascript','Javascript');
insert into topics(forumid,name,description) values(2,'Oracle','Topic Oracle');
insert into topics(forumid,name,description) values(2,'Sql Server','Sql Server');
insert into topics(forumid,name,description) values(2,'MySQL','Topic MySQL');
insert into topics(forumid,name,description) values(3,'CSS','Topic CSS');
insert into topics(forumid,name,description) values(3,'FLASH/DHTLML','Topic FLASH/DHTLML');
insert into topics(forumid,name,description) values(4,'Best Practices','Best Practices');
insert into topics(forumid,name,description) values(4,'Longue','Longue');
insert into topics(forumid,name,description) values(5,'General','General Discussion'); 
insert into threads(topicid,subject,replies,author,lastpostdate) values (1,'About Java Tutorial',2,'a@b.com','1/27/2008 02:44:29 PM');
insert into threads(topicid,subject,replies,author,lastpostdate) values (1,'Java Basics',0,'x@y.com','1/27/2008 02:48:53 PM');
insert into threads(topicid,subject,replies,author,lastpostdate) values (4,'Swings',0,'p@q.com','1/27/2008 03:12:51 PM');
 

View 7 Replies View Related

Decrypting Provided Data

May 2, 2007

I have following problem. I would like to provide to my STP encrypted data and decrypt them inside it. To decrypt the data I'd like to use DecryptByKey. Encryption should be made on the Win32/.NET client.



Unfortunately I cannot find the way to make the data understable between the both worlds. First how to assign the same key on the both side? Do I get the same key from




Code Snippet

create symmetric key MyKey with

algorithm=triple_des,

key_source='abrakadabra'

encryption by password='aaa'



and from




Code Snippet

string Key = "abrakadabra";

byte[] bKey = Encoding.ASCII.GetBytes(Key);

byte[] salt = new byte[8];



RNGCryptoServiceProvider rnd = new RNGCryptoServiceProvider();

rnd.GetBytes(salt);

PasswordDeriveBytes pdb = new PasswordDeriveBytes(bKey, salt);



TripleDESCryptoServiceProvider prov = new TripleDESCryptoServiceProvider();

prov.GenerateIV();

prov.Key = pdb.CryptDeriveKey("TripleDES", "SHA1", 168, prov.IV);

???

I have read somewhere that create symmetric key calls CryptDeriveKey, but I'm not sure.



The next point is the format of the output data. I have noted, that the output from EncryptByKey is 16 bytes longer (after stripping key guid and fixed 0x01000000) than the one from Win32/.NET application. I assume, that it can lie in the inserting of IV as the first block, but should not IV be only 64 bit long in the DES family of algorithms?



Neverthless I have not magaged to perform encrypted communication such way between SQL Server 2005 and client application. Is it possible at all?







View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved