Tagged Questions
SQL Server is a relational database management system from Microsoft. Use this tag for all SQL Server editions including Compact, Express, Azure, FastTrack and PDW.
1
vote
0answers
6 views
select Has_Perms_By_Name(N'dbo.xyz', 'Object', 'ALTER') as ALT_Per, Has_Perms_By_Name(N'dbo.xyz', 'Object', 'VIEW DEFINITION') as View_def_Per,
We keep the changes of the sql server tables as script in TFS. When i get a change script from SMSS, there is some line at the bottom of the script. Which is;
select ...
0
votes
3answers
25 views
Distinct Value of a column in sql server 2008
Hello all I have made a query using left outer joins which result in some what like the table below:
| 00-00-00-00-00 | 1 | a.txt |
| 00-00-00-00-00 | 2 | b.txt |
| 00-00-00-00-00 | 1 | c.txt |
| ...
0
votes
1answer
18 views
Finding more than one Min and Max within Dynamic Range
I am getting a result as shown in image.
I am getting 2 range of values
1)from 79996 to 80000
2)from 001001 to 001003
So, i want 2 minimum values 79996 and 001001 and 2 max values 80000 and ...
0
votes
0answers
22 views
PHP-MSSQL - Running complex SQL script in PHP with MSSQL database
I'm trying to run a rather complex SQL script that works great in SQL Manager.
After a few hurdles to get my php server to connect to MSSQL, simple scripts (selects) work however this script I'm ...
1
vote
0answers
23 views
Ignore records with date range
Trying to build the recurring event system based on Display next event date and the SQL Fiddle
It works well. I tried integrating the leaves plan with the repeating events in the calander to filter ...
0
votes
0answers
21 views
SQL DB copy - server to server
I have copied over a database from SERVER 1 to SERVER 2.
All users and necessary security has been copied over.
However when I try and point the online system that uses the database to SERVER 2 ...
0
votes
1answer
19 views
How to add new data columns of old time in SQL Query?
I have this query : http://pastebin.com/JNx1hX1i
I want to add new 2 column to my query.OldLat(Lat of 5 minutes ago),OldLat(Lng of 5 minutes ago)
Result is like this
LatOfTruck LngOfTruck ...
0
votes
0answers
8 views
SSRS Change textbox color depending on the time
I am trying to change the color of a textbox depending on the time in the box. so if the time is over 5minutes then the box is to turnred, if it is less then 5 then it is to be transparent.
the ...
1
vote
3answers
41 views
add column dynamically with select query
I have one table which has 20 columns default
These 20 columns named as D1 D2 D3...D20 ,
now with select query i want to add the other columns dynamically.. for ex D21 D22...D31,
so how can i write ...
1
vote
0answers
26 views
Why is SQL cast expensive?
I was wondering what is the background explanation for this? I see from testing examples that casting is very time consuming but I don't realize why since I don't know mechanics in behind, and I would ...
0
votes
2answers
24 views
how to strip all html tags and special characters from string using sql server
I work as asp.net developer using C#, I receive text like this from the client:
> <p><a
> href="http://www.vogue.co.uk/person/kate-winslet">KATE
...
0
votes
1answer
17 views
MS SQL retrieve related data from same table in one query
I have a table called mc.staff which in its simplest form is
id | name | supervisorId
I need a query which will pull out the id and name of a person, but also the id and name of their ...
0
votes
1answer
17 views
Arithmetic overflow error converting varchar to data type numeric in stored procedure
I'm getting a Arithmetic overflow error converting varchar to data type numeric. In my stored
procedure although only when it has to make the calculations. Here is my code, I'm using a convert still ...
0
votes
0answers
7 views
Strange results of Indexing services
Once again I am asking a question on Indexing services as I am not getting answer from last 5 days. Currently I am working on Indexing services to search document from Windows server. I am using ...
-1
votes
1answer
26 views
How to call stored procedure with output parameter @@Identity from java
I created a stored procedure which inserts a new order in the NewOrder table and also updates the OrderedProduct table with the new information of the order. I am using @@IDENTITY to get the OrderID ...