I've written a function to coalesce mutliple rows into one:
ALTER FUNCTION [dbo].[CombineRepNames]
(
@CustomerNumber varchar(50)
)
RETURNS varchar(1000)
AS
BEGIN
DECLARE @VAR varchar(1000)
set @VAR = ''
SELECT @VAR = coalesce(@VAR + ' , ','') + name
FROM valignmentmaster
WHERE...
I have a query that uses a sub query in the select statement. Example:
Select * from
(select * from tablea union select * from tableb)
I know that access will randomly remove your parenthesis in these examples and turn them into brackets. This has apparently happened to me and now I can't...
I have some data that looks like:
Date GroupA GroupB Units
10/8/2009 ABC AAA 100
10/8/2009 DEF BBB 150
10/8/2009 GHI CCC 90
10/9/2009 ABC AAA 105
10/9/2009 DEF BBB 155
10/9/2009 GHI CCC 95
I want to create a running total by group and by date. So the data would look like this:
Date GroupA...
I have some data that looks like this:
region_code city zip
AAA Houston 77076
AAA Houston 77024
AAB Houston 77024
The region_code is entered manually by a multitude of different people. It should always be the same thing for each city, but some times it gets messed up.
I am...
I have some data that looks like this:
region_code city zip
AAA Houston 77076
AAA Houston 77024
AAB Houston 77024
The region_code is entered manually by a multitude of different people. It should always be the same thing for each city, but some times it gets messed up.
I am...
Is there a way to determine database size in bytes through query analyzer? I need to determine how many gigabytes of data a database I have is, but I do not have dbo rights, so I can not view the size in enterprise manager.
I can't get my head around to parse this data. I've got a column that contains dirty regional data stored as text. I want to split it up so I can make it clean.
examples:
World|USA|New York|New York City|Manhattan|Central Park North
World|USA|New York|Hamptons|Bridgehampton...
SHOW TABLE STATUS FROM your_db_name [like 'tabe_name']
Will give me average row sizes, but let's say I needed an exact size for each row. What would be the method to select the size of a specific row?
I have a group of files I want to extract specific cells from and place into a single spreadsheet.
For example one of the files name is 20071022.csv.
So I can put the following =20071022.csv!$A$3 into a cell and it will give me the value for that cell.
The catch is I have a ton of these...
In my query analyzer in sql 2000. For some reason the parsing colors that color code syntax have stopped working. All of my text is just black. Does anyone know the option to reenable this?
This happened after I installed an instance of sql server 2005, but I still prefer query analyzer...
I have a column which gives me the GMT hour that a given activity occured in.
so
00
01
02
..
22
23
I have a timezone that the action occured in so 0 for GMT, -5 for EST ect. I need to create an output that gives the hour of the local hour that the action occured in.
Since this GMT hour...
Someone is trying to transfer a database to me via backing it up and then I am restoring it. I am not the person who performed the back-up. The .bak file is only 58 megs and they say they have truncated all tables ect.
When I try and back up the database, I get an error message:
Microsoft...
Having a hard time getting my head around how to write this query.
I have some data that looks like this:
inventory_id incident_timestamp
abc123 4/26/2006 0:00
abc123 7/7/2006 0:00
abc123 7/8/2006 0:00
abc123 7/19/2006 0:00
abc456 4/24/2006 0:00
abc456 7/1/2006 0:00
abc456 7/9/2006 0:00...
I have some data that I want to group in order to search.
An example would look like: (just an exmaple)
id Desc
123 Apples oranges bannanas
124 Apples Libraries
125 Bannanas Apples
126 libraries
127 zoos
Is there a dynamic way to see how many times the words appear in the table?
I could...
I have a database that will build dynamic web pages using HTML stored in ntext fields.
You can have a parent id that corresponds to a full page, and then child id's that actually contain the html and the body of the page.
Example:
parent_guid child_guid body
1 1a HTML1a
1 1b HTML1b
1...
I'm running into a wierd bug that I can't figure out.
I have a column that stores email addresses. For whatever reason, the person who designed this application decided to make it store the email address twice in the same column.
So the data looks like: email@email.com email@email.com...
I have two fields of data that I want to merge based on their dimension.
Example:
Type Data1 Data2
A 60% 0%
B 0% 50%
C 90% 0%
The way the data is setup, there has to be a second data column for Type B. It's due to different calculations that only apply to B.
So I...
I have a problem I can't seem to get my head around.
I have a table that has a column that contains days between issues we log. So it's basically a datediff between the next row.
Example:
ID Issue Days_btwn_issue
1a 1 1
1a 2 0
1a 3 3
1a 4 4
1a 5 10
1a 6 0
I want to calculate a new issue...
Hi, trying to get an open rowset right. I can get it to work if I use a login, but I want to use NT auth.
This works:
select a.*
(from openrowset ('SQLOLEDB',server;'login';'password',
'select * from table') as a
This does not:
select *
from openrowset('SQLOLEDB', 'Trusted_Connection=...
I have 2 databases existing on 2 seperate servers. We'll call them A and B.
I need to get data FROM B, to A, and also base the rows FROM B on criterea from A.
In other words, I have a table on A with a list of IDs that I want. So I need the source table from B to talk to this table on A...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.