guys i have a programming question i have table called prerequsiteswhich is like thisprerequisite component componenta bso inside my before insert trigger i have to check if the prerequisite is a valid entry like for instance an entry like b is a prerequisite component for component a which is not a valid entry since i already have an entry in the prerequisite table which defines that comonent a is a prerequisite of b. however this is very basic so i can test it easy some thing like this in my before insert prerequisite component componenta bb a ( Not a valid entry)select count(*) from prerequisite where component = value of prerequisite component and prerequisite component = value of component the above select statement will actually tell me if entry is allowed for insert and does not override other prerequsitesbut it can get very complex depending on how the user chooses so if someone can tell me a nice algorithm or good logic to approach this problem it would be great like for instanceprerequisite component componenta bb cc a ( Not a valid entry. so how do i ensure that this entry is not allowed considering that complexity for prerequsites can increase quite greatly)please can someone tell me how to approach this problem.
DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.CREATE PROCEDURE [dbo].[spu_Import_Export_Image](@srvr varchar(50),@db varchar(50),@usr varchar(15),@pwd varchar(50),@tbl varchar(50),@col varchar(50),@mod varchar(1),@imgpath1 varchar(1000),@pk varchar(50))ASBEGINdeclare @path varchar(50)declare @whr varchar(200)declare @fil varchar(100)declare @cmd varchar(1000)declare @imgpath varchar(800)declare @ext varchar(5)--declare @pk varchar(50)declare @KeyValue varchar(8000)declare @image varchar(50)--declare @imgpath1 varchar(1000)declare @imgpath2 varchar(1000)declare @sellist varchar(2000)set @path = 'c: extCopy.exe'select @sellist = 'DECLARE curKey CURSOR FOR SELECT ' + @pk +' FROM '+ @tbl + ' ORDER BY ' + @pkexec (@sellist)OPEN curKeyFETCH NEXT FROM curKey INTO @KeyValueWHILE (@@fetch_status = 0)BEGINset @whr = '"where '+ @pk +' = "' + @KeyValueset @fil = @imgpath1 + '' + @KeyValue --+ @extset @cmd = @path + ' /S ' + @srvr + ' /D ' + @db + ' /U ' + @usr+ ' /P ' + @pwd+ ' /T ' + @tbl + ' /C ' + @col + ' /W ' + @whr + '/F ' + @fil+ ' /' + @modexec Master..xp_cmdShell @cmdFETCH NEXT FROM curKey INTO @KeyValueENDCLOSE curKeyDEALLOCATE curKeyENDGOAbove srcipt runs fine with image data type in one table but when irun for some other table it gives me Error MessageTEXTCOPY Version 1.0DB-Library version 8.00.194SQL Server 'WSQL01' Message 170: Line 1: Incorrect syntax near '99'.(Concerning line 1)DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.ERROR: Could not use database 'test1'NULL-----------Aslo it only runs on server console if i run it from workstation uingsame files and tables it gives me an error again. Can anybody help meand reply me at Join Bytes! asap.thnx,dharmesh
Okay, I have my idea of how to do this, but would like to get experience's idea of how to do this since I am a mere 3.5 weeks into using SQL.I am working on a time off tracker for my company. We have an employee table (employee), a request table(request). Originally I was told that all vacation is a lump of days and they take time off and it is subtracted from their vacation time. Now, I am getting told they can take off vacation, pto, bereavement and possibly more. I have a time off table now (time_off) that I made just so I could add time off types for tracking what time of time off the employee took based on having one pool of time off. I was thinking I needed to add another table (tracking) that shows the employee id as a foriegn key to the employee table then have the table show time off type, accrual rate (cause some accrue at 2 weeks per year and others at 3 days per year) and a column for increments cause some they can take in increments of 15 minutes and others half days. My thought was when I create a new employee, I have put in what types of time off they are allowed, what the accrual rates for those are. When they take a day off, put it in the request field and then when they want to view their available time off, say for the employee, how many vacation days have they accrued from the tracking database, minus the days they have taken off, leaves the number of days they have available. I would LOVE and APPRECIATE your input, cause I don't want to go down this path only to find out I could have / should have done it differently. One of the things I haven't really figured out is if they add a new time off type, how to add it for all the employees and make sure it is accounted for.
hi, I have a access database. In this database there are 10 tables and this tables are related to each other. I want to move these tables to another database according to a field in XYZ table (vertical fragmentation).
for example there is name coloumn in the XYZ table and I want to take only joe lines and other tables related to that from database A and move it to database B
I was wondering how I could restore a bkp file into a database with a different name. For example, I made a backup of T1.mdf and i want to restore t1.bkp to T2.mdf.
Is there a way to change the database ID for the databases without deleting them and restoring them again. I have a source server on which the database order is not same in the target server for trace replays. I don't want to restore the master from source to the target.
I have 3 databases in order A ---Db_id 1 B----DB_id 2 C----DB_id 3
i want to change the Db_id of C to 1 instead of 3.
hi all, i am working on portal site where i have created 18 tables in on database, i dont know weather i am right or wrong . Should i continue with the same or create two tables one will be master and another will contain common fields. but if i will create one table for all then what will happend. please tell me what to do and why? asap please............ Thanks for spending ur valuable time for me.
Hello all Can any one help me in updateing the dataBase with the updated datset through the DataGrid i am able to get the updated dataset from the data Grid but i dont know how to update the database with that kindly help
How do I eliminate others from viewing one of the 2 databases on our production server???Is there any security not to allow all users to including sa and developers not to access one of the 2 databases on our server.. The other of the 2 databases can be accessed.... Please advise
I have designed a database on a Windows NT machine and wanted to copy it to my Windows 98 PC... However a simple transfer of MDF and LDF files doesn't accompliesh this task. It would be nice if someone can help me figure out a way of transferning a whole databse without a network connection.
I restored a database from one full backup.The users are missing now in the new databse.When I try to create the same users again it says that they are already existing!Please help what shall I do to restore/recreate the users?Do I need to do anything with the Master?
I am facing a very weird problem. SQL Server database had gone corrupt and i restored the mdf and ldf files. After this i am able to see the table names thru sp_help command and also in SQL Enterprise mgr. But when i do a SELECT from the table it says the object doesn't exist. And if i link the sql table in MS-Access and then view it in access, it shows me the records !. Can someone pls tell me what could be the problem in SQL server and how to solve that.
Hi, One of my most used databases has been marked by the Server as SUSPECT. No, i was not trying to recover the Db. The story goes like this.. We are using MTS for a VB, SQL distributed application. One of the MTS transactions was blocking a lot of my other transactions. I tried to kill that transaction to avail nothing. I stopped the SQL Server and restarted it again ( as suggested in BOL, coz the transaction was open and was awaiting command, so server restart was the only way-BOL ) When the server came back up, and i tried to restore the db, it said that the database has been marked suspect. When i tried dbcc dbrecover, it said, could not recover because it could not connect to MSDTC to check the completion status of the transaction xxxx. sp_resetstaus did not help as well.
I have a 95GB database (dump file is 73 GB) and I want to restore it on a different server. I have created 95GB devices and tried to restore it, but it failed because of reason " page xxx had non-log objectid xxx while checking in syslogs" . I tried locating the object on that page but it showed page is in cache.
we have a database here and something happened which causes a database block. We tried to run the 'sp_who' 'active' command to see the spid which locked the database, and we found out that some transaction is blocking another transaction. The following is the sample data results from the sp_who 'active'
Hello everybody, I intend to used SQL Express database in my website so that I don't have to go through all the database deployment effort when deplying my website. In this regard, can anyone please tell me what features would it require in my hosting package so that my application works fine (in database context). Would I have to purchase any additional features (like the way we purchase SQL Server database(s) in hosting package) for SQL EXpress in order to deploy my application?? I look forward to you kind replies. Thank you. Zulfiqar Dhuka
Hi, anyone could help me on how to do the inner join of two table from two different database. Below is my scripts: Dim sqlconnection1 As New SqlConnection(ConfigurationSettings.AppSettings("appDSN")) Dim sqlCommand2 As New SqlCommand("", SqlConnection1) Dim sqlconnection2 As New SqlConnection(ConfigurationSettings.AppSettings("smDSN")) Dim sqlCommandSM2 as new sqlCommand("", sqlconnectionSM2) Sub Page_Load(Source as Object, E as EventArgs) sqlCommand2.CommandText = "Select * from invitation inner join Guest on invitation.guestid = Guest.Guestid inner join Department on Department.departmentcode = Guest.deptCode where eventcode = '" & ecode & "'" sqlconnection1.Open() ............................ The invitation table is from SqlConnection1 and the Department table is from the sqlconnection2. How to do this . Pls .. pls help me. Ann123
I need your help and advice on copying databases from SQL Server 6.5 to SQL Server 7.0 and SQL 2000 . How can i do it ? Can it be done through Enterprise manager or is there a script available on any site or if someone can provide me . I want to copy all the objects, indexes and logins with Passwords from SQL 6.5 to SQL 7.0 and SQL 2000 .
Since i am not well versed with database transfer activities , Can somebody help me please !!
I have a question on database size, specifically, what difference would I expect in the size of a db (the space actually used for data, not indexes) if I have one single data device vs. multiple data devices spanned across different physical drives. I have 2 customers that have identical database tables (all columns are integers), customer A has 27 million rows and customer B has 36 million rows. If I do an sp_spaceused on the table, customer A's data takes up 9.7 gig, whereas customer B only takes up 3.2 gig, even though it has 9 million more rows. Statistics have been updated, so I'm confident the sp_spaceused is accurate on both databases.
The only differences I can see between the 2 databases is that customer B has 5 separate data files (6 gig each) for the database which are part of the Primary filegroup. These files are all on the D: drive, which is a partition on a RAID 5 array. Customer A has a single large data file (24 gig), which is also on a RAID 5 array.
How do i find who has changed the settings in the database.
basically when i looked at this morning i saw a database which is set in single user mode.when i tried to look at the errorlog i found nothing except the spid's of different people and as far as i know i think that spid's are assigned randomly depending on there availability.
Now this has happened twice recently and now i want to find out who the culprit is his username, machine name but not spid.
Can i do it if how can i.
how do i track each and every users info what he is doin and at what time.
do i need to set up or configure any options.
sometimes i also see that there is a dbcc command run by as it says winnt/system what does this mean how is this running.
Hi there, I need urgent help regarding a database that has been marked as suspect. I need to get the data from the database!!
I have a copy of the structure of the database but I need to get cerain very recent data from the database. I have tried bcp and it doesn't work. The backup that I have won't sufice
If a database is marked as suspect, Will it recover?> And if so how long will it take. If it won't recover is there any other way of getting the data, Thanks in advance, Fin
Hi Guys, I am trying to restore a master database from a server to another server. I followed all the step necessary to restoring the Master database. I first rebuild the master and then put the master in single user mode and then trying to restore the master database. The problem is the database says master database is restored success fully and also it shut down the service. When I restart the server it startup and then after some minuite it doesnt show started status in the services panel. when I refresh the services it still doesn't say started. I also try to connect to the database and it says the server is not available. I have added service pack 3a to this new server. Don't know why it says that. Any have any idea. I have to do this immediatly and please guys, let me know any solution to this problem. I really appreciate your help. Thanks again. Cheers!
I send you this message to told hwo can i do to convert one database which is in Access97 to SQL Server6.5. I must create a interface in the web which is able to interrogate the database that the reason why i want to do that. Thanks for any help in advance.
Hi All, I have a production issue should be attended immediatly. We are running SQL Server 2000 in a production environment. The master database is corupted. We have a backup of Master database. But the server service is not starting. I don't know how to restore the master database from the backup when server is not up. Can u please letme know how to do it ASAP. I really appreciated for your grate.... help. Thanks in advance. Jamy
I am a newbie to SQL Server Admin. Today when I ran Dbcc newalloc on Model it is showing corruption on syobjects with a 2525 error. I am not sure how to fix this problem? Since this is a critical payroll application server, I need to solve it at the earliest.
If anybody has faced this problem earlier or knows how to solve, please respond to the following address: vsrikanth@ameren.com
Can anybody suggest any stored procedure name or C# code to find the Sql database size (database size as well as transaction log)? I want to migrate some data from my local database to the web server. Before migration, i want to know the database size on the web.
I accidentally restore an old database backup to my current database!! The worst is I don't have any new backup for my current database....:eek:
So ... does anybody here know how to solve this problem?? Can I undo the transaction log?? if it is possible.. could you please teach me the way to undo it?? I'm desperate.....
I'd greatly appreciate if you can answer me....
Thanks in advance... __________________ Best Regards, Debbie
hi to all I got a probelm with attaching the database. I hv Database Name called "ABC". it is working fine. (contain MDF,LDF files)
I got new BackFiles from CLient. They sent MDF and LDF Files. But i could't able to attach the database i got the following error while attaching the databse.
Server: Msg 5173, Level 16, State 2, Line 1 Cannot associate files with different databases.
Seek expert’s advice on database mirroring in high safety mode when safety is full if for some reason communication between principal and mirror is broken for say 2 days then principal will keep working but in disconnected mode. When communication link will establish again then principal can see the mirror server 1. Will establish the mirroring automatically? 2. Then will it synchronise the mirror databases automatically? 3. If it will synchronise databases automatically then principal will process transaction or wait till principal-mirror will be in synchronised state which again depends on number of transaction need to redo on mirror?