First  |  Prev |  Next  |  Last
Pages: 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
Using RETURN
I'm trying to RETURN an integer variable called @iReturnCode after comparing 2 columns from 2 different tables after comparing the columns. I'm not real familiar with using RETURN for this type of purpose. If the 2 columns aren't equal, I'd like to RETURN a 1, if they are equal, just RETURN 0. Can some shed so... 22 Jul 2008 22:58
CTE and DDL
Hello all, I am trying to create a staging table using CREATE TABLE statement on a file group with the file group name decided at the exectution time. Is there any way, I can supply the file group name in the form of variable or using CTE when I create the table using CREATE TABLE statement in a stored procedu... 22 Jul 2008 15:47
Database is in Transistion. There is already an open datareader associated with this data
SQL 2005. I tried to take a DB offline but it just never came back. I now just want to detach and/or delete it it.. but get error: "There is already an open datareader associated with this Data" What's the best way to remove connections from a DB from the command line. How can I now remote that open dat... 22 Jul 2008 15:47
Selecting from a table where my unique Key is not their uniquekey.
Mufasa, In SQL Server 2005, it's not hard: with T as ( select *, row_number() over ( partition by your_unique_key order by their_unique_key ) as occurence from theTable ) select <columns you want> from T where occurence = 1 This selects the first occurrence in their-key order of ... 22 Jul 2008 14:45
how to use SUM [RESOLVED]
"Plamen Ratchev" <Plamen(a)SQLStudio.com> wrote in message news:84888042-E96A-4F84-AA4D-62240AB49ED8(a)microsoft.com... Add WITH ROLLUP after the GROUP BY clause and it will add the summary row. In the SELECT list you can use the GROUPING function to check if the row has been added by ROLLUP and replace NULL w... 22 Jul 2008 14:45
Remove word from end of string
Using SQL 2000 and 2005 servers We have a view that pulls the proj_name from the MS Project server. It sometimes includes .Published at the end of the name. Is there a way to trim a specific value from the end of the string? Thanks, littleccguy ... 22 Jul 2008 14:45
Selecting from a table where my unique Key is not their unique key.
I've got a list of customers, customer names, ... from another db (I didn't design it). I want to get a list of all of the customers plus the first customer name. So if customer 1 appears twice (customer name = 'Fred' and 'John') I want the first one it finds. Is there an easy way to do this without spinnin... 22 Jul 2008 13:43
Procedure to insert into multiple tables
Hello All, I have 3 tables solset with columns solset_ID and Solset name Solsubset solsubset_id, subset name subset_link subset_link_id, solset_id(from solset), solsubset_id(solsubset) I am trying to write an insert statement for the solsubset table and one for subset_link. my in... 22 Jul 2008 15:47
Using single character wildcards in stored procedure and allow a %
We have a search form with multiple fields for searching. I've simplified the stored procedure below to only show a couple of fields and parameters. The users can search using the ? or _ for single character searches by entering them in the form. However, they also want to be able to use the wildcard % to use... 22 Jul 2008 17:50
Database Engine Tuning Advisor
Hi, When I use "Database Engine Tuning Advisor" to analyze my stored procedure, it recommends that I drop all related indexes (that I believe they are useful) and add so many statistics. I wonder how accurate is "Database Engine Tuning Advisor"? Are its recommendations something that I should always trust? ... 22 Jul 2008 15:47
First  |  Prev |  Next  |  Last
Pages: 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176