473,508 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Select in MSSQL

6 New Member
Hi folks,
I have a problem migrating from Oracle to MSSQL the statement:
stmt2 := 'Select substr('||tabc||',1,50) from '||tabn||'
OPEN cur2 FOR stmt2;

How can I to perform this dynamic select into MSQL ????

Thanks 4 your help
Sep 15 '06 #1
1 2425
agocurti
6 New Member
I partially solved with:

Exec ('select substring('+@chvCol+',1,50) from ' + @chvTable + ......)

with

DECLARE @chvTable sysname, @chvCol sysname
Sep 19 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
8642
by: LineVoltageHalogen | last post by:
Greeting All, I have a stored proc that dynamically truncates all the tables in my databases. I use a cursor and some dynamic sql for this: ...... create cursor Loop through sysobjects and...
9
6597
by: Rodusa | last post by:
I am trying to assign @sql variable to @total, where @sql is a sql statement stored on the database, however what I am getting is its string value and not its calcuation. Could anybody help? ...
15
5159
by: NickName | last post by:
Task: Create 100 or so stored procedure scripts similar to the convention of Generating Script from EM automatically. I thought of essentially two things of a) using sp_helptext to get the...
1
8530
by: quadoc | last post by:
I've the following Select Statement that generates errors, could someone tells me why? :( SELECT TOP 20 * FROM tickets WHERE ticket_ID NOT IN (SELECT TOP 20 * FROM tickets ORDER BY ticket_ID...
7
3371
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
5
6887
by: Daniel Wetzler | last post by:
Dear MSSQL experts, I use MSSQL 2000 and encountered a strange problem wqhile I tried to use a select into statement . If I perform the command command below I get only one dataset which has...
0
1300
by: intergroove | last post by:
Help. This has been bugging me for a couple of days now: I am writing a script to regularly transfer data from a MYSQL db to a MSSQL. Being new to MSSQL I'm a bit freaked out about the...
1
1334
by: David Costello | last post by:
Hello everyone, It would appear I'm trying to do something that's completely undocumented. I can't find anything of any use online to help me with this... I'm working on developing an MSSQL query...
3
6411
by: krzys | last post by:
I have 2 databases (with different user names and different passwords), and I need to join column_1 from table_A (on first database: database_I) on column_2 from table_B (on second database:...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.