Quantcast
Viewing all articles
Browse latest Browse all 3160

The SQL Server gets DateTime Date in the selection query

SQL Server 2008 + performance issues for a select query with over 100,000 data

I have 20 columns in Sample table. It has one foreign key relationship (DID). It has 8 joins with other tables to retrieve the required data. In that we have 2 UDf fns to calculate avg and data conversions on 4 selected columns. My main issues is dai

SQL Server: How to Use XPATH in Selection Query

I have a table in SQL Server which has a column with XML data type. For example, one value looks like <doc> <q></q> <p1> <p2 dd="ert" ji="pp"> <p3>1</p3> <p3>2</p3> <p3>XYZ<

SQL Server CDC (change data capture) is used only for changing table data? Can I use it to follow the procedure or other types of object changes?

SQL Server CDC(change data capture) is used just for table data change? Can I use it to track procedure or other types of objects change? BTW, are there some companies using CDC in their production? Thanks.As the name says it captures DATA change - a

Generate a script in SQL Server 2005 with data

How can I generate a script in SQL Server 2005 with data in table?Unfortunately the options to script data along with schema didn't seem to appear until SQL Server 2008, so I think you're stuck with third party options. SSMS Tool Pack has a generate

How to increment the sql counter in the selection query

i want create a column 'counter' which will increase count whenever we run the select statement. Suppose when i run the select query today. My output will be like below. name | employeeid | counter raj 123 1 steve 124 1 brad 125 1 Tomorrow when i run

Divide the data from the selected query and pass it to the temporary table

I have a scenario where I'm creating a temp table with the data coming in from a select statement. My problem is when the data coming in from the select query is huge, I'm running into insufficient memory problems which results in my query failing to

How to detect if the date changes in the selection query

This question already has an answer here: Display mysql results by date 5 answers I'm using the following SQL query to select rows from through an inner join sorted by the date. SELECT * FROM clubnights INNER JOIN club ON clubnights.club = club.club_

Problem when calling a PLSQL function in the selected query when the function returns a nested table

I've a plsql function which I'm calling in my select query something like this: select TEST_PKG.GET_VAL(db.id) as value from test_table db where (some condition lets say) db.id>11 plsql function returns an nested table of type number. eg : type test_

MySQL inserts multiple rows based on the result of the SELECT query

I have a MySQL query like this: SELECT cp.plan_name, cp.plan_time FROM courses c INNER JOIN course_to_plan cpl ON cpl.course_id = c.course_id INNER JOIN courseplans cp ON cp.plan_id = cpl.plan_id WHERE cpl.course_id = '$course_id'; This will output d

The selection query that I use does not work. Can someone guide me correctly? I am using the Select query as SELECT id, ordering FROM `jos_menu` WHERE ordering='".$rec['ordering'] -'1' ."' AND parent = '0' Here I need all the records whose ordering is less than 1 of the selected record's order($rec['ordering'] = getting f Optimize the selection query I am using SQL 2000, and I am running a simple select statement on a table containing about 30 million rows. The select query looks like: select col1, col2, col3 from Table1 where[emailprotected] and[emailprotected] and[emailprotected] The table has a clustered ind What is the use of checking num_rows before while the loop after the SELECT query?

In many scripts, programmers check if the SELECT query has returned any record before running the corresponding while loop as $result=mysql_query("SELECT * From table WHERE column='XX'"); if(mysql_num_rows($result)>0) { while($row=mysql_fetch

The SELECT query does not return in the desired order I want to have the SELECTed query return in order by Number. This is currently what is being returned: And here is the current query: SELECT [Number] + ' - ' + SUBSTRING([Title], 1, 40) AS [StoryName] ,[PK_Story] FROM Story STY INNER JOIN Task TSK ON How to convert the datetime string without delimiters in SQL Server as a date-date?

I am looking to convert a string like this: 20160520191959550 - that is actually date-time for 2016-05-20 19:19:59. I tried using CAST as datetime in a SQL statement, but got this error: Conversion failed when converting date and/or time from charact


Viewing all articles
Browse latest Browse all 3160

Trending Articles