Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Wednesday, March 28, 2012

Renamed SQL server and reporting services web site is down?

I renamed my SQL server (MOM 2005 server) and everything works fine execpt
the reporting services. If I type http://server/reports I get an error page
which says:
Error:
The request failed with HTTP status 401: Unauthorized.I'm assuming your reporting service is on the same server that you renamed?
If so, follow these steps.
I've used the steps on a couple of occassions and they work fine.
http://msdn2.microsoft.com/en-us/library/ms345235.aspx
Immy
"Gonzo" <no@.no.com> wrote in message
news:eWhERBVZHHA.3968@.TK2MSFTNGP06.phx.gbl...
>I renamed my SQL server (MOM 2005 server) and everything works fine execpt
>the reporting services. If I type http://server/reports I get an error
>page which says:
> Error:
>
> The request failed with HTTP status 401: Unauthorized.
>
>|||Hi, first of all I can't locate the Reporting Services Configuration tool
and where would the RSReportServer.config be?
"Immy" <therealasianbabe@.hotmail.com> wrote in message
news:OSdX6MVZHHA.5060@.TK2MSFTNGP04.phx.gbl...
> I'm assuming your reporting service is on the same server that you
> renamed? If so, follow these steps.
> I've used the steps on a couple of occassions and they work fine.
> http://msdn2.microsoft.com/en-us/library/ms345235.aspx
> Immy
> "Gonzo" <no@.no.com> wrote in message
> news:eWhERBVZHHA.3968@.TK2MSFTNGP06.phx.gbl...
>>I renamed my SQL server (MOM 2005 server) and everything works fine execpt
>>the reporting services. If I type http://server/reports I get an error
>>page which says:
>> Error:
>>
>> The request failed with HTTP status 401: Unauthorized.
>>
>>
>|||Immy, sorry I found them. A bog thanks as it all works now!!!
"Immy" <therealasianbabe@.hotmail.com> wrote in message
news:OSdX6MVZHHA.5060@.TK2MSFTNGP04.phx.gbl...
> I'm assuming your reporting service is on the same server that you
> renamed? If so, follow these steps.
> I've used the steps on a couple of occassions and they work fine.
> http://msdn2.microsoft.com/en-us/library/ms345235.aspx
> Immy
> "Gonzo" <no@.no.com> wrote in message
> news:eWhERBVZHHA.3968@.TK2MSFTNGP06.phx.gbl...
>>I renamed my SQL server (MOM 2005 server) and everything works fine execpt
>>the reporting services. If I type http://server/reports I get an error
>>page which says:
>> Error:
>>
>> The request failed with HTTP status 401: Unauthorized.
>>
>>
>

Tuesday, March 20, 2012

Removing white spaces in a varchar column

I have a table . It has a nullable column called AccountNumber, which
is of varchar type. The AccountNumber is alpha-numeric. I want to take
data from this table and process it for my application. Before doing
that I would like to filter out duplicate AccountNumbers. I get most of
the duplicates filtered out by using this query:

select * from customers
where AccountNumber NOT IN (select AccountNumber from customers where
AccountNumber <> '' group by AccountNumber having count(AccountNumber)
> 1)

But there are few duplicate entries where the actual AccountNumber is
same, but there is a trailing space in first one, and hence this
duplicate records are not getting filtered out. e.g
"abc123<white-space>" and "abc123" are considered two different entries
by above query.

I ran a query like :

update customers set AccountNumber = LTRIM(RTRIM(AccountNumber)

But even after this query, the trailing space remains, and I am not
able to filter out those entries.

Am I missing anything here? Can somebody help me in making sure I
filter out all duplicate entries ?

Thanks,
RadAre you sure it's a whitespace? It might be a line break. To verify,
you might try something like:

SELECT AccountNumber
FROM customers
WHERE AccountNumber LIKE '%" + CHAR(10)
OR AccountNumber LIKE '%' + CHAR(13)

Oh, and always be cautious about running an UPDATE statement with no
WHERE clause.

HTH,
Stu|||Thanks Stu, you made my day. :)

It was a line break after a white space. I was concentrating only on
the white space and did not notice the line break. So in my first
statement, I first use this query:

UPDATE customers
SET AccountNumber = substring(AccountNumber, 1, PATINDEX('CHAR(13)',
AccountNumber))
WHERE AccountNumber like '%' + CHAR(13)

and it worked!

Thanks again!

Regards,
Rad

Stu wrote:
> Are you sure it's a whitespace? It might be a line break. To verify,
> you might try something like:
> SELECT AccountNumber
> FROM customers
> WHERE AccountNumber LIKE '%" + CHAR(10)
> OR AccountNumber LIKE '%' + CHAR(13)
> Oh, and always be cautious about running an UPDATE statement with no
> WHERE clause.
> HTH,
> Stu|||>> table . It has a nullable column called AccountNumber, which is of VARCHAR(n) type. <<

That is a very bad code design because it prevents check digits and
makes validation rules more complex. If you had validation rules in the
DDL, you would not have this problem. First mop the floor, then fix
the leak.

Monday, March 12, 2012

Removing Sql server 2005 user defined type

I have a user defined type that i am trying to remove from my database. Whe
n
i check it's dependencies, it references itself. I've removed the fields
that used this type but I still can't drop it. Any help would be appreciate
d
Thanks
--
Live long, stay strongCongero,
Have you tried sp_droptype? Also, check the db fixed role memberships of
the db user you are using to drop the udt.
See:
http://msdn2.microsoft.com/en-US/library/ms189765.aspx
HTH
Jerry
"Congero" <congero@.congas.com.nospam> wrote in message
news:B32C9E29-14A8-4AA6-B9E2-C7E535CDDA9B@.microsoft.com...
>I have a user defined type that i am trying to remove from my database.
>When
> i check it's dependencies, it references itself. I've removed the fields
> that used this type but I still can't drop it. Any help would be
> appreciated
> Thanks
> --
> Live long, stay strong

Removing Sql server 2005 user defined type

I have a user defined type that i am trying to remove from my database. When
i check it's dependencies, it references itself. I've removed the fields
that used this type but I still can't drop it. Any help would be appreciated
Thanks
--
Live long, stay strongCongero,
Have you tried sp_droptype? Also, check the db fixed role memberships of
the db user you are using to drop the udt.
See:
http://msdn2.microsoft.com/en-US/library/ms189765.aspx
HTH
Jerry
"Congero" <congero@.congas.com.nospam> wrote in message
news:B32C9E29-14A8-4AA6-B9E2-C7E535CDDA9B@.microsoft.com...
>I have a user defined type that i am trying to remove from my database.
>When
> i check it's dependencies, it references itself. I've removed the fields
> that used this type but I still can't drop it. Any help would be
> appreciated
> Thanks
> --
> Live long, stay strong

Wednesday, March 7, 2012

Removing formatting from imported file

I have a file I'm pulling from another type of database into an Excel spreadsheet and then using my dtsx package to import the spreadsheet into my SQL database. The problem I'm having is that one of the fields coming out of the database to the spreadsheet has the thousands seperator in the field that I want to use as a numeric field without the ",". Right now I have a macro that I run on the spreadsheet to reset the field to straight numbers without commas before importing it, but would like to configure my Integration package to do it automatically.

Any ideas would be appreciated.

Thanks in Advance

Bring the column in as a string, then use a Derived Column transform to clean it and cast it to a number.

Code Snippet

(DT_I4) (REPLACE( [YourColumn] ,",","" ) )

removing duplicated rows

Hi,
Need to remove the duplicated rows from a table which has text/ntext/image type columns. The table does not have any PK/Unique column. (I accept its a bad data model). But currently changing the data model is not possible. Hence doing changes in application.
I couldn't do 'SELECT DISTINCT * from table', since the table has text columns. Though there is no PK constraint, If I know that col1 and col2 are join PKs in the table, Is that possible to select the distinct rows from such a table.
Please advise,
Thanks,
Smithahttp://www.aspfaq.com/2431

wrote in message

news:e3d0a7da-ac87-46f8-a9c5-008fbcb4cd8d@.discussions.microsoft.com...

> Hi,

>

> Need to remove the duplicated rows from a table which has

> text/ntext/image type columns. The table does not have any PK/Unique

> column. (I accept its a bad data model). But currently changing the data

> model is not possible. Hence doing changes in application.

>

> I couldn't do 'SELECT DISTINCT * from table', since the table has text

> columns. Though there is no PK constraint, If I know that col1 and col2

> are join PKs in the table, Is that possible to select the distinct rows

> from such a table.

>

> Please advise,

>

> Thanks,

> Smitha

>

>

removing duplicated records

Hi,

Need to remove the duplicated rows from a table which has text/ntext/image type columns. The table does not have any PK/Unique column. (I accept its a bad data model). But currently changing the data model is not possible. Hence doing changes in application.

I couldn't do 'SELECT DISTINCT * from table', since the table has text columns. Though there is no PK constraint, If I know that col1 and col2 are join PKs in the table, Is that possible to select the distinct rows from such a table.

Please advise,

Thanks,
MiraJwhy dont u post the DDL of table,some describtion abt table|||maybe you could use group by and use max() function to exclude duplicates

select col1, col2, max(text_col3), max(text_col4)...
from t
group by col1, col2...|||why dont u post the DDL of table,some describtion abt table

Table :

create table test(col1 int, col2 int, col3 text, col4 image)|||it is quiet difficult to do, there are some options,
insert all records into temp table ,add unique column before transfering data to temp table

1.If data values are less
than 8000 characters, you can cast the values to VARCHAR(8000) and use DISTINCT or
GROUP by to get the unique row.


If data values are greater than
8000
characters you may have to use a cursor & loop through
the rows & delete the
rows. In some cases you may have to use
an identity column or a number table
( with a cross join
operation ) to easily distingush one row from another.
----------
This link may help u http://www.windowsitpro.com/SQLServer/Article/ArticleID/23234/23234.html