sql-server-2008-r2

create cte multiple times and drop cte [closed]

我怕爱的太早我们不能终老 提交于 2020-01-25 06:45:47
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I am using a cte in stored procedure. I have to use it multiple times ie populate cte for different ids how can I drop or remove current cte thanks ;WITH PAYOUT_CTE(REGNKEY, REGNTPE) AS ( SELECT REG_KEY, 'Parent' FROM ML_MSTR_REGN A (NOLOCK) WHERE A.COMP_NO = @COMP_NO AND A.REG_KEY = @CUR_KEY UNION

What exactly are CreateDate and ModifyDate in sys.objects

女生的网名这么多〃 提交于 2020-01-24 19:26:05
问题 I've inherited the following admin query and run it from time to time with fully understanding what is it returning: --Loop until the Cursor was not able to fetch WHILE (@@Fetch_Status >= 0) BEGIN --Dump the results of the sp_spaceused query to the temp table INSERT #TempTable EXEC sp_spaceused @TableName --Get the next table name FETCH NEXT FROM tableCursor INTO @TableName END --get rid of the Cursor CLOSE tableCursor DEALLOCATE tableCursor --Select TABLE properties with SIZE -- Final step

Calling a UDF (Sql server) from VB Access “Undefined function <function name> in expression”

隐身守侯 提交于 2020-01-24 19:12:05
问题 I am trying to call a udf (SQL server) from Vb code in access. Connection to DB was successful and I am able to run queries on SQL server tables. However, when I try to call the UDF, it throws me an error saying undefined function . Please see the code below: Private Sub cmd_Login_Click() ' some code here Set db = CurrentDb() sSQL = "SELECT UserID FROM TBL_User_Login WHERE UserName = '" & cbo_User & "' AND Status = 0" Set recset = db.OpenRecordset(sSQL) recset.Close Set rectset = Nothing sSQL

Calling a UDF (Sql server) from VB Access “Undefined function <function name> in expression”

南笙酒味 提交于 2020-01-24 19:11:23
问题 I am trying to call a udf (SQL server) from Vb code in access. Connection to DB was successful and I am able to run queries on SQL server tables. However, when I try to call the UDF, it throws me an error saying undefined function . Please see the code below: Private Sub cmd_Login_Click() ' some code here Set db = CurrentDb() sSQL = "SELECT UserID FROM TBL_User_Login WHERE UserName = '" & cbo_User & "' AND Status = 0" Set recset = db.OpenRecordset(sSQL) recset.Close Set rectset = Nothing sSQL

SSIS File System Task error: The type of the value being assigned to variable … differs from the current variable type

夙愿已清 提交于 2020-01-24 11:54:48
问题 OK... I have a relatively simple SSIS package (DTSDesigner100, Visual Studio 2008 Version 9.0.30729.4462 QFE, .NET Framework 3.5 SP1). At the end of the SSIS control flow for the package is a File System Task which is a Rename File operation. The properties of this File System Task are as follows: IsDetinationPathVariable: True DestinationVariable: User::OutputFileName OverwriteDestination: True Description: File System Task Operation: Rename file IsSourcePathVariable: False SourceConnection:

SSIS File System Task error: The type of the value being assigned to variable … differs from the current variable type

孤人 提交于 2020-01-24 11:53:50
问题 OK... I have a relatively simple SSIS package (DTSDesigner100, Visual Studio 2008 Version 9.0.30729.4462 QFE, .NET Framework 3.5 SP1). At the end of the SSIS control flow for the package is a File System Task which is a Rename File operation. The properties of this File System Task are as follows: IsDetinationPathVariable: True DestinationVariable: User::OutputFileName OverwriteDestination: True Description: File System Task Operation: Rename file IsSourcePathVariable: False SourceConnection:

SSIS File System Task error: The type of the value being assigned to variable … differs from the current variable type

走远了吗. 提交于 2020-01-24 11:53:28
问题 OK... I have a relatively simple SSIS package (DTSDesigner100, Visual Studio 2008 Version 9.0.30729.4462 QFE, .NET Framework 3.5 SP1). At the end of the SSIS control flow for the package is a File System Task which is a Rename File operation. The properties of this File System Task are as follows: IsDetinationPathVariable: True DestinationVariable: User::OutputFileName OverwriteDestination: True Description: File System Task Operation: Rename file IsSourcePathVariable: False SourceConnection:

SSIS File System Task error: The type of the value being assigned to variable … differs from the current variable type

爱⌒轻易说出口 提交于 2020-01-24 11:53:11
问题 OK... I have a relatively simple SSIS package (DTSDesigner100, Visual Studio 2008 Version 9.0.30729.4462 QFE, .NET Framework 3.5 SP1). At the end of the SSIS control flow for the package is a File System Task which is a Rename File operation. The properties of this File System Task are as follows: IsDetinationPathVariable: True DestinationVariable: User::OutputFileName OverwriteDestination: True Description: File System Task Operation: Rename file IsSourcePathVariable: False SourceConnection:

Compressing VARCHAR in SQL 2008/12 - not seeing results

假装没事ソ 提交于 2020-01-24 07:55:06
问题 I have been experimenting with compression in SQL Server but so far I have not seen the results that I expected. To test I have created a new table with single VARCHAR(8000) column and inserted 100k rows into it. Each row contains about 500 words of text, which using ZIP compression sees over a 90% saving in space. I am using the command EXEC sp_estimate_data_compression_savings 'dbo', 'MyTable', NULL, NULL, 'PAGE' ; to check how much space would be saved using PAGE compression, but it is

How do I display fields in sql vertically instead of horizontally

て烟熏妆下的殇ゞ 提交于 2020-01-23 19:51:12
问题 I have this query select raw_item_no, raw_item_no_2, raw_item_no_3, raw_item_no_4 from jtjobfil_sql where job_no = 213418 which outputs like this raw_item_no raw_item_no_2 raw_item_no_3 raw_item_no_4 23 24 25 26 how do I get the output to look like this raw_item_nos 23 24 25 26 I looked into pivot but I couldn't figure out how to do this because I am not summing any columns. 回答1: You can use CROSS APPLY : SELECT x.raw_item_nos FROM jtjobfil_sql t CROSS APPLY ( VALUES (t.raw_item_no), (t.raw