all groups > sql server programming > december 2005 > threads for wednesday december 7
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 29 30 31
Looping through records
Posted by schapopa at 12/7/2005 11:31:34 PM
Hi,
I have a table with papers and second table with types of papers. Now
beetwen papers and types there is many to many relationship.
But in my application I would like to display records the way:
eg.
paper1, type1 type2 ... typex
paper2, type2
paper3, type3 type5
...
I don't know how ... more >>
Moving an Access Database to SQL Server.
Posted by Db_Stuff at 12/7/2005 11:23:01 PM
Is there a way of taking an access database and create a replica of that
database as a sql Server database, but only doing it by code. Reason being I
am asking this is because we currently have clients that are running on an
access database using the access runtime and I am installing the Micr... more >>
For each record in a table
Posted by Tor Inge Rislaa at 12/7/2005 7:40:46 PM
Hi I have two table related to each other, but not bound trough an id. I
know that there are better ways to do this relation but I am not in a
position that I can change the design of the database.
My tables are as below
Table name myCategory
id description
1 ... more >>
Help finding record pairs
Posted by lee_mre NO[at]SPAM .no-spam.yahoo.com at 12/7/2005 7:01:03 PM
I'm trying to find away to match up two rows into a single event.
PK Name Event Type
1 Foo Open Foreground
8 Foo Close Foreground
16 Bar Open Foreground
18 Bar Open Background
22 Bar Close Background
23 Bar ... more >>
Conditional Where clause
Posted by Kay at 12/7/2005 6:09:24 PM
TableA:
Id Username Password External ID ExternalSystem
1 dane dane 1 TableA
2 smith smith 2 TableA
3 david david 6 TableB
4 ron ... more >>
Connect to SQL Server 2005 Express w/ Classic ASP
Posted by Andrew at 12/7/2005 4:36:04 PM
I am trying to connect to SQL Server 2005 Express with old school ASP. I've
got an existing application that ran with SQL Server 2000. I'm trying to
move the site to a new server. I installed SQLEXPRESS 2005, imported the old
databases without problem, but I can't get the ASP code to connec... more >>
SQL Pass-Through Query in Access
Posted by NerdGirl at 12/7/2005 4:36:03 PM
I have a T-SQL query that gathers and groups data, stores it in a temporary
table [Select Into] and then generates output using the grouped data plus
columns with calculated percentages.
The query works fine in Query Analyzer, but bombs as a SQL pass-through
query in an existing Access 2002... more >>
between dates and times
Posted by wibbers2000 at 12/7/2005 4:32:27 PM
Hello,
I am new to SQL and am having a problem with dates and times.
I have a table with a 4 columns. Date, Time, Material, Qty
example;
01/12/05 04:00 steel 35
01/12/05 06:00 steel 60
01/12/05 23:40 steel 40
01/12/05 08:00 iron 25
02/12/05 05:00 ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Dynamic generating a SQL statement that includes "INTO #temp"?
Posted by domtam NO[at]SPAM hotmail.com at 12/7/2005 2:58:00 PM
Hi there. I started with a simple stored procedure like
select col1, col2 into #temp from table1
select * from #temp
.....Do something else here....
For some reason, I'd like to generate the first query dynamically.
declare @sqlStmt varchar(200)
set @sqlStmt = 'select col1, col2 into #te... more >>
sql result set not matching the .net page
Posted by Carol at 12/7/2005 2:45:02 PM
I have a stored proc that returns a result set of 40 rows. When the .Net page
displays, an extra row displays. For example, a teacher has 40 students in
her class. When the class roster sproc is run with the appropriate parms, the
result in query analyzer is 40 rows. But the exact same result ... more >>
Can't get MAX DISTINCT to work the way I want it to
Posted by Randall Arnold at 12/7/2005 2:41:50 PM
I have 3 numeric fields in a table that need to be returned by a query:
SupervisorLineID (autoincrementing ordinal), SupervisorID and LineID.
SupervisorLineID is the only definite unique value; there are cases where
one supervisor can manage more than one production line, and thus be
represe... more >>
Select query using SQL Helper functions
Posted by Mark Hollander at 12/7/2005 2:26:12 PM
Hi All,
Is there a way that I can get the folowing query to work
Select Column_Name from (exec sp_columns @Table_Name = UsedVouchersTbl)
where Column_Name='Cost'
I need to know if a column exists in a table e.g.
IF not Exists (Select Column_Name from (exec sp_columns @Table_Name =
... more >>
Saving and Retrieving Binary Files in MSSQL 2005
Posted by Goh at 12/7/2005 1:42:56 PM
Dear all,
Can any one provide me a sample source regarding saving and retrieving
binary files in MSSQL 2005. I have try it but I found that it only insert
the first element of that byte array that I read from file to table.
I was using Microsoft Data Access Application Block version ... more >>
Relesae Process Question
Posted by JohnnyMagz at 12/7/2005 1:39:01 PM
OK, through your (collective) help I've managed to develop a database
application that's ready for its second release. I need some guidance on
deploying database changes please.
I have three environments: dev, qa, prod. Structural changes (tables, procs,
functions, etc) will only move in on... more >>
sp_configure 'max_text_repl_size'
Posted by kramer.newsreader NO[at]SPAM gmail.com at 12/7/2005 12:48:37 PM
I have a C#.NET application (although I'm not sure that the language
matters) that inserts files into an SQL server database. The files
have started to get large, so we get the error message:
Length of text, ntext, or image data (292800) to be replicated exceeds
configured maximum 65536.
f... more >>
Specialized output from two tables.
Posted by Chesster at 12/7/2005 12:31:02 PM
I have an equipment table and a tracking table. Eqpt table has the record id
and the piece of eqpt.
Tracking table has the rec_id from the eqpt table and the tracking number
and the IO. IO indicates that the tracking number is either incoming (I) or
outgoing (O). I need to output the equipmen... more >>
Pass XML between SPROCs possible in SQL 2000? 2005?
Posted by Dave Slinn at 12/7/2005 12:29:18 PM
A: I can create an XML fragment using the For XML Auto clause. No problem
so far.
B: I have a stored procedure that takes an XML document as ntext and uses
the extended sproc sp_xml_preparedocument and the OPENXML function to create
a table from it - no problem with that.
Now I want to ... more >>
Select Having?
Posted by Patrice at 12/7/2005 12:26:02 PM
Hi,
I have a staging table with 2 months worth of data (that is processed for
calculations nightly), I then have a fact table that has all data dated back
to the beginning of time for the system. I need to delete the rows/records
in the fact table that have a matching row/record in the sta... more >>
Stored procedure refer to another Stored Procedure ?
Posted by fniles at 12/7/2005 11:53:12 AM
I am in the process of converting Access db to SQL Server, and there are
many queries that refer to another query.
In Stored Procedure, can you do a select from another stored procedure ?
Thanks.
For example:
Stored Procedure spA
Create Procedure spA as
select ..., PL from tblA
Stored ... more >>
SELECT * FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data ....
Posted by Xavier at 12/7/2005 11:45:03 AM
hello,
i tryed to run in the query analyser the command
SELECT * FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data
Source="e:\transfer\Input\t1.txt";Extended properties=text')
but i get the syntax error
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ')'.
a... more >>
DateAdd function in Stored Procedure
Posted by AkAlan at 12/7/2005 11:11:04 AM
I need to be able to store a value in a datefield that is 8 hours greater
than another datefield (SchedOpen) which the user updates. What happens is
the user enters local time and I need to also store that time as GMT. I tried
this as an alias in a stored procedure: "DATEADD(hh, 8, SchedOpen)"... more >>
When the job is complete?
Posted by Test Test at 12/7/2005 11:08:43 AM
I have a stored procedure that executes a job using 'sp_start_job'
besides some other stuff. The piece of code is:
print 'The request is being processed. Please wait...'
exec sp_start_job @job_name = 'TEST'
print 'The request is complete.'
I want the 2nd Print statement to be executed afte... more >>
Connecting a stored procedure to another server
Posted by Ryan D at 12/7/2005 10:46:03 AM
I created a new stored procedure on one server because this is the only
server we can create new stored procedures on, however, all of my select
statements in this procedures are on a different server. How do I execute
this stored procedure on the other server, database, table, and login?
... more >>
Stored procedures to CREATE TABLE with n fields
Posted by Xavier at 12/7/2005 10:41:02 AM
hello,
i want to create a table with n fields of type varchar(50)
for example if n=2
i want to get the code like
CREATE TABLE [dbo].[__TTest1] (
[f1] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[f2] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY... more >>
eliminate the Return charactor in a column
Posted by Lynn at 12/7/2005 10:35:02 AM
Hi,
We have a column defined as ntext for a column and we need to transfer this
column to oralce platform. Before transferring, we convert the data to
varchar. Some of data content "RETURN" charactor, and it caused issue for
providing report or printing.
Please suggest a way to elimi... more >>
Using Indexes for DATETIME datatype
Posted by Andy Wilbourn at 12/7/2005 10:28:17 AM
I have been searching to get the real scoop on why SQL does not leverage
NON-clustered indexes on DATETIME columns. From what I have read some say
you have to have a clustered index to make it find it, other posts say that
if it is a stored procedure it will figure it out.
Please explain wh... more >>
How can I make SQL Server automatic generate scheme script for backup everyday?
Posted by ABC at 12/7/2005 10:09:00 AM
How can I make SQL Server automatic generate scheme script for backup
everyday?
... more >>
Increment variable by each row in set
Posted by StvJston at 12/7/2005 9:48:03 AM
I'm new to stored procedures and set based updates I have a parameter passed
that represents a starting check number. I have to update each row with an
incremented number based on the starting row. Here is what I have so far and
qry analyzer complains about incrementing the counter
CREAT... more >>
IN clause bug
Posted by Nikola Milic at 12/7/2005 9:30:48 AM
Hi,
Is this bug?
SELECT *
FROM pubs.dbo.titles
WHERE title_id IN (
SELECT title_id -- COLUMN title_id DOES NOT EXIST IN
authors TABLE ??
FROM pubs.dbo.authors
)
I use SS2000, SP4, Win 2000 Advance, SP4.
Thanks in advance
Nikol... more >>
Reporting Services 2000 does not deliver attach documents by e-mail.
Posted by Dina at 12/7/2005 9:08:42 AM
Hello,
I'm currently working in some reports(Reporting Services 2000)
that have to be send (e-mail subscription) like XLS or CVS file to
the internal users, but the e-mails have not been received by any user
with the attached documents.
However the other mails subscriptions includ... more >>
truncate table
Posted by jaylou at 12/7/2005 9:01:03 AM
Hi all,
Is there a way to truncate a table from a linked DB?
Truncate table server.DB.DBO.tablename produces an error. too many parts.
TIA,
Joe
... more >>
import a text file into the database
Posted by Xavier at 12/7/2005 8:51:02 AM
hello,
i want to import a textfile in the database (SQL)
For access.database the code like:
cnn.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\DB1.mdb;" & _
"Jet OLEDB:Engine Type=4;"
sqlString = "SELECT * INTO [tblSample2] FROM
[Text;HDR=NO;DATABASE=... more >>
ALTER DATABASE dynamic SQL
Posted by RSH at 12/7/2005 8:47:38 AM
I am in a bind.
I am writing a stored proc that needs to change the logical name of a
database as one step in the process. The issue is that I can't seem to pass
the database in a variable to the Alter Database command.
What are the options I have for making this work?
Code snippet:
... more >>
BULK INSERT
Posted by Xavier at 12/7/2005 8:46:06 AM
hello,
i want to import a flat file in the sql server.
Is it possible that when setting up the bulk insert command
example
BULK INSERT TFB_EasyCashCustomerFTemp FROM 'e:\mycustomer.csv'
WITH
(
FIELDTERMINATOR = ';',
ROWTERMINATOR = '|\n'
)
also a ... more >>
Avoiding Temporary Tables
Posted by Lanny at 12/7/2005 8:39:03 AM
Hello All,
I have a question about how I might avoid using a temporary table in a sql
query. In a query I am writing I am trying to extract data from a table on
an existing database via a set of identifier codes (These queries are written
from the Matlab environment and the list of ident... more >>
alter view question
Posted by Kevin at 12/7/2005 7:45:03 AM
how do I find out when was the last time view got modified.
... more >>
Help on Sybase Power Designeer
Posted by Kumar at 12/7/2005 7:31:02 AM
Hi,
I want to learn Sybase Power Designer...but i dint find right meterial till
now .
Can anybody give me the links for the tutorials or articles..
Thanx for the help guys
Kumar ... more >>
Index Ratification
Posted by Daniel J Watkins at 12/7/2005 7:08:57 AM
Hi all,
I'm going through the process of identifying which items in my tables to
place indexes on.
I'm using the following general rules in deciding usage. Can anyone advise
whether these are correct?
- All primary keys to be a clustered index.
- All foreign keys to be unclustered.
- I... more >>
Query on XML column: fn:lower-case not working?
Posted by michael.hofer NO[at]SPAM getronics.com at 12/7/2005 7:08:53 AM
Hi everybody, I'm looking to issue a query to an XML column like this:
SELECT *
FROM dbo.ContactRecords
WHERE XmlContent.exist(
'declare namespace
my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-03-09T14-09-40";
//my:myFields[my:AddressInfo[fn:contains(fn:lower-case(my:C... more >>
CASE and INSERT statements
Posted by JenC at 12/7/2005 6:34:03 AM
Hi,
I need to write a simple script which i am getting rather confused on how to
write. Basically, what i need to do is:
If no records exist for a particular condition i.e. TableID=3 and
TableTypeID=4, then insert a row into Tabel1.
I have tried all sorts but I think i have got the orde... more >>
The char '
Posted by Marre at 12/7/2005 6:19:10 AM
Hi all!
I have just updated my database and did a mistake that resulted in the
character ' around a description-field in my db.
How do I update this field? If I use ' in the sql-script, everything after
that is apposed to be text, until the next '.
Regards
Marre
... more >>
BUILTIN/ADMINISTRATORS
Posted by Suparichithudu at 12/7/2005 4:51:02 AM
Hi all
If sql server2005(yucon) is configured to windows authentication only and
builin/administrators group is removed manually, how to connect to sql server.
No other user account is available.
--
Thanks in Advance
Regards
Suparichitudu
... more >>
Multi-Select in Query --- Possible?
Posted by rudolf.ball NO[at]SPAM asfinag.at at 12/7/2005 4:11:47 AM
Hi NG,
I want to make a query where I want to let the user select turnovers
within a month, week, day of week aso. and combinated, eg.
give me alle turnovers from month = December and Day of Week = Monday
or just all turnovers from week 50
I want to do this within a stored procedure, wi... more >>
Joings between two table variables
Posted by SqlBeginner at 12/7/2005 3:36:02 AM
Is it possible to create a join between two table variables?
I tried doing something like this .. and it is throwing an error.
Declare @tstTableOne table ( Sno int, FirstName varchar(100) )
Declare @tstTableTwo table ( Sno int, LastName varchar(100) )
Insert @tstTableOne Values(1, 'Dummy1... more >>
sp_who - sp_who2
Posted by Sammy at 12/7/2005 3:20:02 AM
I am trying to find out what I should look out for. As one of applications
that accesses sql server DB is slowing down when theres a few users.
I know to check for blocks and blocking but there is none when I use
sp_who2. Is there a command that tells you how long a sql cmd has been
ruuning... more >>
Index on Views ...
Posted by SqlBeginner at 12/7/2005 1:32:02 AM
I know that we can create indexes on views (Indexed views) in sql 2k. I am
trying to understand what would be the reason for creating a index on a view.
Anyway a view is a virtual table and if there is an index on those table
won't it be enough? Hope somebody could make me understand this.
... more >>
Splitting a table (to speed things up)
Posted by Craig HB at 12/7/2005 1:18:04 AM
In a database I have a table called ProfitCentres, which has many columns. A
few of the columns (ProfitCentreID and ProfitCentreName) are accessed all the
time, while the other columns are accessed very infrequently (eg. address
details).
If I split the ProfitCentres table into ProfitCentre... more >>
|