473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Assertion Problem in SQL server 2005

I have a problem with assertions as I found that there's no create assertion in Sql Server 2005 so I'd like to have help in converting that SQL code to SQL Server code that achieve the same thing, I guess it'll be with stored procedure or something like it but I don't know how!!!!!!

CREATE ASSERTION NoEmptyShelves
CHECK (NOT EXISTS (
SELECT * FROM Shelves S
WHERE NOT EXISTS (
SELECT * FROM Display D
WHERE S.sId = D.sId )))
Nov 7 '07 #1
1 2287
iburyak
1,017 Expert 512MB
You might want to create some constraints on your tables to perform the same actions.
You might want to create:
PRIMARY KEY Constraints
FOREIGN KEY Constraints

http://msdn2.microsoft.com/en-us/library/ms174979.aspx


In some cases you might want to use trigger instead:
http://msdn2.microsoft.com/en-us/library/ms189799.aspx

Good Luck.
Nov 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Morgan Leppink | last post by:
Hey all - We are running SQL 2000 with ALL available service packs, etc. applied. We just built a brand new database server, which has dual 2Ghz XEONs, 2GB memory, and the following disk...
3
by: crispin.proctor | last post by:
Hi All, I have started getting Assertion Errors in SQL. It appears when I process a cube (Most of the time) Other SQL statements, usually with a join or 6 do the same thing. Whaving a scratch...
4
by: Etayki | last post by:
Hi, I am getting an assertion failure when declaring a CInternetSession object: CInternetSession mySession; // a session object I am still able to run the program, but I receive that...
2
by: Craig Klementowski | last post by:
Pardon the cross post, but I'm not sure where exactly to post this question. We have MFC application using many MFC extention DLL's. We started using a new MFC extention DLL that is mixed mode so...
1
by: lauch2 | last post by:
Try to compiler and run the following code in DEBUG mode, an assertion dialog will be popped. Can I ignore this assertion dialog and why does this code cause to an assertion? -- int _tmain(int...
3
by: bonk | last post by:
I have created an MFC project that links MFC MFC as shared dll and uses /MD . This MFC application loads another dll B via Loadlibrary that has /MD too and also links MFC as shared dll. Dll B again...
0
by: Tooshy | last post by:
Hello everyone. I have a problem with assertions as I found that there's no create assertion in Sql Server 2005 so I'd like to have help in converting that SQL code to SQL Server code that achieve...
27
by: Jason Doucette | last post by:
I'm getting an assertion fire from a list iterator being checked against NULL. This did not occur in VC++ 2003 (v7.1). Are there changes that have been made to the STL between these versions that...
1
by: gbharanipriya | last post by:
I have a problem with assertions as I found that there's no create assertion in Sql Server 2005 so I'd like to have help in converting that SQL code to SQL Server code that achieve the same thing, I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.