all groups > sql server programming > november 2003 > threads for sunday november 30
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
Insert and retrive a file form "Image" datatype column
Posted by Murali at 11/30/2003 10:01:05 PM
I want to put a data file available on c:\ to an 'Image' datatype column in a table through an SQL query from my application
And also I want retrive back that column data into a file on to c:\ through the SQL query
... more >>
Does ASp.net also use ADO.net
Posted by sql at 11/30/2003 9:59:26 PM
Does ASP.net also use ADO.net to access data within databases ?
... more >>
Help with 'group by' SQL Query
Posted by Adrian at 11/30/2003 5:55:23 PM
Using the following query (hopefully it is self-explanatory):
select school, schoolyear,class, gender, count(gender)
from schools
group by school, schoolyear,class, gender
This gives two rows for each class, one for males, one for females. For
example:
SchoolOne, YearOne, ClassOne, Male,... more >>
convert() int to char
Posted by GreggT at 11/30/2003 5:46:10 PM
How do I convert an integer to char with leading zeros? If the integer = 123, I want the char variable to be in the format 000123.... more >>
Autoincrement a Number
Posted by Abhi at 11/30/2003 5:42:58 PM
Hi,
I am quite new to SQL Programming.Is there any function
or property in sql programming to autoincrement a number.
I want the rowid to increment as and when a record is
inserted and if any record in between is deleted the
number must accordingly adjusted. Could someone let me
know how... more >>
best way to do a MTD / YTD query
Posted by Gee at 11/30/2003 5:12:28 PM
I have a table like
create table budgets (
yea int,
mth int,
clientID,
amt money,
NonChargeAmt money
)
I now want to do a report showing the month to date and year to date Actuals
(from a transaction table) and Budgets. I currently do the Budgets in two
queries but want to know if ther... more >>
assigning result of openquery()
Posted by GreggT at 11/30/2003 4:31:12 PM
How do you assign the result of openquery() to a variable? My query is
select * from openquery(MYREMOTETEST, 'select interface_seq.nextval from dual'
When I tried
declare intNextVal intege
set intNextVal = select * from openquery(MYREMOTETEST, 'select interface_seq.nextval from dual'
I get an... more >>
Looping for Recordset in SPROC
Posted by Scott at 11/30/2003 4:28:30 PM
I'm trying to get 1 recordset from DATABASE 1, capture 3 values from
DATABASE 2 and then loop through Recordset 1 performing a calculation using
the 3 values from DATABASE 2. FIGURE 1 shows Recordset 1 from DB1 and
FIGURE2 shows Recordset 2. Both have the "Shift" field in common and FIGURE
3 sho... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
SQL-Server collation type & OLE-DB Providers
Posted by John A Grandy at 11/30/2003 4:14:36 PM
is it possible that the the collation type could be interfering with
OLE-DB's ability to execute a SQL-Server SP ?
development workstation:
XP Pro SP1
SS2K SP3 collation=SQL_Latin1_General_CP1_CI_AS
production server:
W2K Advanced Server SP4
SS2K SP3 collation=SQL_Latin1_General_CP1_CI_AI... more >>
Need function to convert nodes ?
Posted by Luqman at 11/30/2003 3:34:43 PM
I need an sql server function to do the following.
Data Change to
1.1 01.01
1.1.1 01.01.01
1.1.10 01.01.10
1.1.1.2 01.01.01.02
And vice versa, any idea please ?
I tried following but could not succeed.
Create Function itemCode
(@Ac... more >>
Need function to convert nodes ?
Posted by Luqman at 11/30/2003 3:33:55 PM
I need an sql server function to do the following.
Data Change to
1.1 01.01
1.1.1 01.01.01
1.1.10 01.01.10
1.1.1.2 01.01.01.02
And vice versa, any idea please ?
I tried following but could not succeed.
ALTER Function itemCode
(@Acc... more >>
Data Transformation services
Posted by Chris at 11/30/2003 2:52:37 PM
I have created a DTS script in the local packages area called
S_P_Reporting_Import to transfer data into a SQL database. The script is
working correctly, however I would like to know if I can control this
script from a VB program using ADO and if yes what is the required code?
Chris
North C... more >>
MSDE has no query debugging tool or Transact Sql Debugger ?
Posted by Luqman at 11/30/2003 2:02:19 PM
I am looking for Transact Sql Debugger in my query analyzer but I could not
find it, my Query Analyzer Version is : 8.00.194
and my MSDE Version is : 8.00.760 SP3, running on Windows XP Professional.
Any idea please ?
Best Regards,
Luqman
... more >>
Programmatically retrieving a "Table Layout/Structure"
Posted by Scott Cadreau at 11/30/2003 2:01:39 PM
I am writing a program that will loop through each column and generate
statistics on that column.
(i.e. Min values, max values, Null count, etc). I need a way to be able to
retrieve the table structure to be able to loop through each field within
the program.
Thanks,
Scott
... more >>
Need lots of help with triggers - best method
Posted by Geoff at 11/30/2003 2:01:09 PM
I have 2 similar tables in MS SQL2K and a 3rd table which correlates the
fields between the first two tables. When the first table has a modification
(Insert or Update) I need the other table/fields updated based on the field
correlation and vice versa. Any suggestions are greatly appreciated!
... more >>
Compare with SP, is UDF really a bad choice? please help.
Posted by david at 11/30/2003 1:37:12 PM
I was finetuning my codes, and found UDF is really slow than SP, I could not
understand.
I had a table function, it populates data according to input parameters.
When I used the same code to create a SP to do the same thing with a table
variable, it only took one third of the time the UDF took... more >>
How do I: Populate a table var from a table udf
Posted by Hal Heinrich at 11/30/2003 1:33:06 PM
I want to load a table variable with the output of
a table UDF. Here's the code I hoped would do the job:
DECLARE @ATBL TABLE (strVal nvarchar(4000))
SET @ATBL = dbo.fnListToStringTable (@ATTRTXT, 1)
I'm getting the following error when I try to save this
in a proc: ADO error: Must declare ... more >>
What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000?
Posted by net__space NO[at]SPAM hotmail.com at 11/30/2003 12:40:30 PM
Hi All!
We are doing new development for SQL Server 2000 and also moving from
SQL 7.0 to SQL Server 2000.
What are cons and pros for using IDENTITY property as PK in SQL SERVER
2000?
Please, share your experience in using IDENTITY as PK .
Does SCOPE_IDENTITY makes life easier in SQL 2... more >>
Can FK be nullable/optional by design?
Posted by net__space NO[at]SPAM hotmail.com at 11/30/2003 11:14:52 AM
Hi All!
General statement: FK should not be nullabe to avoid orphans in DB.
Real life:
Business rule says that not every record will have a parent. It is
implemented as a child record has FK that is null.
It works, and it is simpler.
The design that satisfy business rule and FK not n... more >>
Storing a file in SQL
Posted by visvivalaw NO[at]SPAM hotmail.com at 11/30/2003 11:08:33 AM
Ok, I know the datatype should be text, ntext or image. That's fine.
But how do I actually store a file? Does anyone have an example of a
stored procedure that reads a file in (by passing a file path?) to SQL
Server?... more >>
SQL Server Interface with Exchange Server
Posted by Thomas at 11/30/2003 10:47:55 AM
I want to keep some Microsoft Exchange Server 5.5 Group
lists current based upon what people enter in a SQL Server
2000 database. Are there any existing routines that I can
use to do this? Thank you.... more >>
Why T-SQL ?
Posted by I_AM_DON_AND_YOU? at 11/30/2003 9:47:10 AM
I am just curious to know as to why should we know the T-SQL commands for
various things which we can do very easily and quickly with Enterprise
Manager. For example, attaching/detaching, backup/restore, create logins,
database users, provide permissions, etc.---- all these things can be done
us... more >>
Numbering rows in a result set
Posted by Ervin108 at 11/30/2003 9:31:05 AM
How can I number rows in a result set with a pseudocolumn or function
I would like to have a select statement with the result set like this
e.g.
SELECT (???), USER_NAME from USER
Result set
1, 'User 1
2, 'User 2
3, 'User 3
etc
So the first column (???) should be a computed value always star... more >>
Can't save decimal value
Posted by STom at 11/30/2003 7:40:39 AM
I have an ADO.Net dataset with a table that I am saving to a SQL 2000 table.
A particular field is decimal and in the database table, I have the size,
precision, scale set to 9(18,3).
For some reason, even though my database field has a value such as 0.0654...
nothing is getting saved into t... more >>
|