Well, I usually just go through the GUI, and right-click, Delete Database.
But maybe SQL "DROP databasename" works without complaining about foreign keys? I'll have to try that next time, or maybe the sp mentioned earlier in this thread.
Is there a way to just delete a SQL Server database, without it complaining about foreign keys and such? Is there a command to just ignore any issues and just drop the database anyway?
I'm always running into this when I'm developing.
I want to store items in a database. The columns for each item will be things like author, title, description.
I also want to somehow associate keywords with each item. These will be used for a search feature on a website, to locate items that have certain keywords. Each item can have one or...
Thanks for the info.
I guess db size could be an factor? 1000 PDFs at 1MB apiece, would be 1GB extra space to back up every day.
Or would SQL Server compress the PDF's size?
For a website, what are the pros and cons of putting PDFs in a SQL Server database, versus just storing them in a web server directory?
So far I've only ever put text in a database, but I understand you can also put PDFs, images, etc in there.
I need to store about 1000 PDFs for use in my web...
I need to create a table something like this:
Patient table
----------
ID
Name
Categories
The thing is, for each of these records there can be multiple Categories. Something like this:
ID: 321
Name: Bob
Categories: Flu, Diabetes, Cancer
How can I do this? I need a separate Categories table...
How can I script out the contents of a table - all the data in all the rows?
I'm looking for results similar to what the Database Publishing Wizard produces, but I only need to copy one table not the whole database.
I want to recreate a table on a second database. I want to automatically...
I just got assigned to a new website that uses some COM for backend processing.
When I run the code locally on my PC, I get the following error when the code hits the point to instantiate one of the COM objects: “Retrieving the COM class factory for component with CLSID...
OK, I fixed the misspelling of decimal, but it still doesn't work:
SELECT CONVERT(decimal(25,15), CONVERT(text), gam.attribute_detail_text) < @NorthLatLine
I haven't gotten it working yet. Here's my actual line (in a WHERE clause):
SELECT CONVERT(decimail(25,15), CONVERT(text), gam.attribute_detail_text) < @NorthLatLine
do you see anything wrong?
How do I convert a "text" type value to a "numeric" type, in T-SQL?
I tried the following but it throws an error:
SELECT CAST(my_text as numeric)
Note: The text values are in proper number format, so I don't need to worry about that too much. I just need to convert them to numerics so I can...
I have the following query:
Select *
FROM Unit u
inner join Event ev on
ev.UnitId = u.UnitId
But what I really want is something that does the opposite - returns all the records where no ev.UnitId exists for a given u.UnitId. How do I do that?
I want a better understanding of what I'm doing when I write SELECTs/DML and how I should design my queries. The books I have read say "this is how you do a join" but they don't really explain the theory or concepts behind what you are doing.
I want to understand the theory a little to help me...
Can you recommend a good book or article that will give me a conceptual understanding of what I'm doing when I write SQL joins, etc? Something written at a beginner level would help me the most.
I'm a junior developer and I'd like to understand more of the overall concepts or theory behind what...
Sorry, I forgot to include NoteSeqNum in the criteria for delete.
So the partial SQL should say:
DELETE FROM NoteTable
WHERE
[...a matching NoteId, NoteSeqNum, and NoteTypeID are found in @NoteTempTable]
DELETE FROM @NoteTempTable
WHERE
[...the same...
I have a table named NoteTable. I also have a second temporary table that contains some of the identical data as NoteTable.
I want to delete all rows from NoteTable where the same items exist in the temp table, and also delete those same items from the temp table.
Example:
NoteTable...
The following query...
SELECT ItemId, NoteSeqNum
FROM NotesTable
WHERE ItemId = 6434
AND NoteTypeId = 1
..returns these results:
ItemId NoteSeqNum
6434 11
6434 12
6434 13
I need SQL to return only those items with less than the max NoteSeqNum. So this would be my desired result:
ItemId...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.