|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL Server database programmingmicrosoft.public.sqlserver.programming
Trying to find the right query syntax...
Dan -
15 Sep 2006 5:20 PM - 1 message
Hello, I'm wondering if someone could help me with this problem. I've attached a PDF file to this post that shows you what I'm trying to accomplish. I've already tried some GROUP BY and ORDER BY ...
Speed??????
Scott Burke -
15 Sep 2006 4:09 PM - 1 message
We have a MS SQL 2005 server I have and Access2000 table with 9 million records. (HISTORY) I created a table on the SQL and linked it into an Access .MDB (HISTORY_OLD) When ever I use an append query to copy History into history_old I get errors. ...
A pivot table/Report with dynamic columns??
MittyKom -
15 Sep 2006 4:06 PM - 1 message
Hi All I am trying to make a pivot table with dynamic columns. I have included below all the queries i am using. How do I change the query so that the columns for Tr1, Amt1, [Description1], Duedate1, Tr2, Amt2, [Description2], ...
SQL 2005: Why does DECLARE varchar(MAX) in Stored Procedure not work?
Andreas Klemt -
15 Sep 2006 3:56 PM - 4 messages
Hallo, I have a Stored Procedure with DECLARE myString varchar(MAX) Now when I set a text which is bigger than 8000 Bytes, it gets cut. Why? I thougt SQL 2005 has now varchar(max)? Thanks for any help! Regards ...
HOW TO: PIVOT for unknown number of column headings?
Edmund -
15 Sep 2006 3:28 PM - 3 messages
Hello, In SQL Server 2005 there is the PIVOT command that you can apply to your SELECT statement to pivot data as you do in Excel. However, unlike Excel, in SQL you need to know the number and names of the column headings in order ...
Programmatic package execution - SQL Server 2005
zdrakec -
15 Sep 2006 3:19 PM - 1 message
Hello all: I have a package that I am executing from code. The relevent snippet: Private pk As Microsoft.SqlServer.Dts.Runtime.Package (declared at form level) Sub ExecutePackage Dim app As New Microsoft.SqlServer.Dts.Runtime.Application pk = app.LoadPackage(PACKAGEPATH, Nothing) ...
Assistance with SQL Script
Sam Commar -
15 Sep 2006 3:07 PM - 3 messages
I have a database where I need to change all period to post information back 1 year. There are approx 400 tables and most of them have a perpost field where the Period to post information is stored. I need to take this information back ...
View fails though underlying query works in QueryAnalyzer
Blue Sky -
15 Sep 2006 3:03 PM - 1 message
I have a view examing the msdb databases across 17 servers to tell me the location of all the latest database backupfiles. I use linked servers to connect to the remote servers. When i run the query, it runs in about 22 seconds. ...
How do I Convert this Statement to T-SQL Code?
EdSharK@gmail.com -
15 Sep 2006 2:25 PM - 3 messages
hello am a newbie here... i hope you could help me.. foxpro code goes like this, select id from employee into cursor CurEmployee * Select id from AppTable where id In (Select id from CurEmployee) in short am still studying on how to make a cursor using T-SQL ...
query to return month strings for year
NH -
15 Sep 2006 2:21 PM - 5 messages
Hi, Is there an sql query I can use to return the following data.. january 2006 february 2006 march 2006 etc december 2006 Until now I have just been writing sql to add these values to a table variable one by one. Is there a query that will return all the 12 values at ...
Oracle string functions conversion to T-SQL
Rob -
15 Sep 2006 1:51 PM - 4 messages
Hi, We've migrated an Oracle table to SQL and old processes calling this table also needs conversion. One such SELECT stmt, shown below, extensively uses the INSTR Oracle string function. SELECT SUBSTR(ft_reference, INSTR(ft_reference,''['', INSTR(ft_reference,''CHECK #'', 1, 1), 1)+1, (INSTR(ft_reference,'']'', INSTR(ft_reference,''CHECK #'', ...
Single to Multiple columns
Rob T -
15 Sep 2006 1:32 PM - 6 messages
I have a large table filled with product serial numbers. Similar to how a datagrid in .net works, I would like to be able to query the single column, but have it return the data in 3 columns. I have no problem having 3 unique ...
where datetime between 2PM and 3PM
newscorrespondent -
15 Sep 2006 1:29 PM - 6 messages
I need to select from a datetime column based on time of day. I don't see any functions to do this. Did I miss a section in BOL? Is the best way to do this a function That takes the datetime, from and ...
Database Performance query
FARRUKH -
15 Sep 2006 1:22 PM - 1 message
I work in a production company and have running 10 databases in SQL Server 2000. Sometimes databases run very very slow. But when i run sp_who2, sp_lock2 and Log file, it doesnt tell me anything is there anyway i can check either command prompt or Enterprse edition the ...
Query Help
atatum -
15 Sep 2006 1:14 PM - 1 message
I need some query help and I would really appreciate any help. Below is my query: Select AdminAdvertiserList.Company, AdminAdvertiserList.City, AdminAdvertiserInvoices.[Contract Date], AdminAdvertiserInvoices.[Start Date], AdminAdvertiserInvoices.[End Date], AdminAdvertiserInvoices.Amount, AdminAdvertiserInvoices.AdditionalRevenueProgram, AdminAdvertiserInvoices.Payments, AdminAdvertiserInvoices.Messages, AdminAdvertiserInvoices.[Bonus Messages], AdminAdvertiserInvoices.Type, ...
Incease Database size
FARRUKH -
15 Sep 2006 12:59 PM - 2 messages
my database is 90% full. how would I increase the size of the size? when the database full does it mean to increase or make a new datafile? ...
SQL permission problem
Bob Weiner -
15 Sep 2006 12:51 PM - 4 messages
I have downloaded two different ASP tutorials from Microsoft which require the use of SQL 2005 Express. In both cases I am getting the error: Failed to generate a user instance of SQL Server due to a failure in ...
Best way to document databases ?
mark -
15 Sep 2006 12:37 PM - 3 messages
Is there a way of documenting a database - like what was available in access - analyze, documenter utility ? i could just link up in access, just wondering if there was another way cheers mark ...
SQL contacts to mobile phone
David -
15 Sep 2006 12:35 PM - 1 message
Does anyone know where I can get information about uploading my contact names/phones on SQL table into my mobile phone? I can get outlook contacts there using ActiveSynch, etc. but would like to export directly from contacts in SQL table. Our contact mgmt app. is in VB. Thanks. ...
SQL Query
JP SIngh -
15 Sep 2006 11:37 AM - 2 messages
I have two tables like Contracts Table Id LawyersName InitiatedBy 1 SING PETE 2 SING HAWT ...
How to concatenate strings from a column into a single row (with NULL value)?
Cylix -
15 Sep 2006 9:07 AM - 9 messages
<snip> CREATE TABLE Colors ( Color VARCHAR(32) ) GO SET NOCOUNT ON INSERT Colors SELECT 'red' INSERT Colors SELECT 'orange' INSERT Colors SELECT 'blue' INSERT Colors SELECT 'green' GO DECLARE @colors VARCHAR(1024) SELECT @colors = COALESCE(@colors + ',', '') + Color ...
Creating a view do display normalised data flattened
ben.noblet -
15 Sep 2006 8:14 AM - 3 messages
Hi all, I have created the following schema to illustrate my question: CREATE TABLE [dbo].[tblCustomerProperty] ( [cpcusID] [int] NOT NULL , [cpproID] [int] NOT NULL , [cpValue] [varchar] (50) COLLATE Latin1_General_CI_AS NOT NULL ...
avoiding table lock whe updating million of records at a time
SQL Ken -
15 Sep 2006 8:02 AM - 2 messages
if we must have to update millions of records at a time, what is the possible ways to avoid table lock. Thanks Ken ...
sql time out
samundeeswaran kalaiselvan -
15 Sep 2006 7:47 AM - 2 messages
sql time out error when running sql query in asp.net how can i rectifive this error please any one help me by sam *** Sent via Developersdex [link] *** ...
How to use ROBUST PLAN in the query??
Raghavendra Y Nayak -
15 Sep 2006 7:45 AM - 2 messages
Hi: I'm trying to retrieve a large record and I'm getting the following error. Plz can anyone help... Regards, R Y Nayak Server Error in '/fostering' Application. -------------------------------------------------------------------------------- Could not insert a row larger than the page size into a hash table. Resubmit ...
Copy diagrams from one db to another
moondaddy -
15 Sep 2006 6:39 AM - 2 messages
Is it possible to copy diagrams from one sql 2005 db to another 2005 db? I could do this in 2k by importing data from the dtProperties table to the target db's dtProperties table. what should I do in 2005? ...
sql injection question
Shahriar -
15 Sep 2006 4:30 AM - 8 messages
Could Textbox1.text or textbox2.text be hacked in anyway to allow for sql injection in the example below or is this as safe as it gets? Many thanks. Shahriar mysql = "select * from mytable where username=@username and ...
PICKLIST IN SQL
Ridhima Sood -
15 Sep 2006 4:13 AM - 10 messages
hi I am keen to know the sql command to display picklist values rather than unique numbers. for example, title is 1=mr and 2 = mrs if i say select title from contact sql returns 1 and 2 but i want it to ...
How to select a single varchar combined by many rows?
Cylix -
15 Sep 2006 3:09 AM - 4 messages
This question is quite common in my query, but I still have no idea about that. For example, My client have a number of companies, each company has its own phone number. Each phone number is store in row(not fixed number of row). ...
need help on sql
L.Peter -
15 Sep 2006 2:49 AM - 3 messages
Hi group, I have a table: table1 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Table1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Table1] GO CREATE TABLE [dbo].[Table1] ( [id] [char] (10) COLLATE Latin1_General_CI_AS NOT NULL , ...
OPENROWSET
raidken -
15 Sep 2006 1:48 AM - 3 messages
I have been struggling to run an OPENROWSET query against a SQL 2005 db. While attempting to query a SQL Server 2005 database from a SQL 2K database using OPENROWSET I set the following error: ******************************************************************************************************** Server: Msg 53, Level 16, State 1, Line 0 ...
passing a table from one sp to another sp
SQL Ken -
15 Sep 2006 12:49 AM - 11 messages
WHAT ARE THE OPTIONS do i have to pass a table from from one sp to another? write the data into a table and then use it from the other won't do the job for me. thanks ken ...
SQL problem to solve...
SammyBar -
15 Sep 2006 12:41 AM - 4 messages
Hi all, I'm facing the following problem. I should return the records from a table by using a store procedure. But each record should be repeated a number of time. The number of time the record should be repeated in the output is ...
How to utilize the rowId in sql server
SQL Ken -
15 Sep 2006 12:33 AM - 8 messages
I know that each record in a table has an id internally. Can someoneshow me how to utilize it? thanks ken ...
Temp Table Indexing??
Dan -
15 Sep 2006 12:07 AM - 4 messages
I have a stored procedure that does heavy query to get a dataset. That dataset is then used in several other queries and joined to other physical tables in the database. When I use a temp table to store the dataset, it is ...
Query help
Ami -
15 Sep 2006 12:03 AM - 9 messages
Hi All I need a query help. How to display the record(only record) that has maximum occurrence of a particular value in a column? Say, I have a Table called Table1 with columns Col1, Col2, Col3 and Col4 and Col5. I want to display the record details that occurs maximum ...
Shipping 2
CLM -
14 Sep 2006 10:42 PM - 2 messages
"[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 4306: [Microsoft][ODBC SQL Server Driver][SQL Server]The preceding restore operation did not specify WITH NORECOVERY or WITH STANDBY. Restart the restore sequence, specifying WITH NORECOVERY or WITH STANDBY for all but the final step. ...
training
Richard Douglass -
14 Sep 2006 10:31 PM - 2 messages
I am looking for a really good set of training CDs for SQL 2005. I dont want a set that teaches me how to pass the MCDBA tests. I want a set that teaches me tips and tricks and the how-to's of real programming with the ...
data disappearing in a trigger
rengeek33 -
14 Sep 2006 10:09 PM - 2 messages
I have a table that has a trigger that loads data into other tables. When I run records into this table, there is one field in particular that sometimes loads and sometimes does not (@DstIndx ). It is a strange aberration because ...
Need help with self-join
Terri -
14 Sep 2006 9:50 PM - 3 messages
I am using a self-join to add amounts with different dates in the same table. CREATE TABLE #Testdata ( Account char(1), AmountDate datetime, Amount int ) INSERT INTO #Testdata (Account, AmountDate, Amount) VALUES ('A', '20060801',5) INSERT INTO #Testdata (Account, AmountDate, Amount) VALUES ('A', ...
done in a single statement
Thom Anderson -
14 Sep 2006 9:46 PM - 3 messages
A table looks like this: create table #customer ( customerID int not null primary key, taxID char(9) not null, salesRep int null) insert #customer values (1, '111111111', 5) insert #customer values (2, '111111111', null) insert #customer values (3, '111111112', 7) ...
done in a single statement
Thom Anderson -
14 Sep 2006 9:37 PM - 1 message
A table looks like this: create table #customer ( customerID int not null primary key, taxID char(9) not null, salesRep int null) insert #customer values (1, '111111111', 5) insert #customer values (1, '111111111', 5) insert #customer values (1, '111111111', 5) ...
xp_cmdshell - works with string in one format but not in another -
smaas@newsgroups.nospam -
14 Sep 2006 9:06 PM - 5 messages
We are using xp_cmdshell in a trigger to call a VB program and pass to it required parameters. The call with the parameters in the desired structure is below (code stripped down to bare essentials): declare @sDirectory varchar(200), @sBartender varchar(200), @sOutput ...
What is the best SQL to always keep 50 latest rows in a table?
Ding Yi Lin -
14 Sep 2006 9:04 PM - 1 message
Dear Sir, My db is sql2000, I have a table, which used as a queue for data that will be fetched by client application per 1 sec. The data is just to let user know what message has been processed. ...
Are operations in a stored procedure treated as a transaction
betbubble -
14 Sep 2006 8:56 PM - 3 messages
I need help on two questions: 1. Is temp table the only way to pass recordsets from a nested stored procedure to a calling stored procedure? Can we avoid temp tables in this case? 2. Are operations in a stored procedure treated as a transaction? ...
getting sa password
rodchar -
14 Sep 2006 8:05 PM - 3 messages
hey all, how do i get/set password for sql express? thanks, rodchar ...
SSIS and SLowly Changing DImension Transform
alexde -
14 Sep 2006 8:04 PM - 2 messages
Any simple example on internet to get started with SSIS slowly changing dimension object? I am getting an error and can't find any info on resolution: there must be at least one column of fixed, changing or historical type of ...
SQL query
BK-Chicago -
14 Sep 2006 8:04 PM - 8 messages
Hi I would like help with the following query. The table: CREATE TABLE [dbo].[MyTable] ( [ID] [char] (5) AS NOT NULL , [period_date] [datetime] NOT NULL , [value] [numeric](18, 6) NULL ) ON [PRIMARY] Sample Data: 0004N 9/30/1989 67.309 ...
Update Statement
Anonymous -
14 Sep 2006 7:28 PM - 9 messages
I have 2 tables in SQL Server 2000. Table1: ID Field1 Field2 Field3 111 Table2: ID Field Code ...
Date Range
wnfisba -
14 Sep 2006 7:27 PM - 15 messages
Why would the following SQL return different rows??? SELECT CQTLOAN.LOAN_NUMBER, CQTLOAN.LOAN_CREATED_DATE FROM CQDS50.dbo.CQT_LOAN CQTLOAN WHERE MONTH(CQTLOAN.LOAN_CREATED_DATE) = '06' ...
Ship
CLM -
14 Sep 2006 7:06 PM - 2 messages
I have almost got log shipping working (SS 2000) but have one last issue to go. First of all, all jobs that log shipping set up on my primary server are working. And on the secondary server all jobs are working except for the ...
Case-sensitivity and LIKE - not working in 2000?
Paschott -
14 Sep 2006 6:43 PM - 4 messages
Ultimate goal - find all addresses that are either all lowercase or all uppercase. Running SQL 2000, hotfix level between SP3 and SP4. Created a new table of address data that is case-sensitive. CREATE TABLE Address (Address_ID int , House_ID int ...
OpenrowSet querry
SQL Ken -
14 Sep 2006 5:55 PM - 4 messages
what is wrong with my code here? I need to query from a remote sql server. thanks SELECT * FROM OPENROWSET('SQLOLEDB', '192.132.88.30'; 'loginName';'Password', ...
UDF Permissions
Joshua Andrews -
14 Sep 2006 5:44 PM - 3 messages
I know that a user must have permissions to call a UDF directly, just like they must have permissions to EXEC a stored procedure. However, if a UDF is called from within a stored procedure, and the user has permissions to the SP, does the user also need direct permissions to ...
Problem with repeated use of temp tables
Dmitriy Antonov -
14 Sep 2006 5:26 PM - 4 messages
Hello all, Following is a sample script for sp: Create Procedure spTest @Flag Bit As If @Flag=0 Begin Select * Into #tmp From tblTable1 ...
large result sets
Noble Shore -
14 Sep 2006 5:18 PM - 6 messages
I need to return all rows from a table with 50K+ records. The computer that runs this program does not have sufficient resources to run such a large query, although it runs fine with 5K or 10K results. I know ...
How best to create a unique identifier across two or more tables...
Jesse Aufiero -
14 Sep 2006 5:10 PM - 6 messages
I have a table that has an ID column set as an int type with identity set to 'Yes', so that each number that is auto-generated in this column will be unique. However, now I need to add a second table to the database which ...
Win Server 2003 SP2 - SQL2k5 Performance Improvements
tcs -
14 Sep 2006 4:52 PM - 7 messages
I have read that there will be SQL Server 2005 performance improvements in SP2 for Windows 2003. Does anyone know the specifics on what will be improved? Thanks ...
Date Query
FARRUKH -
14 Sep 2006 4:41 PM - 6 messages
i am trying to run the query tht only brings the date. In our database we have a date record like that (1999-05-18 00:00:00.000) Is there any way I run query and only bring date(1999-05-18) not time ...
Small problem with NOT EXISTS...
kollatjorva -
14 Sep 2006 4:28 PM - 1 message
How to use NOT EXiSTS Hi I have one stupid problem, which i've spent way to much time on Hi all I have this table guid datecreated account dateremoved ...
Small problem with NOT EXISTS...
kollatjorva -
14 Sep 2006 4:23 PM - 5 messages
Hi all I have this table guid datecreated account dateremoved 5DC40536 1.8.2006 9574DAAD 30.8.2006 ...
UNDO
catsailor -
14 Sep 2006 3:49 PM - 12 messages
Greetings, I am looking for a way to implement UNDO in my database apps. We have several SQL 2005 Standard Ed and SQL Everywhere database apps. Some are connected to web forms and a few others connect to Windows forms. What I ...
Linked Server Error: Login failed for user NT AUTHORITY\ANONYMOUS LOGON
Jay -
14 Sep 2006 3:24 PM - 4 messages
I have a SQL 2000 instance and a SQL 2005 instance on a 32bit Win 2003 Servers. Both systems are using the same user id & password. Both instances use windows authentication mode. In the SQL Server Enterprise Manager on the SQL 2005 instance I created ...
Converting Rows into columns
Ram -
14 Sep 2006 3:01 PM - 5 messages
Hai, I want to convert from rows to columns. I have a table like this. col0 Day Task ----- ----- ------- 1 Mon Office 1 Mon work ...
Statistic Problem
tho -
14 Sep 2006 2:30 PM - 4 messages
Hi all, I'm searching for a simple sql statistic solution. I have 2 tables: 1st table: website-visits | department ---------------------------------- 5 | A&B CD Z1 30 | A&B AD Z0 ...
Simple SQL query for counts and Sum
Pauljh -
14 Sep 2006 2:19 PM - 2 messages
Hi All, As all the comp.database groups seam to be available for read only (and not post) I'm posting my question here, hopefully someone much better at SQL can help (which isn't saying much my SQL knowledge is ...
Union with the results of two SP
Robert Bravery -
14 Sep 2006 2:08 PM - 7 messages
Hi all, I've been asked the question of one can peform a union with the results of two or more SP's Thanks Robert ...
XP_SENDMAIL Overload in SQL 2005
Dr. Network -
14 Sep 2006 1:51 PM - 8 messages
Not sure whether this is a setup or a programming issue. I tried setup and got no response. I'll try programming. In SQL 2000, I could drop system extended stored procedures without any problem and replace them with my own extended stored procedures or stored ...
Operator on a table that has UDTs and returns a table of UDTs
Andy in S. Jersey -
14 Sep 2006 1:47 PM - 5 messages
This post continues much of the work done in the thread: Subject: UDF that takes a UDT as a parameter (CLR) (Kent has been very helpful) but is a little different I have created a UDT that essentially represents an interval between two ...
how to do this
L.Peter -
14 Sep 2006 1:27 PM - 5 messages
Hi Group, I have been struggling this case for two days but still could not proceduce the desired result. I have student table: studentid studentname 001 student 1 002 student 2 ...
Resetting Identity/Auto-increment Seed
Micus -
14 Sep 2006 1:26 PM - 4 messages
[VS 2005 Pro, SQL 2000] Hi all, I've been using an SQL 2000 database for testing/debugging code. The code is ready for the real world however I would like to purge all content from the database and reset it to a 'new' state. Specifically, a few tables ...
Time recording query
dotnet dude -
14 Sep 2006 1:07 PM - 6 messages
Here is an interesting problem: Lets say I own some imaginary company. Like for all companies, my employees report their time to some time reporting application. Following table stores these time recording activities: EmpId Date Project No_of_hours ...
SSIS package for adwentureWorksDW database
avicentic -
14 Sep 2006 12:57 PM - 2 messages
Is Microsoft published example of SSIS package (or packages) for making adwentureWorksDW database from AdwentureWorks db? Where can I find it? Thanks ...
DTS Newbie Exported Package to VB: How can I tell from the VB if Parallel
iano -
14 Sep 2006 12:55 PM - 1 message
The package I have created runs other packages. I am attempting to run four at a time in parallel. What should I see in the Visual Basic code that indicated that the tasks will be running in parallel? Thanks, IanO ...
Query help.... with CASE
DL account -
14 Sep 2006 12:21 PM - 7 messages
--DDL create table systems ( sysid int primary key, sysnme varchar(30) not null, sysuser varchar(40) null, ) create table software ( swid int primary key, sysid int references systems(sysid), cmpny varchar(30), prod varchar(30) ) go --Data inserts insert systems values(1,'sys1','user1') ...
Aggregate columns in a UNION
Leif S -
14 Sep 2006 12:07 PM - 2 messages
In a sp I aggregate values in a union: SELECT O.operations_code, SUM(ISNULL(OL.operations_duration, 0)) AS Accum FROM dbo.dpr_report R INNER JOIN dbo.dpr_operations_report_line OL ON R.dpr_report_id = OL.dpr_report_id RIGHT OUTER JOIN dbo.vessel_operations_code O ON OL.operations_code_id = ...
Transfer Data From One Database to another Database
Lalit -
14 Sep 2006 11:18 AM - 2 messages
Hi Friends, I have to transfer data from one database to another and some of tabels in both the databases are different in no. of columns and some new tables are added. Some tables are having 1,000,000 records. ...
get autogenerated id after insert
Sam Jost -
14 Sep 2006 10:30 AM - 9 messages
I got a table created something like this: CREATE TABLE dbo.MyTable ( [ID] uniqueidentifier NOT NULL ROWGUIDCOL CONSTRAINT [PK_MyTable] PRIMARY KEY, [...] ) ON [PRIMARY] ALTER TABLE dbo.MyTable ADD CONSTRAINT [DF_MyTable_ID] DEFAULT (newid()) FOR [ID] Now I INSERT a new row, and would like to know the ID SQL Server ...
Help with query...
New to SQL -
14 Sep 2006 10:09 AM - 6 messages
My table is defined as TABLE PERSON id, int Name varchar(500) Table PlacesOfTravel Personid(fk from table PERSON) Place sample data for PERSON 1 Manmohan singh 2 Sonia Gandhi sample data for PlacesOfTravel 1 New Delhi 1 New York ...
sorting problem
aidanc -
14 Sep 2006 8:19 AM - 6 messages
I'm trying to write a query to sort a table by a column containing both numerical and alphabetical values. The values are stored as strings. The problem is that I need to sort numerical values numerically and sort anything with alphabetical characters in it alphabetically. ...
How to get the SP name in the SP?
Cylix -
14 Sep 2006 2:51 AM - 3 messages
I have a sp name "dbo.helloWorld" How can I get the it's name "helloWorld" in the sp? Thank you. ...
SQL Syntax - Incorrect Syntas near '1'
Greg P. -
14 Sep 2006 12:08 AM - 7 messages
I have created an insert statement by concatenation in VS2005 going to SQLSwerver 2005. If i copy the string out of my watch window and run it as a query on my Database it works fine. If I do an execute non-query on it I the ...
T-SQL
CipherTeKST -
13 Sep 2006 11:23 PM - 3 messages
Having trouble using multiple subqueries to pull data from 3 DB's. What I need in the end is the AssocName, Amount, Total1, Total2, Total3... Here is the query... USE DataBase1 SELECT DataBase1.dbo.Users.Name AS AssocName, Count(*) AS Amount, ...
get counts for each unique value in a column
mahalie -
13 Sep 2006 10:59 PM - 5 messages
I'd like to get the count for each of 24 distinct values in a table with 3,200 records in it without having to explicitly query for each of the distinct values. Is there some sort of "short cut" for this, ...
what is the code to see the all the indexes
SQL Ken -
13 Sep 2006 10:47 PM - 4 messages
Hi, what is the sql code to to display all the index and property of a table? Thanks Ken ...
Length too long
tshad -
13 Sep 2006 10:25 PM - 3 messages
I have a stored procedure that works fine. I take the code and move it to Query analyser and I get a message saying my Variable is too long. ******************************************************** Declare @FromDate DateTime, @ToDate DateTime, @Sql VarChar(8000) Select @FromDate = '09-13-06',@ToDate = '09-13-06' ...
Bulk Insert Unix Text files
Skip -
13 Sep 2006 10:25 PM - 2 messages
Hello All, I am trying to import Unix text files into SQL Server 2005. I am having trouble with getting this to work: BULK INSERT MyDB.dbo.MyTable from 'c:\text.txt' WITH (fieldTERMINATOR = ' ',ROWTERMINATOR = '+CHAR(10)+',firstrow=6) Sample Data: ...
Bulk Insert To Temp Table - Security Issue
MG -
13 Sep 2006 9:49 PM - 11 messages
I have a stored procedure that dynamically builds a BULK INSERT command and load data into a temp table. I can run it fine. Of course I am the dbo and sa. The user has BULK Administration rites setup in SQL. ...
UPDATE TOP 1
rzaleski -
13 Sep 2006 9:26 PM - 8 messages
In SQL Server 2005, you can use the following command: UPDATE TOP 1... SQL Server 2000 does not have this feature. Is there a way around this? I tried using a WHERE EXISTS clause, but that didn't work. ...
sql 2005 faster than 2000?
nkw -
13 Sep 2006 9:03 PM - 2 messages
i keep experiencing that complex queries run vastly faster than 2000 (from about 1 hour to 2 minutes, and 2006 server is an old slower server). Does anyone have similar experience? Or could backup/restore (rebuild index, etc...) cause such an improvement? ...
Full-Text Searching
Warren -
13 Sep 2006 8:46 PM - 2 messages
I have installed Full-Text Searching on our SQL Server 2000 server. Question: I have a developer that connects using a local copy of SQL Server EM. But when he wants to add a Full-Text index, etc. The select is grayed ...
Is it possible to trace all statements to a specific table?...
Roz -
13 Sep 2006 8:38 PM - 6 messages
Hello, all. Using SQL 2005. My developers feel their app is slow due to either non-indexed columns that should be indexed, or improperly indexed columns. What I'm wanting to do is trace the workload against this table ...
Any need for TEXT/NTEXT column types in SQL2005
David W -
13 Sep 2006 7:57 PM - 4 messages
We currently have a number of columns that can store a real variety of text length columns - typically 300 to 16000 chars, but possible more. Typically one column per table. In SLQ2000 they were defined as TEXT columns and the ...
Multi Record sets from SProcs
rmg66 -
13 Sep 2006 7:43 PM - 2 messages
SQL SERVER 2000 I have a stored procedure that returns multiple recordsets (all the same colums, datatypes etc...). I need to evaluate the data in each record set. I attempted to insert the results of the stored procedure into a temp table. ...
Deleting a record dynamically
Michel Racicot -
13 Sep 2006 7:29 PM - 8 messages
Hi there... I have some tables and their copy: RHUM010P and ##RHUM010P_Inserted which is basically a copy of the inserted record in RHUM010P Now, for each record in ##RHUM010P I need to delete each and every records who are presents in ##RHUM010P_Inserted ...
Errors
FARRUKH -
13 Sep 2006 7:08 PM - 2 messages
I am getting these errors in my SQL Error log. I read through some articles about changing a registry setting but I don't know what the repurcussions of doing that would be. Can you please let me know what I need to do to stop ...
Select Right From A Specific Character
Anonymous -
13 Sep 2006 7:06 PM - 4 messages
I want to select the characters to the right of a dash and convert it to an int so I can compare records in SQL 2000. MDL-1553-AandB-083630 MDL-1553-AandB-498103 MDL-1553-AndB-00060 Would return either ...
What am I missing with this simple query?
MarkT -
13 Sep 2006 6:35 PM - 13 messages
I am trying to add the results of this query to a new table using the procedure below: INSERT into db.TempCheckHistGN (EmpID,GrossPay,NetPay) SELECT EmployeeID, SUM(GrossPay), as Expr1, Sum(NetPay) as Expr2 FROM dbo.tblPACheckHist WHERE (CheckDate Between '11/1/2005' AND '12/31/2010') AND (EmployeeID >='' ...
Passing username to sql server from an app
JimLad -
13 Sep 2006 4:57 PM - 9 messages
Hi, I have an ASP/ASP.NET app that is connecting to SQL Server 2000 with login 'APP'. Users are logging into the app using Windows Authentication. What is the most generic way of passing the username through to sql ...
Updategrams and Application Roles
JimLad -
13 Sep 2006 4:46 PM - 1 message
Hi, Does anyone know if you can use an Application Role with an updategram? On a virtual directory. If so, how? Cheers, James ...
|
|||||||||||||||||||||||