Hi,
I have a table with something like:
MemberID[tab][tab]EffDate[tab][tab]TermDate
-----------------------------------------------
1[tab][tab][tab][tab]12/01/2018[tab][tab]12/31/2018
1[tab][tab][tab][tab]4/01/2019[tab][tab]5/31/2019
1[tab][tab][tab][tab]7/01/2019[tab][tab]12/31/2019
I want...
We have some database that like span different states.
We have code for a stored procedure and that stored procedure resides in a Stage database on the same server so a linked server is not necessary.
CREATE PROCEDURE dbo.TestA
(@StateID CHAR(2))
AS
BEGIN
SET NOCOUNT ON
UPDATE...
Hi,
In SQL Server 2008 R2 and up, is it a performance issue if in a stored procedure a temp table is created, then loaded, then an index created on it?
Or should it create that a temp table is created, an index created on that temp table and then loaded?
Also, if it not true that IF after...
Hi,
Is there a way or command to use to get the DDL's to a file for each DB artifact in a SQL Server database?
So, for instance, if there are 3 stored procedures in a database: I want the DLL for each stored procedure to go into it's own unique file:
stored procedure 1 name is Test1. All...
Hi all,
I'm having a little bit of difficult and hopefully somebody can help me out here.
I have a table like:
GUID, TESTID, TESTDATE, TESTTYPE, TESTTYPEID
Now what I want to do is I know there are multiple rows with the same TESTID for the same TESTTYPEID.
So, I am trying to get an...
I have a question with regard to temporary tables and a usp_Test1 stored procedure (SP). This is related to a SQL Server 2000. (Yes, I know it's older technology but it is what it is.)
I'm looking a situation:
• On a website, when a User or whomever requests a “Click Here”
• The above SP is...
Hi all,
How can I split information on a comma and put use for an IN statement?
For example, I want to exclude certain states. Now, I want to take the variable that is passed in and put it in a temporary table then use the temporary table in a NOT IN (select * from #States) statement.
How...
Hi all,
What is the best way to limit like the number of users per U.S. state to 5 or less?
Let's say that I have a table where I have like:
User State
---------------
test1 AL
test2 AL
test3 CO
test4 AL
test5 CO
test6 CO
test7 CO
test8 AL
test10 CO
test11 CO...
Hi all,
Is there a way to do something like:
DECLARE @TestID varchar(10),
@LastName varchar(70),
@FirstName varchar(30),
@MiddleName varchar(25),
@BirthDate datetime,
@SSN varchar(9),
@Address varchar(100),
@State char(2),
@Zip varchar(6)
SELECT...
All,
Other than logical grouping - what is the value of inserting a column in the middle of a table?
For instance:
Col1: FirstName
Col2: LastName
Col3: DOB
Col4: SSN
If I wanted to add a column for MiddleName, the logical grouping to have the FirstName, MiddleName and LastName would be...
Hi all,
I have a question that you may have some information for...
What is the best way to take an existing in-depth XML based application that stored the entire XML in a database but also stores each of one the nodes in the the database tables as well.
So basically (a very simplistic and...
Hi all,
I have a question that I hope that you may be able to assist with.
I have a stored procedure and in it over 52 SELECT statements are executed but each SELECT uses the table value in the WHERE clause.
for instance:
SELECT a.CheckID, a.test1, a.test2, a.test3 from Test1 a where...
Hi all,
Hopefully somebody can help me with this but basically I have a stored procedure that I'm trying to speed up a little bit. This with SQL Server 2005. Right now, it's running 45 seconds in situation #1. In situation #2, it's running about 44 seconds.
Situation #1:
1) Create temporary...
Hi all,
I'm not getting this one entirely.
I have a script that creates a temporary table and inserts into it from another select.
Then I select everything from the temporary table. I have an aggregate function (SUM) included which is why I am selecting from the temp table at the end.
I...
Hi all,
I have a question that may be able to be resolve here and greatly appreciate any information. It involves SQL Server 2005.
I have a stored procedure that runs ok considering the volume of data that I am dealing with. However, I did a query plan on it and it showed an area that had a...
Hi,
This is a little interesting to try and explain...
What I am trying to do is run a query... but what I'm finding is that on under some conditions an INNER join on soem tables are necessary.
However, on other conditions WHERE the USE of the tables are NOT applicable it will not return...
Hi,
Any help would be greatly appreciated on this. I'm running out of ideas...
I will try my best to explain the situation.
I have a user that logs in then is USER E.
I have a table that has a reference to LOC A and LOC B but like A and B ID's. These LOC's are stored in another table.
The...
All,
What is the best or recommended approach for check to see if values are present in one or more different database tables? With one key element, I believe anyway and that is there may be some items based on certain criteria that are in both.
For instance, I have database TEST with table...
All,
I have a question that any assistance with on direction would be greatly appreciated.
What I have is in one database table I have a list of patients and in another database table I have a list of patients. What I want to do is create a return of a dataset that includes only the unique...
Hi all,
I have a question that maybe someone can provide some information on.
I have a stored procedure that has a cursor (loop #1) and that iteration calls another stored procedure and that stored procedure also has a cursor (loop #2). Now, these cursors are NOT used with a large amount of...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.