How can I put an IF EXISTS for both my creation of the constraint and Drop below to safegard from any errors?
ALTER TABLE PurchaseDownload
DROP CONSTRAINT [FK_PurchaseDownload_ProductFile]...
Hi guys
Has anyone found a method in sqlserver 2000 to 'aggregate' strings in a Group By query. Like using 'Sum' for numerics...
e.g. table values:
cGroup cText
A L
A ...
Hi,
I've wrote a search module for SQL Server 2000 a while back and it produces queries like:-
SELECT tblSection.SectionShortDesc as SectionShortDesc, tblPage.PageID, tblPage.PageName, t...
I have a field that I would like to only display the date as mm/dd/yyyy. Current field shows mm/dd/yyyy hh:mm:ss AM.
I would most likely create a view that will create a field that will di...
Hi Guys,
I have a serious problem regarding my MSSQL2000 Server during the installation. I actually installed it before, but after removing it, when I tried to do the installation again a s...
We have a few servers running ms sql 2000 and one server that runs ms sql 2005
I have created multiple linked servers from one ms sql2000 server to another and they have worked fine
I am...
In an sp i'm writing, I need to convert an integer value to a string. I usually do this with the cast() function. But this time, I need to left pad the string with zeros. So how do I do this?
...
I have created a database which shows the administrator as the dbo owner. I have created a user which I want to be the dbo owner. How can I delete the default dbo owner and create my own
Hello,
I need to be able to update the SQL command default timeout of 30 to something greater. I KNOW this can be done super easy through code, however, I do not have that luxury and need ...
Hello
I keep recieving the following message in Event Viewer:
"The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs." Event ID 17896
It is an informatio...
Can't quite get my head around this Run-Once script, at the moment, appreciate any quick help, so I can get on with my favourite job, reviewing all the uploaded images, for approval. - LOL
ht...
We are developing an Intranet for our organization and are using SQL 7.0 as the database for it. We have a content table with a field to hold the text for the various html pages. Can somebod...
Hi all, i keep getting this error message when I try to add a new item into my database
Cannot insert explicit value for identity column in table 'MenuItem' when IDENTITY_INSERT is set to O...
I found this script to check if a column exist in a table and to create the col if not exisiting:
IF NOT EXISTS (SELECT TABLE_NAME,COLUMN_NAME
FROM master.dbo.INFO...
This morning system performance was degrading as the number of the system processes was exploding. Normally I have about 20 processes running on a database (master..sysprocesses), but in one h...
Hello,
Could someone tell me how what the syntax is to convert a Julian date to a regular date format in SQL? Thanks.
d-
Curious how to accomplish/correct syntax for the following in T-SQL...
Database Name: TestDB
Existing table name: MyTable
Existing Column Names: ID, NameFirst, NameLast, MyDate
Want to...
Hi again,
I need to create a function that returns a boolean value, to be used in a CASE expression.
I have tried with 'RETURNS BIT' but it is not considered as boolean an SQL fails in the c...
Just a quick question. I need a way to strip part of a field out, the amount I need to strip out is variable but it always the last part of the string/field. I need to do this purely within SQ...
my user data log is reaching 11GB. I need to shrink the log file. Because of lack of hard drive space, I added a new hard drive and move both user_data.mdf and user_log.ldf file from C drive ...
Hi,
I have a situation where I'm transferring data between two MS SQL 2005 servers and one of the tasks is to retrieve data from one SQL server [S1] (it is also a Linked Server) and export it...
I have the following procedure and i like to declare a copy of local variables
@Operation and @Operation_Access that i can use in the processing.
It is not allowing me to set up these....c...
I have a database in SQL Server 2000 where the MDF file is 61MB and the LDF file is is 5.3GB. I am not sure why the LDF file size is so huge! How can I shrink the LDF file? Will shrinking t...
Hello - my computer has crashed so I had to re-install the complete system incl sql server 2005 and tried to restore a mdf database file from a backup. Unfortunately, this is only a copied mdf...
Hi All,
I have an old MSSQL 2000 installation from a previous admin setup here and no one has the SA password. Does anyone know of any utilities to extract/find the SA password, or am I SOL?