all groups > sql server programming > february 2007 > threads for friday february 23
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
why should there be only one clustered index in a table?
Posted by Shocky at 2/23/2007 11:07:26 PM
why should there be only one clustered index in a table?
... more >>
runing sql script through command line
Posted by Afshar Mohebbi at 2/23/2007 10:53:59 PM
Dear SQL Friends,
my question may be asked repeatedly before, but i couldn't find a
straight answer for it.
I simply want to run some scripts that creates tables and stored
procedures through some command line tool so I can run them
automatically.
I am using SQL Server 2005 and SQL Serve... more >>
problem with looping in code-behind / stored procedure
Posted by Francis at 2/23/2007 4:57:16 PM
Hi,
Consider this code-behind and below the stored procedure: everything works
fine, except that the three records have all the same data (the last value:
30). Any idea what to change in the code-behind or in the stored procedure
to fix that?
Thanks a lot
Francis
code-behind:
co... more >>
Table variable Error
Posted by RickSean at 2/23/2007 3:35:15 PM
I get the error "Incorrect syntax near '@MyTbl'." from the following script;
what am I doing wrong?
Declare @MyTbl varchar(50)
Set @MyTbl='MyTable'
create @MyTbl table
(
[Field1] [nvarchar](16) NOT NULL,
[Field2] [nvarchar](35) NOT NULL,
[Field3] [nvarchar](1) NULL,
)... more >>
Table DROP in lieu of TRUNCATE
Posted by Claudia at 2/23/2007 3:23:21 PM
Is there much of a performance difference
between DROP TABLE table and TRUNCATE TABLE?... more >>
Query performance issues !
Posted by ganeshsheshadri NO[at]SPAM yahoo.co.uk at 2/23/2007 3:15:54 PM
We are using 64 bit SQL Server 2005 and one of the queries that was
executing within 3 minutes fails to return once in a while. The
problem is not predictable. The data is increasing every day. It does
not seem to be the volume of the data that is causing the problem. I
say this because if we ob... more >>
pass xmlstring to sql server 2000 stored procedure
Posted by farshad at 2/23/2007 1:46:06 PM
Hi,
Can I use DBType.XML in .net 2.0 to pass xml string to a stored procedure in
sql server 2000 ?
It's just that I know sql 2000 does not have xml type. If this is true then
how is it possible to pass very large xml string to a stored procedure
parameter? Remember that the xml strings may ... more >>
Query question
Posted by fniles at 2/23/2007 1:31:12 PM
I have 2 tables like the following:
Example of tbl1:
Account OrderNumber Quan
12345 12345-1 1
12345 12345-2 1
99999 99999-1 1
Example of tbl2:
Account Currency
12345 F1
12345 F2
12345... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
sp_send_dbmail Authentication Unsuccessful w/ Exchange Server (SMT
Posted by Mike DeYoung at 2/23/2007 1:28:07 PM
Hello All,
I cannot get sp_send_dbmail to send e-mail to my Exchange Server 2003
mailbox. Database Mail works fine when I "Send Test E-mail..." in Managment
Studio.
I've confirmed all things are configured and working correctly according to
"Troubleshooting Database Mail: General Steps" ... more >>
Declaring row type variable for use with a cursor
Posted by mrink1074 at 2/23/2007 12:46:02 PM
I'm trying to figure out how to define a varaible that mimics a row
type from a table. Then when I do a cursor fetch, I can grab the
entire row and store its contents in this variable. I know it can be
done in Oracle using the following PL/SQL code, I'm looking for the T-
SQL equivalent.
de... more >>
Constraint in SQL 2005
Posted by RickSean at 2/23/2007 12:41:40 PM
what's the difference between the following two CONSTRAINT created by SQl
Server 2005 (Script Table As -> CREATE To)
CONSTRAINT [MyColumn1$PrimaryKey] PRIMARY KEY CLUSTERED
CONSTRAINT [PK_MyColumn1] PRIMARY KEY CLUSTERED ... more >>
Cleaning up tables with no primary key
Posted by UnglueD at 2/23/2007 12:36:04 PM
Hello.
I wish to create and schedule a procedure that clears out old archived
orders we have stored.
The problem I'm running into is that the archive table previously had
no constraints about any primary keys. I wish to delete from 2
different tables based on the date in one of the tables.... more >>
Can anyone tell me if the following coding makes sense?
Posted by Confused at 2/23/2007 12:23:42 PM
I have inherited several applications and I'm beginning to wonder
about things I'm seeing. So before deciding that my predecessor was
inept, I thought I'd find out if any of these things make sense.
1. In a table, I have a column called 'Attending' and it is a bit
data type. Easy enough, ri... more >>
How to insert leading 0
Posted by Leo Demarce at 2/23/2007 12:20:18 PM
I am writing a view that will concatenate 2 fields, both numeric. I will
need to convert them to a varchar in order to concatenate rather than add.
The first field is a smallint character 10 in this case. The second field is
a int sequential field that starts at 1 and can go up to 9999999999... more >>
Does Bulk Query not work against remote databases?
Posted by Ronald S. Cook at 2/23/2007 11:29:30 AM
My bulk query line works fine when executing it against a local database,
bot not against a remote one. Will it not work in that case? If not,
what's a poor boy to do to populate data on the server?
BULK INSERT Country
FROM
'D:\Win\FRC.COW.Feedyard.Database\FRC.COW.Feedyard.Database\Scr... more >>
varchar vs. nvarchar?
Posted by john_c at 2/23/2007 10:59:37 AM
I'm writing a web application and will be storing URLs in certain
columns along with text desriptions. I originally started with
everything as varchar(n). However, I'm thinking it will be better to
go with nvarchar(n).
The web app will be written in english but available to global users,
wh... more >>
Trigger Effects on App
Posted by csomberg NO[at]SPAM stageone.com at 2/23/2007 10:38:11 AM
I am looking to execute a simple audit trigger and am able to
accomplish when working within the database environment. Once the
application runs and trys anything, it fails to continue its own
updates.
How can I create a trigger that is NOT seen my the application. My
code is:
ALTER TRIGGE... more >>
VARCHAR to DATETIME
Posted by Techhead at 2/23/2007 10:33:04 AM
I have a VARCHAR field with datetime text in this format: YYYY-MM-DD
HH:MM:SS
How can I convert this to datetime so I can query on a date range for
the last 2 months? I've heard of CAST but not sure if that works for
this.
Thanks
... more >>
Cursor vs set
Posted by bradsalmon at 2/23/2007 9:02:47 AM
Hi all,
First off a disclaimer, I'm a very basic user of sql and stored
procedures etc., it's not my job function, however I've managed to get
some basic stuff up and running.
However, I'm a frequent user of cursors and now I'm wondering if this
is right. I've been reading in the group that... more >>
get latest for all (a sqlStmt)
Posted by rodchar at 2/23/2007 8:49:03 AM
hey all,
i have an employee history table like the following:
EmpID,Start Date,End Date,Status
1,7/31/06,8/15/06,PartTime
1,8/16/06,null,FullTime
2,12/1/03,3/1/03,PartTime
2,3/2/03,null,FullTime
Given there are duplicate entries needed for each employee, how would i say
in a sql statemnet... more >>
Pivot Data into Derived Columns
Posted by James at 2/23/2007 8:00:15 AM
I would greatly appreciate help with the following scenerio:
I have 2 example tables here:
create table tblloans
(
loannumber int primary key
)
insert into tblloans (loannumber) values (1)
insert into tblloans (loannumber) values (2)
insert into tblloans (loannumber) values (3)
crea... more >>
openxml limitation
Posted by farshad at 2/23/2007 7:47:05 AM
I am passing xmlstring as varchar(8000) to be used inside the openxml query.
At present I am using sql server 2000.
The issue is that some of the xmlstrings are longer than 8000 characters.
Tried using text but can not manipulate strings using text datatypes.
What is the alternative please?... more >>
T-SQL for large dataset
Posted by Shariq at 2/23/2007 7:32:00 AM
I am trying to copy data from a linked Oracle 9 database in to SQL Server
2005 using the following T-SQL. Is there a better technique that I can use
excluding BCP, DTS, SSIS and VIEWS?
INSERT INTO ProdDesc
select * from openquery(MyLinkedServer,
'SELECT A.ProdId, A.ProdDesc, A.ProdCat,
... more >>
Select from stored procedure
Posted by ciupaz at 2/23/2007 7:15:48 AM
Hi all,
I have a stored procedure that returns a recordset.
For example
create procedure up_HotelDetails
@IDHotel int
as
select * from hotel where IDHotel = @idhotel
Can I put a SELECT on the recordset that it returns?
For example:
Select rooms from (exec up_HotelDetails 1)
Tha... more >>
sql server 2000 OPENXML to insert
Posted by farshad at 2/23/2007 4:58:00 AM
Hi,
Trying to use OpenXML to insert the xml data into table.
As you can see in the sql code I am first trying to see if the select *
works but nothing is returned. The idea is to eventually get this to do the
insert into the table.
can you please see what i am doing wrong?
Here is the xml sa... more >>
Filtered SUM
Posted by ciupaz at 2/23/2007 2:38:51 AM
Hi all,
I have a table like this one:
CREATE TABLE Expense(
ExpenseType varchar(100),
InTown char(1),
Amount money)
that, until now, it was used with this query:
SELECT ExpenseType, SUM(Amount)
FROM Expense
GROUP BY ExpenseType
Now I need to obtain something like this:
ExpenseTy... more >>
Convert MS Access Queries to SQL Server Stored procedures
Posted by MSK at 2/23/2007 2:25:53 AM
Hi,
I am converting a MS Access 2003 Application into SQL Server + .NET. I
imported all the tables into SQL Server easily using the "import"
option in SQL server
But for Queries - I could not find any easy way to migrate all the
queries
Is there any direct import/export process available... more >>
Scheduled DTS not working
Posted by Matt Urbanowski at 2/23/2007 2:04:15 AM
Hi,
I have a DTS in SQL Server 2000 which runs fine when executing it
manually.
The first step is a dynamic property task which uses SQL to
dynamically set a Source Connection e.g. 'D:\Reports\Report 23-
Feb-07.csv' The next step is to then transfer that data to SQL Server
by the means of a Tr... more >>
Incorrect result for sorting unicode data
Posted by VnsChng at 2/23/2007 1:23:02 AM
Hi all,
I have a table which contains the names of employees and their information.
The [EmployeeName] field of the table is in unicode. Some of the names
contains "-" (hyphens).
I've read posts in Microsoft KB that the SQL Server will ignore the "-" when
they do a sorting on unicode dat... more >>
Why can't I modify column default value?
Posted by brett at 2/23/2007 12:38:18 AM
I'm trying to set a smalldatetime column with a default of
"getdate()". I get this error in SSIS:
'table1 (someSchema)' table
- Error modifying column properties for 'DateModified'.
There is already an object named 'DF_table1_DateModified' in the
database.
Could not create constraint. See p... more >>
Conversion failed when converting the varchar value 'F' to data type bit
Posted by Villi Bernaroli at 2/23/2007 12:00:00 AM
Hello,
I'm not an expert SQLserver user but sometimes I find myself working with
it.
Now I'm experiencing the above error when I try to connect to my SQLexpress
2005 database using the ODBC Driver for SQL2005. If I use the ODBC driver
for SQL2000 it all works well, and I can't understand why... more >>
using a VALUE + a STRING as an ALIAS?
Posted by Jerome at 2/23/2007 12:00:00 AM
Hi,
I'd like to translate this from Access SQL to 'true' SQL:
SELECT "http:/mydomain/" & [Image] AS image_url
I've tried several things but SQL Server doesn't accept it.
How can I add this string to the value of that field?
Thank you very much!
Jerome... more >>
sql connection close (vb.net problem)
Posted by Agnes at 2/23/2007 12:00:00 AM
During form Load, I want to fill in the dataset and the close the connection
at once. However, In SQL Server, I still find that the connection exists and
the status is "AWAITING COMMAND". My client 's IT admin complaint that this
connection should be disappear.
I really got no idea about SQL adm... more >>
|