SELECT
p.[name] ProcName,
c.[name] InputParam,
t.[name] DataType,
t.length Length
FROM sysobjects p
JOIN syscolumns c ON
p.[id] = c.[id]
JOIN systypes t ON
c.xtype = t.xtype
WHERE p.xtype = 'p'
AND p.[name] NOT LIKE 'dt_%'
AND t.[name] NOT LIKE 'sysname'
/*** will not work in SQL...
Hi Jim, there is nothing in alphabetical/ numeric order. It is basically like a linked list. For example Item A points to "NextItem" Item X and so on. A simple ORDER BY will not solve this problem.
Item --> NextItem --> AnotherItem and so on. I need to get what is the ordering of each Item...
Borislav Borissov, What if my table is like:
PK ID NextID
-- --- ------
1 AXD NNQ
2 AYX AXD
3 NNQ QWX
4 ABC AYX
Now I want to get a resultset like:
ID DisplayOrder
--- ------------
ABC 1
AYX 2
AXD 3
NNQ 4
QWX 5
I have a table in a following format:
PK ID NextID
-- --- ------
1 200 300
2 100 200
3 300 400
4 50 100
Now I want to get a resultset like:
ID DisplayOrder
--- ------------
50 1
100 2
200 3
300 4
400 5
Thanks in advance.
Add these before you do the INSERT : USE Test
======================================================
CREATE DATABASE Test
GO
CREATE TABLE Test..Job_Title
( Job_Title_Code nvarchar(50) NOT NULL
CONSTRAINT PK_Job_Title_Code PRIMARY KEY NONCLUSTERED,
Job_Title nvarchar(50) NOT NULL...
What is the difference between the following two cases:
Case 1:
CREATE PROC MyProc
AS
.....
RETURN
GO
----------
BEGIN TRAN
EXEC MyProc
COMMIT
===================
Case 2:
CREATE PROC MyProc
AS
BEGIN TRAN
.....
COMMIT
RETURN
GO
----------
EXEC MyProc
Which one of the above is a...
Change your variable declaration for
@TableName varchar(50)
to following:
DECLARE @TableName SysName
Your code should be like:
===================================================
BEGIN
DECLARE
@LastFullUpdate datetime
,@LastIncrementalUpdate datetime
,@LastUpdatedDt...
Here is one solution:
--Create a work table
CREATE TABLE Temp (Col1 varchar(200), Col2 varchar(200))
INSERT INTO Temp
(
Col1,
Col2
)
SELECT Col1, Col2 /*Your main query goes here*/
FROM MyTable
--BCP out the query result saved in Work table
EXEC Master..XP_CmdShell 'bcp...
Could someone suggest me a way to check the underlying objects while compiling a stored procedure? For example if I have a code like this:
---------------------------
CREATE PROC dbo.FOO
AS
SELECT Col1, Col2
FROM dbo.NonExistingTable
RETURN
GO
---------------------------
In this case the...
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.