All Questions
Tagged with sql-server-2005 sql-server-2008-r2
215
questions
-4
votes
1
answer
52
views
How to transform Rows into Column Sql Server [duplicate]
How to transform Rows into Columns for the below table data in SQL serer
Actual table
LabelID | LabelName
---------------------
1 | Label1
2 | Label2
3 | Label3
4 | ...
0
votes
0
answers
275
views
Can I use metadata to verify if a Primary Key and a Foreign Key values are valid?
I'm learning SQL and I'm doing some exercises, and I built a procedure that receives as parameters, values that will be inserted into a specific table, once the procedure is executed.
But I need to ...
0
votes
1
answer
602
views
Output inserted row from CTE
I have a CTE and I need to populate that CTE with the row that has been inserted.
I tried using temp table.
I am not sure how to create temp table within CTE and fill CTE.
This is what I have ...
0
votes
1
answer
72
views
How can I pass ']' in to patindex for pattern which contains '%[ ]%'. For eg. PatIndex('%[ ] ]%')
I want to remove '[' and ']' using PatIndex.
My code is..
@String = 'Hello[ W]orld'
@MatchPattern = '[]'
@MatchPattern = '%[+@MatchPattern+]%'
Set @ String = Stuff(@String, PatIndex(@MatchExpression,...
1
vote
1
answer
875
views
BCP in sql server with select query
i want to take the data from select query to txt or csv formate with comma separated in sql server 2008
0
votes
0
answers
778
views
How can I read XML from URL using SQL Server
I created below function to retrieve data from XML. I want to get formatted_address from the generated XML. How to get required result? I got NULL value. I want to get required result only using ...
0
votes
0
answers
67
views
Performance issue on the Simple SQL delete query
Today i came across with one Performance issue with simple delete query.
I have two tables
Table Name : Attribute
Column List : AttributeId Char(15), Desc Varchar(50)
This Attribute table ...
1
vote
1
answer
2k
views
SQL Server - Command Line utility for exporting and importing of entire database
I am looking for a command line utility to export and import an entire SQL Server database. I am looking to automate the process of moving data from source database to destination database given the ...
0
votes
2
answers
2k
views
Inserting multiple rows in temp table without loop
This question has already been asked several times but the solution is not working for me. I don't know why.
Actually i am trying to create a temp table in sql query where i am inserting some records ...
2
votes
1
answer
95
views
Bio-Metric device record
Hi i have get data from bio-metric device like :-
|Id |EmpCode | WorkDate |InOutMode
|247 |51 | 2017-02-13 20:08:52.000 |0
|392 |51 | ...
1
vote
1
answer
110
views
Attendance record from bio-metric device
Here is my data
|Id |EmpCode |CheckInCheckOutDate |WorkDate |InOutMode
|247 |51 |2017-02-13 20:08:52.000 |2017-02-13 20:08:52.000 |0
|392 ...
1
vote
3
answers
1k
views
Get Min In time and Max out TIme. Fom Attendance record in Sql Server
I am working on attendance system, and below is my data in sql server database
|EmpCode|Date |WorkDate |CheckIn |CheckOut |TotalTime
|143 |2017-02-13 |2017-02-13 |20:09:02 |22:38:...
0
votes
1
answer
336
views
How to retrieve older version of Procedure after database Restore
i created new procedure xyz in DB ABC. accidently someone restore that DB ABC with some other DB backup LMN. now i search for same procedure XYZ it doesn't exist.
Is there some to get that SP xyz ...
0
votes
4
answers
270
views
SQL - Converting String to Date and Time
I need to convert a value to a SQL Server DateTime.
Data looks like below :
20161021-12:55:16.000
20161021-13:22:09.974
I tried
CONVERT(DATE, '20161021-12:55:16.000', 102)
and it throws an ...
20
votes
3
answers
76k
views
How to check blocking queries in SQL Server
I have one warehouse server which got data/sync from legacy system 24/7, I noticed some of my reports/sql jobs performance is uncertain and most of the time I heard from DBA team that my query is ...