Ross Linfoot replied Dec 24, 2007 to remove the TEST when you use database command - could you run the stored procedures by calling them with a full name - ie if the sp is in the TEST database called PROC1, then from the top level run EXEC TEST.dbo.PROC1 args, that way you will not need to change database. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy
sql server - Combine column from multiple rows into single row - Database Administrators Stack Exchange
CLR function will be reusable in other queries, and you won't have to duplicate (and debug) a complex subquery every time you need to do this type of thing. EDIT: Well, I went to try to see if this actually was better, and it turns out the requirement that the comments be in a specific order is currently not possible to satisfy using an aggregate function
If you are going to do a lot of updating and it will be rare that the record does not exist, it is going to be best to try updating first and if no records are updated, insert one. hi,Actually I want a sql statement to update evary 10000 rows of a record....for eg...if a record consists of 30000 rows.....we created a new column in that record.....in that column we want to place the value 1 for first 10000 rows and the value 2 for next 10000 rows and the value 3 for next rows....and so on.....i.e., the value should be incremented by 1 for every 10000 rows....please help in this as quickly as possible...
1-How many number of column in that table? 2-How many number of records to recover? 3-How many records do you have in the log? Normally, it takes few seconds per record. on September 14, 2012 at 2:36 pm Muhammad Imran Hi Sandeep, How many records did u try to recover? Can you please post the test table and records as well
The final output will be like in the following figure:Step 1:First of all create three tables, Country, State, and City with the following specification and some data like above.Step 2:Create a new ASP.NET Web Application
let's just copy what packages I have So in the short term if you are not prepared to upgrade all your DTS packages to SSIS, the question is how to move your DTS 2000 package and leave them in the old legacy format and continue to run them, in case that you may not have time to immediately upgrade your packages and test them out. To my suprise, there wasn't much official documentation on the subject, and didn't seem to be any wizard to help accomplish the goal, so its time to get creative..
Create Calculations in PowerPivot Once the data has been set up correctly, it is easy to create calculations that represent key decision factors such as the sales margin per bundle, and the sales for each model or product. Although it is true that the PowerPivot relational store is based on a highly specialized and optimized version of the Analysis Services engine, the PowerPivot for Excel client does not support many operations that are possible with traditional cubes, including data mining and certain kinds of queries and processing
sql server - How to efficiently check EXISTS on multiple columns? - Database Administrators Stack Exchange
Single Aggregate Query SELECT MAX(CASE WHEN B IS NULL THEN 1 ELSE 0 END) AS B, MAX(CASE WHEN C IS NULL THEN 1 ELSE 0 END) AS C FROM T This could process both columns at the same time so have a worst case of one full scan. SELECT TOP 2 * FROM (SELECT DISTINCT CASE WHEN b IS NULL THEN NULL ELSE 'foo' END AS b , CASE WHEN c IS NULL THEN NULL ELSE 'bar' END AS c FROM test T WHERE LEFT(b,1) + LEFT(c,1) IS NULL ) AS DT Edit 2 One last tweak that occurred to me is that the query above could still end up processing more rows than necessary in the event that the first row it encounters with a NULL has NULLs in both column B and C
Is there a query to retrieve the partition ranges? In my example I am expecting to see the list of current partition ranges like Jan2011, Feb2011 Thanks. USE TestDB; GO --- Step 6 : Insert Data in Partitioned Table INSERT INTO TestTable (ID, Date) -- Inserted in Partition 1 VALUES (1,GETDATE()); INSERT INTO TestTable (ID, Date) -- Inserted in Partition 2 VALUES (11,GETDATE()); INSERT INTO TestTable (ID, Date) -- Inserted in Partition 2 VALUES (12,GETDATE()); GO Step 7 : Test Data from TestTable Query TestTable and see the values inserted in TestTable
Fill in your details below or click an icon to log in: Email (required) (Address never made public) Name (required) Website You are commenting using your WordPress.com account
I've tried this code, to no avail: DECLARE @blah TABLE ( ID INT NOT NULL PRIMARY KEY, Name VARCHAR(100) NOT NULL ) INSERT INTO @blah (ID, Name) VALUES (123, 'Timmy') VALUES (124, 'Jonny') VALUES (125, 'Sally') SELECT * FROM @blah I'm getting Incorrect syntax near the keyword 'VALUES'. please, someone who has done this before, help me out :) INSERT INTO dbo.MyTable (ID, Name) VALUES (123, 'Timmy'), (124, 'Jonny'), (125, 'Sally') I know that this is close to the right syntax
No comments:
Post a Comment