SQL: Partitian Over Challenge.
Techies-- I want to retrieve a result set that returns the beginning effective data and end effective date for an id with multiple supplier associations. To do this, I am looking at a transaction table...
View Articlecheck for sql server job success using code
i would like to execute a sql server job based on the sucess of three other sql server jobs,these 3 other jobs neeed to execute in parallel, after success of three jobs which shud run in parallel, i...
View ArticleSQL Agent VS Linked Server
I have setup SQL Agent Job to run store procedures. I have linked server connection for source. When i run job i m getting following error. "Invalid connection string attribute". [SQLSTATE 01000]...
View ArticleWho wrote this Article on SQL Server best practices
I saw an article on SQL Server Best Practices. This article reported When possible, use WHERE clauses that compare a column to a value. Example: WHERE SUBSTRING(firstname,1,1) = 'm' can be rewritten...
View ArticleROW_NUMBER OVER....WITHOUT PARTITION OPTION in sql server 2008 R2
Please, how to use "ORDER BY" clause if it is necessary to perform sorting on e.g., three levels e.g., LastName, FirstName and ParentsName?Namely, if I use this syntax Row_Number() Over (Order By...
View ArticleTransact SQL XML output
I am fairly new to XML and have been doing some research.I need to be able to create the following XML output from a couple of SQL tablesTable 1Fielda (primary key)FieldbFieldcTableFieldD (foreign...
View ArticleSql Query
In a "many to many" relationship I create a "intermediate" table to control the "many" side of the tables. In my design I have the "action" table and the "condition" table. And "many" actions can have...
View ArticleMinimum period of a category between category changes
Hi.I have the following dataset in tempoary memory which shows how a id moves between differenent categories over a period of time. The first view (A) shows what i'm working with. View (B) is my...
View Articlehelp with a query?
i have two tables 1st table has id,name2nd tables has ipaddressfor ex:tableID -ID Primary Key tableIPAddress--Forign key tableID on Colum ID-------------...
View Articleproblem getting desired crosstab/pivot result using case when ...
Using the following test data (sql Server 2008 express) and the following tsq to pivot the data to get the count of sessions per group, but my tsql is not putting the results on the same line for each...
View Articlecomparing rows and give the change
saving greetings to everyone! i m receiving a dump data at day 1, inserting all that data into a database. this database has about 30 above tables, each and every table has about 100 above rows. every...
View Articlehanging remote SQL query
Hi ,I have a remote query connecting via linked server and suddenly after alter the SP has this update syntax the SP start hanging with no respond for hours...the process hang on the remote server...
View ArticleSQL FIFO Query
Hello all;Like others, I need help developing a SQL query to determine A FIFO Cost for parts. I'll make mine easier that others I have read in this forum by limiting it to one table.I have an Inventory...
View ArticleGet average days using datediff
hi guys, I have a requirements to sum up the qty and at the same time get the number of days at the same time get the aveerage days.I have already the query but could not get the exact...
View ArticleCan I call a Sql scalar-valued function within a store procedure
I am using Sql 2000. I have the actual Sql function name stored in a table. In a "Select" statement on that table, can I call that function and passing on the parameter and return with a value from...
View ArticleDoes BEGIN DISTRIBUTED TRANSACTION affect the @@TRANCOUNT ?
Does BEGIN DISTRIBUTED TRANSACTION affect the @@TRANCOUNT ?
View ArticleHomework SQL Question
Write one or more SQL statements to insert the following as a single transaction:Trip:Departure date: 14-JAN-2013Return date: 15-JAN-2013Vehicle id: 201Employee No:...
View ArticleWhich SSIS 2008R2 BIDS transform(s) appropriate to create multiple...
I don't know whether to use some combination of data flow transformations or resort instead to a Script Component to accomplish my goal. I am receiving electric usage odometer-type meter readings,...
View ArticleTable partition on identity column
Hello All,I have table which are having like 5millions records in it. I would like to do table partition in order to increase performance. Can anyone please let me know how to do partition on identity...
View ArticleQuerying Active Directories Issue
While I am familiar with SQL, I am having trouble retrieving data from Active Directories. I have followed all the instructions to create a linked server, I have set the security per the...
View Article