sql-server-2008-r2

SQLServer Error: 18546 - SQLState 28000

孤人 提交于 2019-12-13 18:36:09
问题 I have a 3-level application running. WebServer IIS7.5 and SQLServer 2008 R2 Express Database and OS WinServer 2008 WebEdition. When I try to connect via ODBC from a PC on the network have this error. Remote connections with MSSM (Microsoft SqlServer Managemet Studio) work properly. I want to use this ODBC to connect Hyperion to SQLServer Can you help me? 回答1: I resolve to enable TCP/IP service in SQL Server Configuration Manager. After this , if problem persist disable firewall on private

How can I get a SQL String's collation within a CLR function?

白昼怎懂夜的黑 提交于 2019-12-13 18:30:48
问题 I'm writing a Levenshtein Distance function in C# to calculate the edit distance between two strings. The problem is that I'd like to call the method multiple times with different collations but only one collation ever makes it across the SQL to CLR interface - and that is the default collation of the database. Here is the code for the CLR Function: [SqlFunction(IsDeterministic = true, Name = "LevenshteinDistance")] public static SqlInt64 Distance(SqlString textA, SqlString textB) { // get a

adding a field somehow effects a views results

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 18:26:56
问题 Have a very odd situation. For various reasons we have a bunch of tables where this was done: TableA was renamed to TableASource and a view was created called TableA TableB was renamed to TableBSource and a view was created called TableB This all works fine and has done for a fair while. Yesterday I added a new field to TableASource, TableBSource (and the others). This was a field called 'createDate' a smallDateTime, no nulls with a default value of getDate(). You would think this should have

Unable to connect to the report server 2008 r2 [closed]

萝らか妹 提交于 2019-12-13 18:08:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . - i can't to connect report server PC config window 7, II7, sql sever 2008 R2 Reporting services configuration manager give error when i connect to the server give this error Unable to connect to the report server [ServerName] 回答1: Is the reporting services service started? services.msc from the start menu. 回答2:

Better approach of conditional column query

安稳与你 提交于 2019-12-13 18:06:50
问题 --OldQuery SELECT oldStartDate AS column,... FROM Table WHERE oldStartDate > @date,... GROUP BY oldStartDate,... There is a new column newStartDate nullable added to the table and data extraction has to be conditionally depending on this column --NewQuery SELECT ISNULL(newStartDate, oldStartDate) AS column,... FROM Table WHERE ( (newStartDate IS NULL AND oldStartDate > @date) OR (newStartDate > @date) ),... GROUP BY ISNULL(newStartDate, oldStartDate),... Above is the approach I can think of

Quick way to find usages of DB Objects in SQL Server 2008?

泄露秘密 提交于 2019-12-13 17:33:18
问题 Just like Alt F1 gives you information about any DB object., Is there any quick way to find out at what all places is a particular db object refered to. For instance: -A table used in other stored procs. -A stored proc used in other stored procs. -A user defined type used as table value parameter in stored procs. and so on... In the past i have used Red Gate SQL Search but i will have to take permission here at my company to install it. Queries will do too. 回答1: The dependencies information

What conditions cause CHECKSUM_AGG to return 0?

好久不见. 提交于 2019-12-13 17:30:28
问题 It seems that there are a number of conditions that cause CHECKSUM_AGG to return 0 that I wouldn't have expected. I've only been able to find one discussed, which is that duplicate values will cause it. That can be solved via a DISTINCT or GROUP BY . I've also found a couple more scenarios that make less sense to me. One was provided by my boss and one I found MSDN. These I don't know how to explain. Here is some SQL that demonstrates the scenarios: SELECT CHECKSUM_AGG(T.Number) AS

How to create dynamic SQL queries inside CURSOR

倾然丶 夕夏残阳落幕 提交于 2019-12-13 17:28:23
问题 I have to dynamically create a query inside cursor DECLARE @id VARCHAR(10) declare @loc varchar(25) set @loc = '/MainItem/SubItem'; declare @query varchar(max) DECLARE myCursor CURSOR LOCAL FAST_FORWARD FOR SELECT * FROM @tempcolumnname OPEN myCursor FETCH NEXT FROM myCursor INTO @id WHILE @@FETCH_STATUS = 0 BEGIN set @query = 'SELECT * FROM OPENXML(@hdoc, '+@loc+', 3) WITH (code_db_key int)' exec (@query) FETCH NEXT FROM myCursor INTO @id END but executing this throws an exception Msg 137,

SQL Server 2008R2 and creating XML document

北慕城南 提交于 2019-12-13 17:04:41
问题 First post on forum since I am really stuck on this one. The following query correctly assigns a valid XML document to the @xTempXML variable (of type xml). Note: The length of the document (converted to varchar(max) = 711 select @xTempXML = ( select PrescriberFirstName as "row/prescriber/name/first", PrescriberLastName as "row/prescriber/name/last", PrescriberAddress1 as "row/prescriber/address/line1", PrescriberAddress2 as "row/prescriber/address/line2", PrescriberCity as "row/prescriber

set default column value for a specific column in dataGridView

拥有回忆 提交于 2019-12-13 17:02:15
问题 I have a column in GridView, in some cells there are a value and the other cells it's NULL means empty, So I need to put a default value to the empty cells without change any thing to to the cells that have data, means any empty cells I want to change the NULL value to some data let us put as "No Data". Please Help, how can I do it? I get the data from SQL by next code public void showVolunteers(int x) { SqlCommand com = new SqlCommand("SELECT [Vol_ID]as[م],[Vol_Name]as[الاسم],[Team_Info].