Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: jararaca
  • Content: Threads
  • Order by date
  1. jararaca

    How do Rules work?

    Hi-- I routinely create constraints in my database tables, e.g., EndDate >= StartDate, etc. But I don't know of a way to create a constraint that works across tables. For example, let's say I have a 1:Many relationship between these two tables: Admission(AdmitID (PK), AdmitDate,...)...
  2. jararaca

    Virtual table?

    Is there a way to create a virtual table in a stored procedure that holds the results of a call to another stored procedure? In other words, say I have sp1. Can I do something like this in sp2: VirtualTable = EXEC(sp1 param1, param2) SELECT<field list> FROM VirtualTable If so, what is the...
  3. jararaca

    Calculation that spans rows (probably non-aggregate)

    Hi, I have a table with a column called AdmitDate and I need to know how many rows in that table have AdmitDates that are within 30 days of the AdmitDate of the previous row. I'm stumped about how to write such a query, or if it is even possible to do so. Can anyone please help? thanks
  4. jararaca

    Heterogeneous queries

    Hi, I'm trying to create a query in a database on one SQL Server that refers to a database on another SQL server. Even though the other Server is listed properly under "Security/Linked Servers," and all user permissions are correct, when I try to save the query, I get this error: "Error 7405...
  5. jararaca

    Parameter data type problem

    Hi-- I've got the following sp (not sure how to demark code in this forum): ======================================================= CREATE PROCEDURE dbo.UP_Get_Program @PACEId INT AS DECLARE @Program VARCHAR(7) SET @Program = (SELECT Program FROM...
  6. jararaca

    ALTER TABLE to add column with nulls

    How do I use ALTER TABLE to add a column that allows nulls? Thank you!
  7. jararaca

    Ref integrity constraint for tables in diff db

    How, if it is possible, does one set up a foreign key in one table to point to a primary key in a table that's in another database (same server)? Thanks.
  8. jararaca

    Short Circuit?

    When you use an OR, will SQL Server evaluate the left part before it determines it is necessary to evaluate the right part? You know what I mean? For example: a = 1 or b = 2 If a = 1, it's not necessary to evaluate the b = 2 part. Is SQL Server smart enough to figure this kind of thing out...
  9. jararaca

    How to access dbs on different serves

    Hi, How do I refer to a database on a different SQL Server from inside a view or stored procedure? Both servers are registered in MMC (or Enterprise Manager). Thank you!
  10. jararaca

    Get view timestamp?

    Does anyone know of a way to get the date and time that a view was last changed? I've tried looking in the sysobjects table, but it doesn't seem to be there... Thanks
  11. jararaca

    Simple date question

    Hi-- I need to update all rows in a table that have a date in a datetime field that comes after a certain date. I'm not sure how to write that. ... WHERE DateTimeColumn >= '9/1/2005' I must need to convert the string value at the end of this WHERE clause to an actual datetime? Can someone...
  12. jararaca

    Modular stored procedure?

    Hi, I have two queries that are almost alike. The difference is that one makes a few additional joins and projects a few additional columns from those additional joins. I'd like to avoid the duplication in the parts where they are alike. I thought of making a view of the common part, then...
  13. jararaca

    Scheduling DTS Packages

    Hi-- I am scheduling a DTS package by right-clicking on it then clicking on Schedule Package... If, after I schedule a package, I right-click on it again to see how it was scheduled, I see the default screen without the scheduling info I had entered. Can anyone please help me understand how...
  14. jararaca

    Copying DTS package

    Hi, Is there a way to copy a DTS package from one database to another (on different SQL Servers, both of which are registered in Enterprise Manager)? Thank you.
  15. jararaca

    How to identify age from date

    Hi, I have a table with a smalldatetime column. I need to identify all records in that table that have dates in that column that are six months old or older. Can someone please tell me how I might do this? Thank you.
  16. jararaca

    Dynamic query?

    Hi, I have a stored procedure that resembles the following structure: SELECT projectionA FROM TableA JOIN (SELECT projectionB FROM TableB UNION SELECT projectionC FROM TableC) RIGHT JOIN TableD The issue is this: On some...
  17. jararaca

    Reporting Services: Keep group together?

    Does anyone know how to tell reporting services that a group is not supposed to break from one page to another? I've looked in "Edit Group," and elsewhere and can't find anything. Thank you.
  18. jararaca

    Copy table to other server?

    Is there an easy way to copy a table from a database on one SQL Server to a database on another SQL Server? The SQL Servers are within one SQL Server Group in MMC. Also, the table does not exist at the target. I'm hoping for some command or interface (GUI?) that will create a new table at the...
  19. jararaca

    Join in Insert?

    Hi, I have a table with an empty field that needs to be populated with data from a related table. In other words, if I do a join between this table and the related table, the value I need to populate the empty field with would be on the same row as the row that needs to be populated. I'm not...
  20. jararaca

    Basic IF question

    I have a stored procedure that needs to refer to one of two tables depending on the value of a parameter. Here's what I know and don't know how to do: DECLARE @ThisQuery varchar(8000) SET @ThisQuery = 'Select * ' SET @ThisQuery = @ThisQuery + 'FROM ' (Here, I need to be able to append...

Part and Inventory Search

Back
Top