I know this is a newbie question, but can anyone tell me how to reset the auto increment field of my table to 1 or it's original value.
I've been using these tables for testing and the auto...
I need an SQL (SQL Server 2005) script that can drop one or more columns in a table if they exist. Below is the script I have in place that is not working.
if exists ( select * from INFORM...
Dear Experts,
I'm trying to create a stored procedure to update a datetime field from 2 input parameters. (The reason it's like this is that I want to enter the start date/time simular to s...
I realise this question has no doubt been asked and answered many times, however I'm asking it anyway.
I need to convert a varbinary data type to Varchar so the results are viewable to cert...
Hi All,
I have a database which has every table prefixed with 'tbl_' and I would like to remove this. The problem is that there are stored procedures and triggers linked to these tables. ...
I have 1 datagridview read data from database with 3 columns like this:
Id Name DOB
1 A 02/12/2009
2 B 03/12/2009
3 C 04/12/...
Will running a defragging tool on a SQL Server adversly affect the data on it?/What is the proper way of defragging a sql Server?
dear experts,
i created a job schedule using Database Maintenance Plan. now i want to change the schedule but encountered this error message:
Microsoft SQL-DMO (ODBC SQL State : 42000)
...
If I run this query on my database:
DELETE from products
WHERE id='30'
I get this error:
Delete statement conflicted with COLUMN REFERENCE constraint 'FK_product_g_prudu_OF582957'. The ...
how do i do "OR" inside the case statement?
please look at the below sql query:
SELECT
id,stat,
(CASE (flag_cd)
WHEN '1' THEN 'asdf'
WHEN '2' THEN '23423' END) AS mystatus,
(C...
New to SQL Server 2005. I'm wanting to batch upload data from a remote system (VMS) into a SQL Server 2005 database. I've scripted out into files, the commands I need to create the table(s),...
=IIf(Fields!New_Old_CC.Value = 1, SUM(Fields!PDC.Value),0)
How can I check to make sure New_Old_CC is not null or maybe better yet IsNumber or both before evaluating if it is 1 or 0? I kno...
I am trying to create a SQL Server database. In one database I have a table named "book" with columns ISBN, Title, Author, Condition and Book_ID. Book ID should basically be a composite of ISB...
OK,
DECLARE @ident int
DECLARE @docpart varchar(60)
set @ident = @@Identity
set @docpart = @Ident+'_'+@DocName
print @docpart
I'm trying to create a string, set to docpart for u...
Hi,
I know Oracle uses a MOD function like Basic's to determine the remainder after a division. So 20 MOD 9 = 2 (9 goes into 20 twice for a total of 18, 20 - 18 = 2). I need to deter...
I'm just curious if someone can give me some info about sp_execute and what it's used for.
Select OrderID,
'Sell--' + Convert(varchar(24), sum(CAST(Price AS DECIMAL(13,2))) )
From OrderDetail
GroupBy OrderID
I want to display price as varchar but somehow above code send an f...
Can somebody help me with this error :
//===STORED PROCEDURE CODE START
CREATE PROCEDURE web_ApplyCallCharges_Intl
@Month_Table varchar(50),
@Call_Zone varchar(5),
@Call_Type varchar(...
I am looping through a list of tables in a cursor, and for each table name I fetch, I need to check whether a particular column exists and do something if it does NOT... here is the basic synt...
I have a file located at c:\mydb.7.7.2006.bak. I need to restore it to a location on my local computer running win xp with sql express.
Here is what I have done:
restore filelistonly
...
hi, how do i convert a varchar hhmm into a datetime 1:30:00 PM if my hhmm = 1330?
thanks
I am trying to install MS SQL 2005 Server on Vista Home Premium-32 Bit. It keeps giving this error.
Microsoft SQL Server Native Client -- Error 1706. An installation package for the product...
I have two Columns that I need to take the Max value of and limit on the higher of the two.
I was trying to do this:
SELECT MAX (COLUMN1, COLUMN2) AS EXPR1
FROM TABLE
WHERE EXPR1 > 100
...
I have a SQL server Database that shows "<Database name>(Loading)...but I cannot be able to stop it. I tried to detach it but I got a message cannot be able to detach a Database that is in a r...
I have been working on a local copy of a db (localDB) and have made a lot of changes to some tables and added some as well. The live db (liveDB) is on a shared host and is still active. So the...